Ver código fonte

[Android] Support custom icon for left nav button on TitleBar (#1013)



Support customize icon for left nav button in android
Jing Tai Piao 7 anos atrás
pai
commit
5d4757be00

+ 6
- 1
android/app/src/main/java/com/reactnativenavigation/views/TitleBar.java Ver arquivo

@@ -139,7 +139,12 @@ public class TitleBar extends Toolbar {
139 139
         leftButton = new LeftButton(getContext(), leftButtonParams, leftButtonOnClickListener, navigatorEventId,
140 140
                 overrideBackPressInJs);
141 141
         setNavigationOnClickListener(leftButton);
142
-        setNavigationIcon(leftButton);
142
+
143
+        if (leftButtonParams.icon != null) {
144
+            setNavigationIcon(leftButtonParams.icon);
145
+        } else {
146
+            setNavigationIcon(leftButton);
147
+        }
143 148
     }
144 149
 
145 150
     public void hide() {