Browse Source

POC snackbar and FAB works. some minor formatting

Daniel Zlotin 8 years ago
parent
commit
785170ce27

+ 17
- 18
android/app/src/main/java/com/reactnativenavigation/activities/BaseReactActivity.java View File

46
 
46
 
47
 import javax.annotation.Nullable;
47
 import javax.annotation.Nullable;
48
 
48
 
49
-/**
50
- * Base Activity for React Native applications.
51
- */
52
 public abstract class BaseReactActivity extends AppCompatActivity implements DefaultHardwareBackBtnHandler {
49
 public abstract class BaseReactActivity extends AppCompatActivity implements DefaultHardwareBackBtnHandler {
53
 
50
 
54
     protected static final String KEY_ANIMATED = "animated";
51
     protected static final String KEY_ANIMATED = "animated";
157
         ContextProvider.setActivityContext(this);
154
         ContextProvider.setActivityContext(this);
158
         mReactInstanceManager = createReactInstanceManager();
155
         mReactInstanceManager = createReactInstanceManager();
159
         handleOnCreate();
156
         handleOnCreate();
157
+
160
     }
158
     }
161
 
159
 
162
     /**
160
     /**
176
 
174
 
177
     @CallSuper
175
     @CallSuper
178
     protected void handleOnCreate() {
176
     protected void handleOnCreate() {
179
-        if (getUseDeveloperSupport() && Build.VERSION.SDK_INT >= 23) {
180
-            // Get permission to show redbox in dev builds.
181
-            if (!Settings.canDrawOverlays(this)) {
182
-                Intent serviceIntent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION);
183
-                startActivity(serviceIntent);
184
-                FLog.w(ReactConstants.TAG, REDBOX_PERMISSION_MESSAGE);
185
-                Toast.makeText(this, REDBOX_PERMISSION_MESSAGE, Toast.LENGTH_LONG).show();
186
-            }
177
+        permissionToShowRedboxIfNeeded();
178
+    }
179
+
180
+    private void permissionToShowRedboxIfNeeded() {
181
+        if (getUseDeveloperSupport() && Build.VERSION.SDK_INT >= 23 && !Settings.canDrawOverlays(this)) {
182
+            Intent serviceIntent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION);
183
+            startActivity(serviceIntent);
184
+            FLog.w(ReactConstants.TAG, REDBOX_PERMISSION_MESSAGE);
185
+            Toast.makeText(this, REDBOX_PERMISSION_MESSAGE, Toast.LENGTH_LONG).show();
187
         }
186
         }
188
     }
187
     }
189
 
188
 
230
             mToolbar.update(screen);
229
             mToolbar.update(screen);
231
 
230
 
232
             if (getCurrentNavigatorId().equals(screen.navigatorId) &&
231
             if (getCurrentNavigatorId().equals(screen.navigatorId) &&
233
-                getScreenStackSize() >= 1) {
232
+                    getScreenStackSize() >= 1) {
234
                 mToolbar.setNavUpButton(screen);
233
                 mToolbar.setNavUpButton(screen);
235
             }
234
             }
236
         }
235
         }
239
     @CallSuper
238
     @CallSuper
240
     public Screen pop(String navigatorId) {
239
     public Screen pop(String navigatorId) {
241
         if (mToolbar != null &&
240
         if (mToolbar != null &&
242
-            getCurrentNavigatorId().equals(navigatorId) &&
243
-            getScreenStackSize() <= 2) {
241
+                getCurrentNavigatorId().equals(navigatorId) &&
242
+                getScreenStackSize() <= 2) {
244
             mToolbar.setNavUpButton();
243
             mToolbar.setNavUpButton();
245
         }
244
         }
246
 
245
 
303
     @Override
302
     @Override
304
     public boolean onOptionsItemSelected(MenuItem item) {
303
     public boolean onOptionsItemSelected(MenuItem item) {
305
         if (mDrawerToggle != null &&
304
         if (mDrawerToggle != null &&
306
-            getScreenStackSize() == 1 &&
307
-            mDrawerToggle.onOptionsItemSelected(item)) {
305
+                getScreenStackSize() == 1 &&
306
+                mDrawerToggle.onOptionsItemSelected(item)) {
308
             return true;
307
             return true;
309
         }
308
         }
310
 
309
 
342
     @Override
341
     @Override
343
     public boolean onKeyUp(int keyCode, KeyEvent event) {
342
     public boolean onKeyUp(int keyCode, KeyEvent event) {
344
         if (mReactInstanceManager != null &&
343
         if (mReactInstanceManager != null &&
345
-            mReactInstanceManager.getDevSupportManager().getDevSupportEnabled()) {
344
+                mReactInstanceManager.getDevSupportManager().getDevSupportEnabled()) {
346
             if (keyCode == KeyEvent.KEYCODE_MENU) {
345
             if (keyCode == KeyEvent.KEYCODE_MENU) {
347
                 mReactInstanceManager.showDevOptionsDialog();
346
                 mReactInstanceManager.showDevOptionsDialog();
348
                 return true;
347
                 return true;
400
         mDrawerToggle = mToolbar.setupDrawer(mDrawerLayout, drawer.left, screen);
399
         mDrawerToggle = mToolbar.setupDrawer(mDrawerLayout, drawer.left, screen);
401
     }
400
     }
402
 
401
 
403
-    public void setNavigationButtons(ReadableMap buttons){
402
+    public void setNavigationButtons(ReadableMap buttons) {
404
         if (mToolbar == null) {
403
         if (mToolbar == null) {
405
             return;
404
             return;
406
         }
405
         }

+ 5
- 9
android/app/src/main/java/com/reactnativenavigation/activities/BottomTabActivity.java View File

22
 import java.util.HashMap;
22
 import java.util.HashMap;
23
 import java.util.Map;
23
 import java.util.Map;
24
 
24
 
25
-/**
26
- * Created by guyc on 02/04/16.
27
- */
28
 public class BottomTabActivity extends BaseReactActivity implements AHBottomNavigation.OnTabSelectedListener {
25
 public class BottomTabActivity extends BaseReactActivity implements AHBottomNavigation.OnTabSelectedListener {
29
     public static final String DRAWER_PARAMS = "drawerParams";
26
     public static final String DRAWER_PARAMS = "drawerParams";
30
     public static final String EXTRA_SCREENS = "extraScreens";
27
     public static final String EXTRA_SCREENS = "extraScreens";
84
     @Override
81
     @Override
85
     protected void onResume() {
82
     protected void onResume() {
86
         super.onResume();
83
         super.onResume();
87
-        if(mScreenStacks != null) {
84
+        if (mScreenStacks != null) {
88
             StyleHelper.updateStyles(mToolbar, getCurrentScreen());
85
             StyleHelper.updateStyles(mToolbar, getCurrentScreen());
89
         }
86
         }
90
     }
87
     }
100
     private static int getColor(Bundle bundle, String key, int defaultColor) {
97
     private static int getColor(Bundle bundle, String key, int defaultColor) {
101
         if (bundle.containsKey(key)) {
98
         if (bundle.containsKey(key)) {
102
             return Color.parseColor(bundle.getString(key));
99
             return Color.parseColor(bundle.getString(key));
103
-        }
104
-        else {
100
+        } else {
105
             return defaultColor;
101
             return defaultColor;
106
         }
102
         }
107
     }
103
     }
127
     @Override
123
     @Override
128
     public Screen pop(String navigatorId) {
124
     public Screen pop(String navigatorId) {
129
         super.pop(navigatorId);
125
         super.pop(navigatorId);
130
-        for (ScreenStack stack: mScreenStacks) {
126
+        for (ScreenStack stack : mScreenStacks) {
131
             if (stack.peek().navigatorId.equals(navigatorId)) {
127
             if (stack.peek().navigatorId.equals(navigatorId)) {
132
                 Screen popped = stack.pop();
128
                 Screen popped = stack.pop();
133
                 StyleHelper.updateStyles(mToolbar, getCurrentScreen());
129
                 StyleHelper.updateStyles(mToolbar, getCurrentScreen());
140
     @Override
136
     @Override
141
     public Screen popToRoot(String navigatorId) {
137
     public Screen popToRoot(String navigatorId) {
142
         super.popToRoot(navigatorId);
138
         super.popToRoot(navigatorId);
143
-        for (ScreenStack stack: mScreenStacks) {
139
+        for (ScreenStack stack : mScreenStacks) {
144
             if (stack.peek().navigatorId.equals(navigatorId)) {
140
             if (stack.peek().navigatorId.equals(navigatorId)) {
145
                 Screen popped = stack.popToRoot();
141
                 Screen popped = stack.popToRoot();
146
                 StyleHelper.updateStyles(mToolbar, getCurrentScreen());
142
                 StyleHelper.updateStyles(mToolbar, getCurrentScreen());
261
 
257
 
262
     private void setTabsWithIcons(ArrayList<Screen> screens, Map<Screen, Drawable> icons) {
258
     private void setTabsWithIcons(ArrayList<Screen> screens, Map<Screen, Drawable> icons) {
263
         mScreenStacks = new ArrayList<>();
259
         mScreenStacks = new ArrayList<>();
264
-        for(Screen screen: screens) {
260
+        for (Screen screen : screens) {
265
             ScreenStack stack = new ScreenStack(this);
261
             ScreenStack stack = new ScreenStack(this);
266
             stack.push(screen);
262
             stack.push(screen);
267
             mScreenStacks.add(stack);
263
             mScreenStacks.add(stack);

+ 4
- 1
android/app/src/main/java/com/reactnativenavigation/activities/RootActivity.java View File

1
 package com.reactnativenavigation.activities;
1
 package com.reactnativenavigation.activities;
2
 
2
 
3
+import android.view.ViewGroup;
4
+
3
 import com.facebook.react.ReactRootView;
5
 import com.facebook.react.ReactRootView;
4
 import com.reactnativenavigation.core.objects.Screen;
6
 import com.reactnativenavigation.core.objects.Screen;
5
 
7
 
26
         finish();
28
         finish();
27
     }
29
     }
28
 
30
 
29
-     // No need to implement stack interface since this activity is only used to start other
31
+    // No need to implement stack interface since this activity is only used to start other
30
     // activities such as TabActivity or SingleScreenActivity.
32
     // activities such as TabActivity or SingleScreenActivity.
31
     @Override
33
     @Override
32
     public Screen getCurrentScreen() {
34
     public Screen getCurrentScreen() {
42
     public int getScreenStackSize() {
44
     public int getScreenStackSize() {
43
         return 0;
45
         return 0;
44
     }
46
     }
47
+
45
 }
48
 }

+ 0
- 3
android/app/src/main/java/com/reactnativenavigation/activities/SingleScreenActivity.java View File

10
 import com.reactnativenavigation.views.RnnToolBar;
10
 import com.reactnativenavigation.views.RnnToolBar;
11
 import com.reactnativenavigation.views.ScreenStack;
11
 import com.reactnativenavigation.views.ScreenStack;
12
 
12
 
13
-/**
14
- * Created by guyc on 05/04/16.
15
- */
16
 public class SingleScreenActivity extends BaseReactActivity {
13
 public class SingleScreenActivity extends BaseReactActivity {
17
 
14
 
18
     public static final String DRAWER_PARAMS = "drawerParams";
15
     public static final String DRAWER_PARAMS = "drawerParams";

+ 2
- 0
android/app/src/main/java/com/reactnativenavigation/activities/TabActivity.java View File

1
 package com.reactnativenavigation.activities;
1
 package com.reactnativenavigation.activities;
2
 
2
 
3
+import android.support.design.widget.CoordinatorLayout;
3
 import android.support.v4.view.ViewPager;
4
 import android.support.v4.view.ViewPager;
4
 import android.view.Menu;
5
 import android.view.Menu;
6
+import android.view.ViewGroup;
5
 
7
 
6
 import com.reactnativenavigation.R;
8
 import com.reactnativenavigation.R;
7
 import com.reactnativenavigation.adapters.ViewPagerAdapter;
9
 import com.reactnativenavigation.adapters.ViewPagerAdapter;

+ 0
- 4
android/app/src/main/java/com/reactnativenavigation/modules/RctActivityModule.java View File

23
 
23
 
24
 import java.util.ArrayList;
24
 import java.util.ArrayList;
25
 
25
 
26
-/**
27
- * Created by guyc on 10/03/16.
28
- */
29
 public class RctActivityModule extends ReactContextBaseJavaModule {
26
 public class RctActivityModule extends ReactContextBaseJavaModule {
30
     public static final String REACT_CLASS = "RctActivity";
27
     public static final String REACT_CLASS = "RctActivity";
31
     private static final String KEY_NAVIGATOR_ID = "navigatorID";
28
     private static final String KEY_NAVIGATOR_ID = "navigatorID";
321
         }
318
         }
322
     }
319
     }
323
 
320
 
324
-
325
     /**
321
     /**
326
      * Dismisses the top modal (the last modal pushed).
322
      * Dismisses the top modal (the last modal pushed).
327
      */
323
      */

+ 0
- 4
android/app/src/main/java/com/reactnativenavigation/packages/RnnPackage.java View File

11
 import java.util.Collections;
11
 import java.util.Collections;
12
 import java.util.List;
12
 import java.util.List;
13
 
13
 
14
-/**
15
- *
16
- * Created by guyc on 07/03/16.
17
- */
18
 public class RnnPackage implements ReactPackage {
14
 public class RnnPackage implements ReactPackage {
19
 
15
 
20
     @Override
16
     @Override

+ 13
- 10
android/app/src/main/res/layout/bottom_tab_activity.xml View File

1
 <?xml version="1.0" encoding="utf-8"?>
1
 <?xml version="1.0" encoding="utf-8"?>
2
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
-    xmlns:tools="http://schemas.android.com/tools"
4
     xmlns:app="http://schemas.android.com/apk/res-auto"
3
     xmlns:app="http://schemas.android.com/apk/res-auto"
5
-    android:orientation="vertical"
4
+    xmlns:tools="http://schemas.android.com/tools"
6
     android:layout_width="match_parent"
5
     android:layout_width="match_parent"
7
     android:layout_height="match_parent"
6
     android:layout_height="match_parent"
8
-    tools:context=".activities.TabActivity"
9
-    android:animateLayoutChanges="true">
7
+    android:animateLayoutChanges="true"
8
+    android:orientation="vertical"
9
+    tools:context=".activities.BottomTabActivity">
10
 
10
 
11
     <android.support.design.widget.AppBarLayout
11
     <android.support.design.widget.AppBarLayout
12
         android:id="@+id/appbar"
12
         android:id="@+id/appbar"
13
         android:layout_width="match_parent"
13
         android:layout_width="match_parent"
14
         android:layout_height="wrap_content"
14
         android:layout_height="wrap_content"
15
         android:fitsSystemWindows="true">
15
         android:fitsSystemWindows="true">
16
+
16
         <com.reactnativenavigation.views.RnnToolBar
17
         <com.reactnativenavigation.views.RnnToolBar
17
             android:id="@+id/toolbar"
18
             android:id="@+id/toolbar"
18
             android:layout_width="match_parent"
19
             android:layout_width="match_parent"
19
             android:layout_height="?attr/actionBarSize"
20
             android:layout_height="?attr/actionBarSize"
20
-            app:layout_scrollFlags="scroll|enterAlways"/>
21
+            app:layout_scrollFlags="scroll|enterAlways" />
21
     </android.support.design.widget.AppBarLayout>
22
     </android.support.design.widget.AppBarLayout>
22
 
23
 
23
     <android.support.v4.widget.DrawerLayout
24
     <android.support.v4.widget.DrawerLayout
24
-        xmlns:android="http://schemas.android.com/apk/res/android"
25
         android:id="@+id/drawerLayout"
25
         android:id="@+id/drawerLayout"
26
         android:layout_width="match_parent"
26
         android:layout_width="match_parent"
27
         android:layout_height="0dp"
27
         android:layout_height="0dp"
28
         android:layout_weight="1">
28
         android:layout_weight="1">
29
+
29
         <FrameLayout
30
         <FrameLayout
30
             android:id="@+id/contentFrame"
31
             android:id="@+id/contentFrame"
31
             android:layout_width="match_parent"
32
             android:layout_width="match_parent"
32
             android:layout_height="0dp"
33
             android:layout_height="0dp"
33
-            android:layout_weight="1"/>
34
-        <FrameLayout android:id="@+id/drawerFrame"
34
+            android:layout_weight="1" />
35
+
36
+        <FrameLayout
37
+            android:id="@+id/drawerFrame"
35
             android:layout_width="240dp"
38
             android:layout_width="240dp"
36
             android:layout_height="match_parent"
39
             android:layout_height="match_parent"
37
-            android:layout_gravity="start"/>
40
+            android:layout_gravity="start" />
38
     </android.support.v4.widget.DrawerLayout>
41
     </android.support.v4.widget.DrawerLayout>
39
 
42
 
40
     <com.aurelhubert.ahbottomnavigation.AHBottomNavigation
43
     <com.aurelhubert.ahbottomnavigation.AHBottomNavigation
41
         android:id="@+id/bottom_tab_bar"
44
         android:id="@+id/bottom_tab_bar"
42
         android:layout_width="match_parent"
45
         android:layout_width="match_parent"
43
-        android:layout_height="wrap_content"/>
46
+        android:layout_height="wrap_content" />
44
 
47
 
45
 </LinearLayout>
48
 </LinearLayout>

+ 6
- 5
android/app/src/main/res/layout/modal_layout.xml View File

1
 <?xml version="1.0" encoding="utf-8"?>
1
 <?xml version="1.0" encoding="utf-8"?>
2
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
     xmlns:app="http://schemas.android.com/apk/res-auto"
3
     xmlns:app="http://schemas.android.com/apk/res-auto"
4
-    android:background="@android:color/transparent"
5
-    android:orientation="vertical"
6
     android:layout_width="match_parent"
4
     android:layout_width="match_parent"
7
-    android:layout_height="match_parent">
5
+    android:layout_height="match_parent"
6
+    android:background="@android:color/transparent"
7
+    android:orientation="vertical">
8
 
8
 
9
     <android.support.design.widget.AppBarLayout
9
     <android.support.design.widget.AppBarLayout
10
         android:id="@+id/appbar"
10
         android:id="@+id/appbar"
11
         android:layout_width="match_parent"
11
         android:layout_width="match_parent"
12
         android:layout_height="wrap_content"
12
         android:layout_height="wrap_content"
13
         android:fitsSystemWindows="true">
13
         android:fitsSystemWindows="true">
14
+
14
         <com.reactnativenavigation.views.RnnToolBar
15
         <com.reactnativenavigation.views.RnnToolBar
15
             android:id="@+id/toolbar"
16
             android:id="@+id/toolbar"
16
             android:layout_width="match_parent"
17
             android:layout_width="match_parent"
17
             android:layout_height="?attr/actionBarSize"
18
             android:layout_height="?attr/actionBarSize"
18
-            app:layout_scrollFlags="scroll|enterAlways"/>
19
+            app:layout_scrollFlags="scroll|enterAlways" />
19
     </android.support.design.widget.AppBarLayout>
20
     </android.support.design.widget.AppBarLayout>
20
 
21
 
21
     <com.reactnativenavigation.views.ScreenStack
22
     <com.reactnativenavigation.views.ScreenStack
22
         android:id="@+id/screenStack"
23
         android:id="@+id/screenStack"
23
         android:layout_width="match_parent"
24
         android:layout_width="match_parent"
24
-        android:layout_height="match_parent"/>
25
+        android:layout_height="match_parent" />
25
 </LinearLayout>
26
 </LinearLayout>

+ 10
- 7
android/app/src/main/res/layout/single_screen_activity.xml View File

1
 <?xml version="1.0" encoding="utf-8"?>
1
 <?xml version="1.0" encoding="utf-8"?>
2
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
     xmlns:app="http://schemas.android.com/apk/res-auto"
3
     xmlns:app="http://schemas.android.com/apk/res-auto"
4
-    android:orientation="vertical"
5
     android:layout_width="match_parent"
4
     android:layout_width="match_parent"
6
-    android:layout_height="match_parent">
5
+    android:layout_height="match_parent"
6
+    android:orientation="vertical">
7
 
7
 
8
     <android.support.design.widget.AppBarLayout
8
     <android.support.design.widget.AppBarLayout
9
         android:id="@+id/appbar"
9
         android:id="@+id/appbar"
10
         android:layout_width="match_parent"
10
         android:layout_width="match_parent"
11
         android:layout_height="wrap_content"
11
         android:layout_height="wrap_content"
12
         android:fitsSystemWindows="true">
12
         android:fitsSystemWindows="true">
13
+
13
         <com.reactnativenavigation.views.RnnToolBar
14
         <com.reactnativenavigation.views.RnnToolBar
14
             android:id="@+id/toolbar"
15
             android:id="@+id/toolbar"
15
             android:layout_width="match_parent"
16
             android:layout_width="match_parent"
16
             android:layout_height="?attr/actionBarSize"
17
             android:layout_height="?attr/actionBarSize"
17
-            app:layout_scrollFlags="scroll|enterAlways"/>
18
+            app:layout_scrollFlags="scroll|enterAlways" />
18
     </android.support.design.widget.AppBarLayout>
19
     </android.support.design.widget.AppBarLayout>
19
 
20
 
20
     <android.support.v4.widget.DrawerLayout
21
     <android.support.v4.widget.DrawerLayout
21
-        xmlns:android="http://schemas.android.com/apk/res/android"
22
         android:id="@+id/drawerLayout"
22
         android:id="@+id/drawerLayout"
23
         android:layout_width="match_parent"
23
         android:layout_width="match_parent"
24
         android:layout_height="match_parent">
24
         android:layout_height="match_parent">
25
+
25
         <FrameLayout
26
         <FrameLayout
26
             android:id="@+id/contentFrame"
27
             android:id="@+id/contentFrame"
27
             android:layout_width="match_parent"
28
             android:layout_width="match_parent"
28
-            android:layout_height="match_parent"/>
29
-        <FrameLayout android:id="@+id/drawerFrame"
29
+            android:layout_height="match_parent" />
30
+
31
+        <FrameLayout
32
+            android:id="@+id/drawerFrame"
30
             android:layout_width="240dp"
33
             android:layout_width="240dp"
31
             android:layout_height="match_parent"
34
             android:layout_height="match_parent"
32
-            android:layout_gravity="start"/>
35
+            android:layout_gravity="start" />
33
     </android.support.v4.widget.DrawerLayout>
36
     </android.support.v4.widget.DrawerLayout>
34
 </LinearLayout>
37
 </LinearLayout>

+ 8
- 6
android/app/src/main/res/layout/tab_activity.xml View File

1
 <?xml version="1.0" encoding="utf-8"?>
1
 <?xml version="1.0" encoding="utf-8"?>
2
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
-    xmlns:tools="http://schemas.android.com/tools"
4
     xmlns:app="http://schemas.android.com/apk/res-auto"
3
     xmlns:app="http://schemas.android.com/apk/res-auto"
5
-    android:orientation="vertical"
4
+    xmlns:tools="http://schemas.android.com/tools"
6
     android:layout_width="match_parent"
5
     android:layout_width="match_parent"
7
     android:layout_height="match_parent"
6
     android:layout_height="match_parent"
7
+    android:orientation="vertical"
8
     tools:context=".activities.TabActivity">
8
     tools:context=".activities.TabActivity">
9
 
9
 
10
     <android.support.design.widget.AppBarLayout
10
     <android.support.design.widget.AppBarLayout
12
         android:layout_width="match_parent"
12
         android:layout_width="match_parent"
13
         android:layout_height="wrap_content"
13
         android:layout_height="wrap_content"
14
         android:fitsSystemWindows="true">
14
         android:fitsSystemWindows="true">
15
+
15
         <com.reactnativenavigation.views.RnnToolBar
16
         <com.reactnativenavigation.views.RnnToolBar
16
             android:id="@+id/toolbar"
17
             android:id="@+id/toolbar"
17
             android:layout_width="match_parent"
18
             android:layout_width="match_parent"
18
             android:layout_height="?attr/actionBarSize"
19
             android:layout_height="?attr/actionBarSize"
19
-            app:layout_scrollFlags="scroll|enterAlways"/>
20
+            app:layout_scrollFlags="scroll|enterAlways" />
21
+
20
         <com.reactnativenavigation.views.RnnTabLayout
22
         <com.reactnativenavigation.views.RnnTabLayout
21
             android:id="@+id/tabLayout"
23
             android:id="@+id/tabLayout"
22
             android:layout_width="match_parent"
24
             android:layout_width="match_parent"
23
             android:layout_height="?attr/actionBarSize"
25
             android:layout_height="?attr/actionBarSize"
24
-            app:layout_scrollFlags="scroll|enterAlways"/>
26
+            app:layout_scrollFlags="scroll|enterAlways" />
25
     </android.support.design.widget.AppBarLayout>
27
     </android.support.design.widget.AppBarLayout>
26
 
28
 
27
     <android.support.v4.view.ViewPager
29
     <android.support.v4.view.ViewPager
28
         android:id="@+id/viewPager"
30
         android:id="@+id/viewPager"
29
-        app:layout_behavior="@string/appbar_scrolling_view_behavior"
30
         android:layout_width="match_parent"
31
         android:layout_width="match_parent"
31
-        android:layout_height="match_parent"/>
32
+        android:layout_height="match_parent"
33
+        app:layout_behavior="@string/appbar_scrolling_view_behavior" />
32
 </LinearLayout>
34
 </LinearLayout>