Przeglądaj źródła

Set BottomTabs color and

Guy Carmeli 8 lat temu
rodzic
commit
22bba3c6a2

+ 4
- 0
android/app/src/main/java/com/reactnativenavigation/params/parsers/ScreenStyleParamsParser.java Wyświetl plik

@@ -22,6 +22,10 @@ public class ScreenStyleParamsParser {
22 22
         result.bottomTabsHidden = params.getBoolean("bottomTabsHidden");
23 23
         result.bottomTabsHiddenOnScroll = params.getBoolean("bottomTabsHiddenOnScroll");
24 24
         result.bottomTabsColor = new ScreenStyleParams.Color(ColorParser.parse(params.getString("bottomTabsColor")));
25
+        result.bottomTabsButtonColor =
26
+                new ScreenStyleParams.Color(ColorParser.parse(params.getString("bottomTabsButtonColor")));
27
+        result.selectedBottomTabsButtonColor =
28
+                new ScreenStyleParams.Color(ColorParser.parse(params.getString("selectedBottomTabsButtonColor")));
25 29
         result.drawUnderTopBar = params.getBoolean("drawUnderTopBar", false);
26 30
         return result;
27 31
     }

+ 6
- 3
android/app/src/main/java/com/reactnativenavigation/views/BottomTabs.java Wyświetl plik

@@ -27,10 +27,13 @@ public class BottomTabs extends AHBottomNavigation {
27 27
 
28 28
     public void setStyleFromScreen(ScreenStyleParams params) {
29 29
         setBackgroundColor(params.bottomTabsColor);
30
+        if (params.bottomTabsButtonColor.hasColor()) {
31
+            setInactiveColor(params.bottomTabsButtonColor.getColor());
32
+        }
30 33
 
31
-        //        setForceTitlesDisplay(true);
32
-//        setInactiveColor(params.bottomTabsButtonColor.getColor());
33
-//        setAccentColor(params.selectedBottomTabsButtonColor.getColor());
34
+        if (params.selectedBottomTabsButtonColor.hasColor()) {
35
+            setAccentColor(params.selectedBottomTabsButtonColor.getColor());
36
+        }
34 37
     }
35 38
 
36 39
     private void setBackgroundColor(ScreenStyleParams.Color bottomTabsColor) {