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
 public class Button {
16
 public class Button {
17
 	public String id;
17
 	public String id;
18
 	public Text title;
18
 	public Text title;
19
-	public Bool disabled;
19
+	public Bool enabled;
20
 	public Bool disableIconTint;
20
 	public Bool disableIconTint;
21
 	public int showAsAction;
21
 	public int showAsAction;
22
 	@ColorInt public int buttonColor;
22
 	@ColorInt public int buttonColor;
29
 		Button button = new Button();
29
 		Button button = new Button();
30
 		button.id = json.optString("id");
30
 		button.id = json.optString("id");
31
 		button.title = TextParser.parse(json, "title");
31
 		button.title = TextParser.parse(json, "title");
32
-		button.disabled = BoolParser.parse(json,"disabled");
32
+		button.enabled = BoolParser.parse(json,"enabled");
33
 		button.disableIconTint = BoolParser.parse(json,"disableIconTint");
33
 		button.disableIconTint = BoolParser.parse(json,"disableIconTint");
34
 		button.showAsAction = parseShowAsAction(json);
34
 		button.showAsAction = parseShowAsAction(json);
35
 		button.buttonColor = json.optInt("buttonColor", NO_INT_VALUE);
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
 	void addToMenu(Context context, final Menu menu) {
45
 	void addToMenu(Context context, final Menu menu) {
46
 		MenuItem menuItem = menu.add(button.title.get(""));
46
 		MenuItem menuItem = menu.add(button.title.get(""));
47
 		menuItem.setShowAsAction(button.showAsAction);
47
 		menuItem.setShowAsAction(button.showAsAction);
48
-		menuItem.setEnabled(button.disabled.isFalseOrUndefined());
48
+		menuItem.setEnabled(button.enabled.isTrueOrUndefined());
49
 		menuItem.setOnMenuItemClickListener(this);
49
 		menuItem.setOnMenuItemClickListener(this);
50
 
50
 
51
 		if (hasIcon()) {
51
 		if (hasIcon()) {
108
 	}
108
 	}
109
 
109
 
110
 	private void setIconColor() {
110
 	private void setIconColor() {
111
-		if (button.disabled.isFalseOrUndefined()) {
111
+		if (button.enabled.isTrueOrUndefined()) {
112
 			UiUtils.tintDrawable(icon, button.buttonColor);
112
 			UiUtils.tintDrawable(icon, button.buttonColor);
113
 			return;
113
 			return;
114
 		}
114
 		}
115
-
116
 		if (button.disableIconTint.isTrue()) {
115
 		if (button.disableIconTint.isTrue()) {
117
 			UiUtils.tintDrawable(icon, button.buttonColor);
116
 			UiUtils.tintDrawable(icon, button.buttonColor);
118
 		} else {
117
 		} else {