Browse Source

rename disabled to enabled (#2750)

Guy Carmeli 6 years ago
parent
commit
2dbda3c1ea
No account linked to committer's email address

+ 2
- 2
lib/android/app/src/main/java/com/reactnativenavigation/parse/Button.java View File

@@ -16,7 +16,7 @@ import static com.reactnativenavigation.parse.Options.NO_INT_VALUE;
16 16
 public class Button {
17 17
 	public String id;
18 18
 	public Text title;
19
-	public Bool disabled;
19
+	public Bool enabled;
20 20
 	public Bool disableIconTint;
21 21
 	public int showAsAction;
22 22
 	@ColorInt public int buttonColor;
@@ -29,7 +29,7 @@ public class Button {
29 29
 		Button button = new Button();
30 30
 		button.id = json.optString("id");
31 31
 		button.title = TextParser.parse(json, "title");
32
-		button.disabled = BoolParser.parse(json,"disabled");
32
+		button.enabled = BoolParser.parse(json,"enabled");
33 33
 		button.disableIconTint = BoolParser.parse(json,"disableIconTint");
34 34
 		button.showAsAction = parseShowAsAction(json);
35 35
 		button.buttonColor = json.optInt("buttonColor", NO_INT_VALUE);

+ 2
- 3
lib/android/app/src/main/java/com/reactnativenavigation/views/TitleBarButton.java View File

@@ -45,7 +45,7 @@ public class TitleBarButton implements MenuItem.OnMenuItemClickListener {
45 45
 	void addToMenu(Context context, final Menu menu) {
46 46
 		MenuItem menuItem = menu.add(button.title.get(""));
47 47
 		menuItem.setShowAsAction(button.showAsAction);
48
-		menuItem.setEnabled(button.disabled.isFalseOrUndefined());
48
+		menuItem.setEnabled(button.enabled.isTrueOrUndefined());
49 49
 		menuItem.setOnMenuItemClickListener(this);
50 50
 
51 51
 		if (hasIcon()) {
@@ -108,11 +108,10 @@ public class TitleBarButton implements MenuItem.OnMenuItemClickListener {
108 108
 	}
109 109
 
110 110
 	private void setIconColor() {
111
-		if (button.disabled.isFalseOrUndefined()) {
111
+		if (button.enabled.isTrueOrUndefined()) {
112 112
 			UiUtils.tintDrawable(icon, button.buttonColor);
113 113
 			return;
114 114
 		}
115
-
116 115
 		if (button.disableIconTint.isTrue()) {
117 116
 			UiUtils.tintDrawable(icon, button.buttonColor);
118 117
 		} else {