Quellcode durchsuchen

converted layouts to CoordinatorLayout

Daniel Zlotin vor 8 Jahren
Ursprung
Commit
be932b849b

+ 3
- 4
android/app/src/main/java/com/reactnativenavigation/activities/BottomTabActivity.java Datei anzeigen

@@ -4,9 +4,8 @@ import android.graphics.Color;
4 4
 import android.graphics.drawable.Drawable;
5 5
 import android.os.AsyncTask;
6 6
 import android.os.Bundle;
7
-import android.view.Menu;
7
+import android.support.design.widget.CoordinatorLayout;
8 8
 import android.view.View;
9
-import android.widget.FrameLayout;
10 9
 
11 10
 import com.aurelhubert.ahbottomnavigation.AHBottomNavigation;
12 11
 import com.aurelhubert.ahbottomnavigation.AHBottomNavigationItem;
@@ -38,7 +37,7 @@ public class BottomTabActivity extends BaseReactActivity implements AHBottomNavi
38 37
     private static boolean DEFAULT_TAB_INACTIVE_TITLES = true;
39 38
 
40 39
     private AHBottomNavigation mBottomNavigation;
41
-    private FrameLayout mContentFrame;
40
+    private CoordinatorLayout mContentFrame;
42 41
     private ArrayList<ScreenStack> mScreenStacks;
43 42
     private int mCurrentStackPosition = -1;
44 43
 
@@ -50,7 +49,7 @@ public class BottomTabActivity extends BaseReactActivity implements AHBottomNavi
50 49
         setContentView(R.layout.bottom_tab_activity);
51 50
         mToolbar = (RnnToolBar) findViewById(R.id.toolbar);
52 51
         mBottomNavigation = (AHBottomNavigation) findViewById(R.id.bottom_tab_bar);
53
-        mContentFrame = (FrameLayout) findViewById(R.id.contentFrame);
52
+        mContentFrame = (CoordinatorLayout) findViewById(R.id.contentFrame);
54 53
 
55 54
         final ArrayList<Screen> screens = (ArrayList<Screen>) getIntent().getSerializableExtra(EXTRA_SCREENS);
56 55
         final Drawer drawer = (Drawer) getIntent().getSerializableExtra(DRAWER_PARAMS);

+ 2
- 2
android/app/src/main/java/com/reactnativenavigation/activities/SingleScreenActivity.java Datei anzeigen

@@ -1,6 +1,6 @@
1 1
 package com.reactnativenavigation.activities;
2 2
 
3
-import android.widget.FrameLayout;
3
+import android.support.design.widget.CoordinatorLayout;
4 4
 
5 5
 import com.reactnativenavigation.R;
6 6
 import com.reactnativenavigation.core.RctManager;
@@ -34,7 +34,7 @@ public class SingleScreenActivity extends BaseReactActivity {
34 34
         setupDrawer(screen, drawer, R.id.drawerFrame, R.id.drawerLayout);
35 35
 
36 36
         mScreenStack = new ScreenStack(this);
37
-        FrameLayout contentFrame = (FrameLayout) findViewById(R.id.contentFrame);
37
+        CoordinatorLayout contentFrame = (CoordinatorLayout) findViewById(R.id.contentFrame);
38 38
         assert contentFrame != null;
39 39
         contentFrame.addView(mScreenStack);
40 40
         mScreenStack.push(screen);

+ 3
- 3
android/app/src/main/java/com/reactnativenavigation/views/ScreenStack.java Datei anzeigen

@@ -2,9 +2,9 @@ package com.reactnativenavigation.views;
2 2
 
3 3
 import android.animation.LayoutTransition;
4 4
 import android.content.Context;
5
+import android.support.design.widget.CoordinatorLayout;
5 6
 import android.util.AttributeSet;
6 7
 import android.view.ViewGroup;
7
-import android.widget.FrameLayout;
8 8
 
9 9
 import com.facebook.react.ReactInstanceManager;
10 10
 import com.reactnativenavigation.activities.BaseReactActivity;
@@ -15,7 +15,7 @@ import java.util.Stack;
15 15
 
16 16
 import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
17 17
 
18
-public class ScreenStack extends FrameLayout {
18
+public class ScreenStack extends android.support.design.widget.CoordinatorLayout {
19 19
 
20 20
     private static final int DISAPPEAR_ANIMATION_DELAY = 200;
21 21
 
@@ -163,7 +163,7 @@ public class ScreenStack extends FrameLayout {
163 163
     public void addToScreen(ViewGroup parent) {
164 164
         mStack.peek().view.onReAddToScreen();
165 165
 
166
-        parent.addView(this, new FrameLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT));
166
+        parent.addView(this, new CoordinatorLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT));
167 167
     }
168 168
 
169 169
     public void removeAllReactViews() {

+ 1
- 1
android/app/src/main/res/layout/bottom_tab_activity.xml Datei anzeigen

@@ -27,7 +27,7 @@
27 27
         android:layout_height="0dp"
28 28
         android:layout_weight="1">
29 29
 
30
-        <FrameLayout
30
+        <android.support.design.widget.CoordinatorLayout
31 31
             android:id="@+id/contentFrame"
32 32
             android:layout_width="match_parent"
33 33
             android:layout_height="0dp"

+ 1
- 1
android/app/src/main/res/layout/single_screen_activity.xml Datei anzeigen

@@ -23,7 +23,7 @@
23 23
         android:layout_width="match_parent"
24 24
         android:layout_height="match_parent">
25 25
 
26
-        <FrameLayout
26
+        <android.support.design.widget.CoordinatorLayout
27 27
             android:id="@+id/contentFrame"
28 28
             android:layout_width="match_parent"
29 29
             android:layout_height="match_parent" />