8000 支持明文密文切换 · pythonzz/LuaViewSDK@f9b79b1 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit f9b79b1

Browse files
author
tuoli
committed
支持明文密文切换
1 parent 4ef2d8b commit f9b79b1

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Android/LuaViewSDK/src/com/taobao/luaview/fun/mapper/ui/UIEditTextMethodMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public LuaValue setInputType(U view, Varargs varargs) {
7272
}
7373

7474
public LuaValue getInputType(U view, Varargs varargs) {
75-
return null;
75+
return valueOf(view.getInputType());
7676
}
7777

7878
/**

Android/LuaViewSDK/src/com/taobao/luaview/userdata/ui/UDEditText.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
*/
2828
public class UDEditText extends UDTextView<EditText> {
2929

30+
private String mType = "text";
31+
3032
public UDEditText(EditText view, Globals globals, LuaValue metatable, Varargs initParams) {
3133
super(view, globals, metatable, initParams);
3234
}
@@ -36,15 +38,25 @@ public UDEditText setInputType(CharSequence text) {
3638
if (view != null) {
3739
if (text.equals("number")) {
3840
view.setInputType(InputType.TYPE_CLASS_NUMBER);
41+
mType = "number";
3942
} else if(text.equals("password")) {
4043
view.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
44+
mType = "password";
45+
} else if(text.equals("visible_password")) {
46+
view.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
47+
mType = "visible_password";
4148
} else {
4249
view.setInputType(InputType.TYPE_CLASS_TEXT);
50+
mType = "text";
4351
}
4452
}
4553
return this;
4654
}
4755

56+
public String getInputType() {
57+
return mType;
58+
}
59+
4860
/**
4961
* 设置提示文本
5062
*

0 commit comments

Comments
 (0)
0