|
@@ -8,6 +8,7 @@ import com.balysv.materialmenu.MaterialMenuDrawable;
|
8
|
8
|
import com.reactnativenavigation.NavigationApplication;
|
9
|
9
|
import com.reactnativenavigation.params.TitleBarButtonParams;
|
10
|
10
|
import com.reactnativenavigation.params.TitleBarLeftButtonParams;
|
|
11
|
+import com.reactnativenavigation.utils.ViewUtils;
|
11
|
12
|
|
12
|
13
|
class LeftButton extends MaterialMenuDrawable implements View.OnClickListener {
|
13
|
14
|
|
|
@@ -64,18 +65,29 @@ class LeftButton extends MaterialMenuDrawable implements View.OnClickListener {
|
64
|
65
|
|
65
|
66
|
private void setInitialState() {
|
66
|
67
|
if (params != null) {
|
67
|
|
- setIconState(params.iconState);
|
|
68
|
+ if (params.iconState != null) {
|
|
69
|
+ setIconState(params.iconState);
|
|
70
|
+ }
|
68
|
71
|
} else {
|
69
|
72
|
setVisible(false);
|
70
|
73
|
}
|
71
|
74
|
}
|
72
|
75
|
|
|
76
|
+ @Override
|
|
77
|
+ public void setColor(int color) {
|
|
78
|
+ if (params.hasDefaultIcon()) {
|
|
79
|
+ super.setColor(color);
|
|
80
|
+ } else {
|
|
81
|
+ ViewUtils.tintDrawable(params.icon, color, true );
|
|
82
|
+ }
|
|
83
|
+ }
|
|
84
|
+
|
73
|
85
|
private boolean isBackButton() {
|
74
|
|
- return getIconState() == IconState.ARROW;
|
|
86
|
+ return params.hasDefaultIcon() && getIconState() == IconState.ARROW;
|
75
|
87
|
}
|
76
|
88
|
|
77
|
89
|
private boolean isSideMenuButton() {
|
78
|
|
- return getIconState() == IconState.BURGER;
|
|
90
|
+ return params.hasDefaultIcon() && getIconState() == IconState.BURGER;
|
79
|
91
|
}
|
80
|
92
|
|
81
|
93
|
private void sendClickEvent() {
|