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
         ScreenStack newStack = new ScreenStack(activity, params.tabParams.get(position));
50
         ScreenStack newStack = new ScreenStack(activity, params.tabParams.get(position));
51
         screenStacks[position] = newStack;
51
         screenStacks[position] = newStack;
52
         newStack.setVisibility(INVISIBLE);
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
     private void createBottomTabs() {
58
     private void createBottomTabs() {

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

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