You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ky...@apache.org on 2018/10/23 08:43:25 UTC

[incubator-weex] branch master updated: * [android] Fix input disable cannot slide (#1656)

This is an automated email from the ASF dual-hosted git repository.

kyork pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git


The following commit(s) were added to refs/heads/master by this push:
     new f88c225  * [android] Fix input disable cannot slide (#1656)
f88c225 is described below

commit f88c225409f0ff5fa068701928ae06fc69cb514f
Author: 莫绪旻 <mi...@foxmail.com>
AuthorDate: Tue Oct 23 16:43:21 2018 +0800

    * [android] Fix input disable cannot slide (#1656)
    
    * * [android] Fix input disable cannot slide
    
    * * [android] Fix NPE
    
    * * [android] No need to actively get focus.
---
 .../com/taobao/weex/ui/component/AbstractEditComponent.java  | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/component/AbstractEditComponent.java b/android/sdk/src/main/java/com/taobao/weex/ui/component/AbstractEditComponent.java
index d6885f8..80b9bf9 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/component/AbstractEditComponent.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/AbstractEditComponent.java
@@ -413,6 +413,18 @@ public abstract class AbstractEditComponent extends WXComponent<WXEditText> {
   @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)