Browse Source

Set leftButton color when calling setStyle (#1187)

Guy Carmeli 7 years ago
parent
commit
30e41e6452

+ 11
- 2
android/app/src/main/java/com/reactnativenavigation/views/TitleBar.java View File

@@ -253,13 +253,22 @@ public class TitleBar extends Toolbar {
253 253
             return;
254 254
         }
255 255
         updateButtonColor(titleBarButtonColor);
256
+        setLeftButtonColor(titleBarButtonColor);
256 257
         setButtonsIconColor();
257 258
         setButtonTextColor();
258 259
     }
259 260
 
261
+    private void setLeftButtonColor(StyleParams.Color titleBarButtonColor) {
262
+        if (leftButton != null) {
263
+            leftButton.setColor(titleBarButtonColor.getColor());
264
+        }
265
+    }
266
+
260 267
     private void updateButtonColor(StyleParams.Color titleBarButtonColor) {
261
-        for (TitleBarButtonParams rightButton : rightButtons) {
262
-            rightButton.color = titleBarButtonColor;
268
+        if (rightButtons != null) {
269
+            for (TitleBarButtonParams rightButton : rightButtons) {
270
+                rightButton.color = titleBarButtonColor;
271
+            }
263 272
         }
264 273
     }
265 274