Kaynağa Gözat

Add forceTitlesDisplay property

Guy Carmeli 8 yıl önce
ebeveyn
işleme
304f2ffacc

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

@@ -58,6 +58,7 @@ public class StyleParams {
58 58
     public Color bottomTabsColor;
59 59
     public Color selectedBottomTabsButtonColor;
60 60
     public Color bottomTabsButtonColor;
61
+    public boolean forceTitlesDisplay;
61 62
 
62 63
     public Color navigationBarColor;
63 64
 }

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

@@ -50,6 +50,7 @@ public class StyleParamsParser {
50 50
                 getColor("bottomTabsSelectedButtonColor", getDefaultSelectedBottomTabsButtonColor());
51 51
 
52 52
         result.navigationBarColor = getColor("navigationBarColor", getDefaultNavigationColor());
53
+        result.forceTitlesDisplay = getBoolean("forceTitlesDisplay", getDefaultForceTitlesDisplay());
53 54
 
54 55
         return result;
55 56
     }
@@ -75,6 +76,10 @@ public class StyleParamsParser {
75 76
         return AppStyle.appStyle == null ? new StyleParams.Color() : AppStyle.appStyle.navigationBarColor;
76 77
     }
77 78
 
79
+    private boolean getDefaultForceTitlesDisplay() {
80
+        return AppStyle.appStyle != null && AppStyle.appStyle.forceTitlesDisplay;
81
+    }
82
+
78 83
     @Nullable
79 84
     private StyleParams.Color getDefaultSelectedBottomTabsButtonColor() {
80 85
         return AppStyle.appStyle == null ? new StyleParams.Color() : AppStyle.appStyle.selectedBottomTabsButtonColor;
@@ -138,8 +143,8 @@ public class StyleParamsParser {
138 143
         return AppStyle.appStyle == null ? new StyleParams.Color() : AppStyle.appStyle.statusBarColor;
139 144
     }
140 145
 
141
-    private boolean getBoolean(String titleBarHidden, boolean defaultValue) {
142
-        return params.containsKey(titleBarHidden) ? params.getBoolean(titleBarHidden) : defaultValue;
146
+    private boolean getBoolean(String key, boolean defaultValue) {
147
+        return params.containsKey(key) ? params.getBoolean(key) : defaultValue;
143 148
     }
144 149
 
145 150
     @NonNull

+ 2
- 0
android/app/src/main/java/com/reactnativenavigation/views/BottomTabs.java Dosyayı Görüntüle

@@ -47,6 +47,8 @@ public class BottomTabs extends AHBottomNavigation {
47 47
             setAccentColor(params.selectedBottomTabsButtonColor.getColor());
48 48
         }
49 49
 
50
+        setForceTitlesDisplay(params.forceTitlesDisplay);
51
+
50 52
         setVisibility(params.bottomTabsHidden);
51 53
     }
52 54
 

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

@@ -116,6 +116,7 @@ function convertStyleParams(originalStyleObject) {
116 116
     bottomTabsSelectedButtonColor: originalStyleObject.tabBarSelectedButtonColor,
117 117
     bottomTabsHidden: originalStyleObject.tabBarHidden,
118 118
     bottomTabsHiddenOnScroll: originalStyleObject.bottomTabsHiddenOnScroll,
119
+    forceTitlesDisplay: originalStyleObject.forceTitlesDisplay,
119 120
 
120 121
     navigationBarColor: originalStyleObject.navigationBarColor
121 122
   }