Browse Source

Draw all views above BottomTabs

Since we don't fully support hideOnScroll property yet, draw all views
above BottomTabs
Guy Carmeli 8 years ago
parent
commit
b12b899b93

+ 3
- 1
android/app/src/main/java/com/reactnativenavigation/layouts/BottomTabsLayout.java View File

@@ -50,7 +50,9 @@ public class BottomTabsLayout extends RelativeLayout implements Layout, AHBottom
50 50
         ScreenStack newStack = new ScreenStack(activity, params.tabParams.get(position));
51 51
         screenStacks[position] = newStack;
52 52
         newStack.setVisibility(INVISIBLE);
53
-        addView(newStack, 0, new LayoutParams(MATCH_PARENT, MATCH_PARENT));
53
+        LayoutParams lp = new LayoutParams(MATCH_PARENT, MATCH_PARENT);
54
+        lp.addRule(ABOVE, bottomTabs.getId());
55
+        addView(newStack, 0, lp);
54 56
     }
55 57
 
56 58
     private void createBottomTabs() {

+ 2
- 0
android/app/src/main/java/com/reactnativenavigation/views/BottomTabs.java View File

@@ -7,6 +7,7 @@ import com.aurelhubert.ahbottomnavigation.AHBottomNavigation;
7 7
 import com.aurelhubert.ahbottomnavigation.AHBottomNavigationItem;
8 8
 import com.reactnativenavigation.params.ScreenParams;
9 9
 import com.reactnativenavigation.params.StyleParams;
10
+import com.reactnativenavigation.utils.ViewUtils;
10 11
 
11 12
 import java.util.List;
12 13
 
@@ -14,6 +15,7 @@ public class BottomTabs extends AHBottomNavigation {
14 15
     public BottomTabs(Context context) {
15 16
         super(context);
16 17
         setForceTint(true);
18
+        setId(ViewUtils.generateViewId());
17 19
     }
18 20
 
19 21
     public void addTabs(List<ScreenParams> params, OnTabSelectedListener onTabSelectedListener) {