Porting to Android
The Android modifications we will make for this app are similar to the changes made for Expenses, which will be discussed later in Chapter 9,Additional React Native Components. The modifications we are making for Friends is as follows:
- Swapping out
TabBarIOSforDrawerLayoutAndroidandToolbarAndroid - Creating
DrawerandDrawerRowcomponents to supportDrawerLayoutAndroid - Using
Navigatorin the root-levelindex.android.jsfile - Creating an Android-specific version of the
Appcomponent - Updating
FeedListfor Android-specific styling - Modifying
FeedListRowto support Android navigation - Adding
BackAndroidandNavigatorsupport toPostView
Note
In-depth explanations for DrawerLayoutAndroid and ToolbarAndroid can be found in Chapter 9, Additional React Native Components.
Adding DrawerLayoutAndroid and ToolbarAndroid
Let's begin by adding Toolbar/Drawer-based navigation for the Android version of Friends. We will need to start by creating a component called Drawer, which performs the following...