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/07/05 08:55:36 UTC
[1/4] incubator-weex git commit: fix input component bug
Repository: incubator-weex
Updated Branches:
refs/heads/master 6d4da701c -> 003765f73
fix input component bug
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/003765f7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/003765f7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/003765f7
Branch: refs/heads/master
Commit: 003765f73d8c606c945fcce4b23d10ae3f3e2146
Parents: ee91911
Author: chenfeng <ch...@alibaba-inc.com>
Authored: Thu Jul 5 16:44:16 2018 +0800
Committer: YorkShen <sh...@gmail.com>
Committed: Thu Jul 5 16:53:09 2018 +0800
----------------------------------------------------------------------
.../taobao/weex/ui/component/AbstractEditComponent.java | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/003765f7/android/sdk/src/main/java/com/taobao/weex/ui/component/AbstractEditComponent.java
----------------------------------------------------------------------
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 468cc4e..a072c69 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
@@ -93,8 +93,6 @@ public abstract class AbstractEditComponent extends WXComponent<WXEditText> {
private TextWatcher mTextChangedEventDispatcher;
private int mFormatRepeatCount = 0;
private static final int MAX_TEXT_FORMAT_REPEAT = 3;
- private static final String INPUT_DIGITS = "1234567890-*#+";
- private static final String INPUT_DIGITS_WITH_DOT = "1234567890.";
private TextPaint mPaint = new TextPaint();
private int mLineHeight = UNSET;
@@ -552,7 +550,7 @@ public abstract class AbstractEditComponent extends WXComponent<WXEditText> {
return;
}
mType = type;
- ((EditText) getHostView()).setRawInputType(getInputType(mType));
+ ((EditText) getHostView()).setInputType(getInputType(mType));
switch (mType) {
case Constants.Value.DATE:
case Constants.Value.TIME:
@@ -681,9 +679,6 @@ public abstract class AbstractEditComponent extends WXComponent<WXEditText> {
break;
case Constants.Value.TEL:
inputType = InputType.TYPE_CLASS_PHONE;
- if(getHostView() != null){
- getHostView().setKeyListener(DigitsKeyListener.getInstance(INPUT_DIGITS));
- }
break;
case Constants.Value.TIME:
inputType = InputType.TYPE_NULL;
@@ -696,9 +691,6 @@ public abstract class AbstractEditComponent extends WXComponent<WXEditText> {
break;
case Constants.Value.NUMBER:
inputType = InputType.TYPE_CLASS_NUMBER;
- if(getHostView() != null){
- getHostView().setKeyListener(DigitsKeyListener.getInstance(INPUT_DIGITS_WITH_DOT));
- }
break;
default:
inputType = InputType.TYPE_CLASS_TEXT;
[4/4] incubator-weex git commit: [WEEX-490][android] fix the bug of input component when setting property "type=tel" and "type=number" in input component,users can also input text Bug: 490
Posted by ky...@apache.org.
[WEEX-490][android] fix the bug of input component when setting property "type=tel" and "type=number" in input component,users can also input text
Bug: 490
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/e5b66888
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/e5b66888
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/e5b66888
Branch: refs/heads/master
Commit: e5b6688876c4cec5edbc2e6a9770e0202d724b05
Parents: 6d4da70
Author: chenfeng <ch...@alibaba-inc.com>
Authored: Wed Jul 4 17:11:58 2018 +0800
Committer: YorkShen <sh...@gmail.com>
Committed: Thu Jul 5 16:53:09 2018 +0800
----------------------------------------------------------------------
.../com/taobao/weex/ui/component/AbstractEditComponent.java | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e5b66888/android/sdk/src/main/java/com/taobao/weex/ui/component/AbstractEditComponent.java
----------------------------------------------------------------------
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 139b1b5..3281d56 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
@@ -27,6 +27,7 @@ import android.text.InputType;
import android.text.TextPaint;
import android.text.TextUtils;
import android.text.TextWatcher;
+import android.text.method.DigitsKeyListener;
import android.text.method.PasswordTransformationMethod;
import android.util.Log;
import android.util.TypedValue;
@@ -655,6 +656,8 @@ public abstract class AbstractEditComponent extends WXComponent<WXEditText> {
}
private int getInputType(String type) {
+ String digits = "1234567890";
+ String digitsWithDot = "12234567890.";
int inputType;
switch (type) {
case Constants.Value.TEXT:
@@ -676,6 +679,7 @@ public abstract class AbstractEditComponent extends WXComponent<WXEditText> {
break;
case Constants.Value.TEL:
inputType = InputType.TYPE_CLASS_PHONE;
+ getHostView().setKeyListener(DigitsKeyListener.getInstance(digits));
break;
case Constants.Value.TIME:
inputType = InputType.TYPE_NULL;
@@ -686,6 +690,7 @@ public abstract class AbstractEditComponent extends WXComponent<WXEditText> {
break;
case Constants.Value.NUMBER:
inputType = InputType.TYPE_CLASS_NUMBER;
+ getHostView().setKeyListener(DigitsKeyListener.getInstance(digitsWithDot));
break;
default:
inputType = InputType.TYPE_CLASS_TEXT;
[2/4] incubator-weex git commit: modify code style
Posted by ky...@apache.org.
modify code style
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/ebc7ddb0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/ebc7ddb0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/ebc7ddb0
Branch: refs/heads/master
Commit: ebc7ddb00f279bde7285cde4c5dad77eb12b4502
Parents: e5b6688
Author: chenfeng <ch...@alibaba-inc.com>
Authored: Wed Jul 4 17:38:19 2018 +0800
Committer: YorkShen <sh...@gmail.com>
Committed: Thu Jul 5 16:53:09 2018 +0800
----------------------------------------------------------------------
.../ui/component/AbstractEditComponent.java | 24 +++++++++++++-------
1 file changed, 16 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/ebc7ddb0/android/sdk/src/main/java/com/taobao/weex/ui/component/AbstractEditComponent.java
----------------------------------------------------------------------
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 3281d56..96c7a30 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
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -93,6 +93,8 @@ public abstract class AbstractEditComponent extends WXComponent<WXEditText> {
private TextWatcher mTextChangedEventDispatcher;
private int mFormatRepeatCount = 0;
private static final int MAX_TEXT_FORMAT_REPEAT = 3;
+ private static final String INPUT_DIGITS = "1234567890";
+ private static final String INPUT_DIGITS_WITH_DOT = "1234567890.";
private TextPaint mPaint = new TextPaint();
private int mLineHeight = UNSET;
@@ -656,8 +658,6 @@ public abstract class AbstractEditComponent extends WXComponent<WXEditText> {
}
private int getInputType(String type) {
- String digits = "1234567890";
- String digitsWithDot = "12234567890.";
int inputType;
switch (type) {
case Constants.Value.TEXT:
@@ -675,22 +675,30 @@ public abstract class AbstractEditComponent extends WXComponent<WXEditText> {
break;
case Constants.Value.PASSWORD:
inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD;
- getHostView().setTransformationMethod(PasswordTransformationMethod.getInstance());
+ if(getHostView() != null){
+ getHostView().setTransformationMethod(PasswordTransformationMethod.getInstance());
+ }
break;
case Constants.Value.TEL:
inputType = InputType.TYPE_CLASS_PHONE;
- getHostView().setKeyListener(DigitsKeyListener.getInstance(digits));
+ if(getHostView() != null){
+ getHostView().setKeyListener(DigitsKeyListener.getInstance(INPUT_DIGITS));
+ }
break;
case Constants.Value.TIME:
inputType = InputType.TYPE_NULL;
- getHostView().setFocusable(false);
+ if(getHostView() != null){
+ getHostView().setFocusable(false);
+ }
break;
case Constants.Value.URL:
inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI;
break;
case Constants.Value.NUMBER:
inputType = InputType.TYPE_CLASS_NUMBER;
- getHostView().setKeyListener(DigitsKeyListener.getInstance(digitsWithDot));
+ if(getHostView() != null){
+ getHostView().setKeyListener(DigitsKeyListener.getInstance(INPUT_DIGITS_WITH_DOT));
+ }
break;
default:
inputType = InputType.TYPE_CLASS_TEXT;
[3/4] incubator-weex git commit: support "*#-+" when input type is tel
Posted by ky...@apache.org.
support "*#-+" when input type is tel
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/ee91911e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/ee91911e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/ee91911e
Branch: refs/heads/master
Commit: ee91911e536bbb60d5814f79cef5b67470fc6baa
Parents: ebc7ddb
Author: chenfeng <ch...@alibaba-inc.com>
Authored: Thu Jul 5 16:02:29 2018 +0800
Committer: YorkShen <sh...@gmail.com>
Committed: Thu Jul 5 16:53:09 2018 +0800
----------------------------------------------------------------------
.../java/com/taobao/weex/ui/component/AbstractEditComponent.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/ee91911e/android/sdk/src/main/java/com/taobao/weex/ui/component/AbstractEditComponent.java
----------------------------------------------------------------------
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 96c7a30..468cc4e 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
@@ -93,7 +93,7 @@ public abstract class AbstractEditComponent extends WXComponent<WXEditText> {
private TextWatcher mTextChangedEventDispatcher;
private int mFormatRepeatCount = 0;
private static final int MAX_TEXT_FORMAT_REPEAT = 3;
- private static final String INPUT_DIGITS = "1234567890";
+ private static final String INPUT_DIGITS = "1234567890-*#+";
private static final String INPUT_DIGITS_WITH_DOT = "1234567890.";
private TextPaint mPaint = new TextPaint();