Quellcode durchsuchen

Add drawUnderTopBar style param

Guy Carmeli vor 8 Jahren
Ursprung
Commit
755dc4350f

+ 3
- 1
android/app/src/main/java/com/reactnativenavigation/layouts/ScreenImpl.java Datei anzeigen

@@ -55,7 +55,9 @@ public class ScreenImpl extends RelativeLayout implements Screen, ScrollDirectio
55 55
     private void addContentView() {
56 56
         contentView = new ContentView(getContext(), screenParams, this);
57 57
         RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT);
58
-        params.addRule(RelativeLayout.BELOW, topBar.getId());
58
+        if (!screenParams.styleParams.drawUnderTopBar) {
59
+            params.addRule(RelativeLayout.BELOW, topBar.getId());
60
+        }
59 61
         addView(contentView, params);
60 62
         contentView.init();
61 63
     }

+ 1
- 0
android/app/src/main/java/com/reactnativenavigation/params/ScreenStyleParams.java Datei anzeigen

@@ -32,4 +32,5 @@ public class ScreenStyleParams {
32 32
     public boolean topTabsHidden;
33 33
     public boolean bottomTabsHidden;
34 34
     public boolean bottomTabsHiddenOnScroll;
35
+    public boolean drawUnderTopBar;
35 36
 }

+ 1
- 0
android/app/src/main/java/com/reactnativenavigation/params/parsers/ScreenStyleParamsParser.java Datei anzeigen

@@ -19,6 +19,7 @@ public class ScreenStyleParamsParser {
19 19
         result.topTabsHidden = params.getBoolean("topTabsHidden");
20 20
         result.bottomTabsHidden = params.getBoolean("bottomTabsHidden");
21 21
         result.bottomTabsHiddenOnScroll = params.getBoolean("bottomTabsHiddenOnScroll");
22
+        result.drawUnderTopBar = params.getBoolean("drawUnderTopBar", false);
22 23
         return result;
23 24
     }
24 25
 }

+ 2
- 1
src/deprecated/platformSpecificDeprecated.android.js Datei anzeigen

@@ -90,7 +90,8 @@ function adaptNavigationStyleToScreenStyle(screen) {
90 90
     backButtonHidden: navigatorStyle.backButtonHidden,
91 91
     topTabsHidden: navigatorStyle.topTabsHidden,
92 92
     bottomTabsHidden: navigatorStyle.tabBarHidden,
93
-    bottomTabsHiddenOnScroll: navigatorStyle.bottomTabsHiddenOnScroll
93
+    bottomTabsHiddenOnScroll: navigatorStyle.bottomTabsHiddenOnScroll,
94
+    drawUnderTopBar: navigatorStyle.drawUnderNavBar
94 95
   };
95 96
 
96 97
   return _.omit(screen, ['navigatorStyle']);