Kaynağa Gözat

Expose navBarTransparent to Js

closes #21
Guy Carmeli 8 yıl önce
ebeveyn
işleme
1a8f01a607

+ 6
- 5
android/app/src/main/java/com/reactnativenavigation/params/parsers/StyleParamsParser.java Dosyayı Görüntüle

@@ -40,9 +40,10 @@ public class StyleParamsParser {
40 40
         result.selectedTopTabIndicatorHeight = getInt("selectedTopTabIndicatorHeight", getDefaultSelectedTopTabIndicatorHeight());
41 41
         result.selectedTopTabIndicatorColor = getColor("selectedTopTabIndicatorColor", getDefaultSelectedTopTabIndicatorColor());
42 42
 
43
-        // TODO: Uncomment once we support drawBelowTopBar again
44
-        //result.drawScreenBelowTopBar = params.getBoolean("drawBelowTopBar", isDefaultScreenBelowTopBar());
45
-        result.drawScreenBelowTopBar = !result.topBarTransparent;
43
+        result.drawScreenBelowTopBar = params.getBoolean("drawBelowTopBar", getDefaultScreenBelowTopBar());
44
+        if (result.topBarTransparent) {
45
+            result.drawScreenBelowTopBar = false;
46
+        }
46 47
 
47 48
         result.bottomTabsHidden = getBoolean("bottomTabsHidden", getDefaultBottomTabsHidden());
48 49
         result.drawScreenAboveBottomTabs = !result.bottomTabsHidden &&
@@ -126,8 +127,8 @@ public class StyleParamsParser {
126 127
         return AppStyle.appStyle != null && AppStyle.appStyle.bottomTabsHidden;
127 128
     }
128 129
 
129
-    private boolean isDefaultScreenBelowTopBar() {
130
-        return AppStyle.appStyle == null || AppStyle.appStyle.drawScreenBelowTopBar;
130
+    private boolean getDefaultScreenBelowTopBar() {
131
+        return AppStyle.appStyle != null && AppStyle.appStyle.drawScreenBelowTopBar;
131 132
     }
132 133
 
133 134
     private boolean getDefaultTopTabsHidden() {

+ 1
- 1
android/app/src/main/java/com/reactnativenavigation/screens/SingleScreen.java Dosyayı Görüntüle

@@ -19,7 +19,7 @@ public class SingleScreen extends Screen {
19 19
     @Override
20 20
     protected void createContent() {
21 21
         contentView = new ContentView(getContext(), screenParams.screenId, screenParams.navigationParams);
22
-        addView(contentView, createLayoutParams());
22
+        addView(contentView, 0, createLayoutParams());
23 23
     }
24 24
 
25 25
     protected LayoutParams createLayoutParams() {

+ 1
- 0
src/deprecated/platformSpecificDeprecated.android.js Dosyayı Görüntüle

@@ -116,6 +116,7 @@ function convertStyleParams(originalStyleObject) {
116 116
   let ret = {
117 117
     statusBarColor: originalStyleObject.statusBarColor,
118 118
     topBarColor: originalStyleObject.navBarBackgroundColor,
119
+    topBarTransparent: originalStyleObject.navBarTransparent,
119 120
     collapsingToolBarImage: originalStyleObject.collapsingToolBarImage,
120 121
     collapsingToolBarCollapsedColor: originalStyleObject.collapsingToolBarCollapsedColor,
121 122
     titleBarHidden: originalStyleObject.navBarHidden,