|
@@ -17,7 +17,7 @@ import org.json.JSONObject;
|
17
|
17
|
import java.util.ArrayList;
|
18
|
18
|
|
19
|
19
|
public class Button {
|
20
|
|
- public String id;
|
|
20
|
+ @Nullable public String id;
|
21
|
21
|
public Text text = new NullText();
|
22
|
22
|
public Bool enabled = new NullBool();
|
23
|
23
|
public Bool disableIconTint = new NullBool();
|
|
@@ -105,6 +105,21 @@ public class Button {
|
105
|
105
|
}
|
106
|
106
|
}
|
107
|
107
|
|
|
108
|
+ public void mergeWith(Button other) {
|
|
109
|
+ if (other.text.hasValue()) text = other.text;
|
|
110
|
+ if (other.enabled.hasValue()) enabled = other.enabled;
|
|
111
|
+ if (other.disableIconTint.hasValue()) disableIconTint = other.disableIconTint;
|
|
112
|
+ if (other.color.hasValue()) color = other.color;
|
|
113
|
+ if (other.disabledColor.hasValue()) disabledColor = other.disabledColor;
|
|
114
|
+ if (other.fontSize.hasValue()) fontSize = other.fontSize;
|
|
115
|
+ if (other.fontFamily != null) fontFamily = other.fontFamily;
|
|
116
|
+ if (other.fontWeight.hasValue()) fontWeight = other.fontWeight;
|
|
117
|
+ if (other.testId.hasValue()) testId = other.testId;
|
|
118
|
+ if (other.component.hasValue()) component = other.component;
|
|
119
|
+ if (other.showAsAction.hasValue()) showAsAction = other.showAsAction;
|
|
120
|
+ if (other.icon.hasValue()) icon = other.icon;
|
|
121
|
+ }
|
|
122
|
+
|
108
|
123
|
public void mergeWithDefault(Button defaultOptions) {
|
109
|
124
|
if (!text.hasValue()) text = defaultOptions.text;
|
110
|
125
|
if (!enabled.hasValue()) enabled = defaultOptions.enabled;
|