Selaa lähdekoodia

TitleBar text color

Guy Carmeli 8 vuotta sitten
vanhempi
commit
7fd240e201

+ 1
- 0
android/app/src/main/java/com/reactnativenavigation/params/ScreenStyleParams.java Näytä tiedosto

@@ -30,6 +30,7 @@ public class ScreenStyleParams {
30 30
     public boolean topTabsHidden;
31 31
 
32 32
     public boolean titleBarHidden;
33
+    public Color titleBarTitleColor;
33 34
     public boolean backButtonHidden;
34 35
 
35 36
     public boolean bottomTabsHidden;

+ 2
- 0
android/app/src/main/java/com/reactnativenavigation/params/parsers/ScreenStyleParamsParser.java Näytä tiedosto

@@ -15,6 +15,8 @@ public class ScreenStyleParamsParser {
15 15
         result.topBarColor = new ScreenStyleParams.Color(ColorParser.parse(params.getString("topBarColor")));
16 16
         result.navigationBarColor = new ScreenStyleParams.Color(ColorParser.parse(params.getString("navigationBarColor")));
17 17
         result.titleBarHidden = params.getBoolean("titleBarHidden");
18
+        result.titleBarTitleColor =
19
+                new ScreenStyleParams.Color(ColorParser.parse(params.getString("titleBarTitleColor")));
18 20
         result.backButtonHidden = params.getBoolean("backButtonHidden");
19 21
         result.topTabsHidden = params.getBoolean("topTabsHidden");
20 22
         result.bottomTabsHidden = params.getBoolean("bottomTabsHidden");

+ 7
- 0
android/app/src/main/java/com/reactnativenavigation/views/TitleBar.java Näytä tiedosto

@@ -43,6 +43,13 @@ public class TitleBar extends Toolbar {
43 43
 
44 44
     public void setStyle(ScreenStyleParams params) {
45 45
         setVisibility(params.titleBarHidden ? GONE : VISIBLE);
46
+        setTitleTextColor(params);
47
+    }
48
+
49
+    private void setTitleTextColor(ScreenStyleParams params) {
50
+        if (params.titleBarTitleColor.hasColor()) {
51
+            setTitleTextColor(params.titleBarTitleColor.getColor());
52
+        }
46 53
     }
47 54
 
48 55
     private void addButtonsToTitleBar(List<TitleBarButtonParams> rightButtons, String navigatorEventId, Menu menu) {

+ 1
- 0
src/deprecated/platformSpecificDeprecated.android.js Näytä tiedosto

@@ -86,6 +86,7 @@ function adaptNavigationStyleToScreenStyle(screen) {
86 86
     topBarColor: navigatorStyle.toolBarColor,
87 87
     navigationBarColor: navigatorStyle.navigationBarColor,
88 88
     titleBarHidden: navigatorStyle.navBarHidden,
89
+    titleBarTitleColor: navigatorStyle.navBarTextColor,
89 90
     backButtonHidden: navigatorStyle.backButtonHidden,
90 91
     topTabsHidden: navigatorStyle.topTabsHidden,
91 92
     bottomTabsHidden: navigatorStyle.tabBarHidden,