瀏覽代碼

Set leftButton color when calling setStyle (#1187)

Guy Carmeli 7 年之前
父節點
當前提交
30e41e6452
共有 1 個檔案被更改,包括 11 行新增2 行删除
  1. 11
    2
      android/app/src/main/java/com/reactnativenavigation/views/TitleBar.java

+ 11
- 2
android/app/src/main/java/com/reactnativenavigation/views/TitleBar.java 查看文件

@@ -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