Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
* [android] Fix input disable cannot slide (#1656)
Browse files Browse the repository at this point in the history
* * [android] Fix input disable cannot slide

* * [android] Fix NPE

* * [android] No need to actively get focus.
  • Loading branch information
miomin authored and YorkShen committed Oct 23, 2018
1 parent 7a3bfd9 commit f88c225
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,18 @@ public void performOnChange(String value) {
@Override
protected boolean setProperty(String key, Object param) {
switch (key) {
case Constants.Name.DISABLED:
Boolean disabled = WXUtils.getBoolean(param, null);
if (disabled != null && mHost != null) {
if (disabled) {
mHost.setFocusable(false);
mHost.setFocusableInTouchMode(false);
} else {
mHost.setFocusableInTouchMode(true);
mHost.setFocusable(true);
}
}
return true;
case Constants.Name.PLACEHOLDER:
String placeholder = WXUtils.getString(param, null);
if (placeholder != null)
Expand Down

0 comments on commit f88c225

Please sign in to comment.