update
This commit is contained in:
BIN
.idea/caches/build_file_checksums.ser
generated
BIN
.idea/caches/build_file_checksums.ser
generated
Binary file not shown.
BIN
.idea/caches/gradle_models.ser
generated
BIN
.idea/caches/gradle_models.ser
generated
Binary file not shown.
3
.idea/modules.xml
generated
3
.idea/modules.xml
generated
@@ -2,11 +2,8 @@
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/VerificationCodeView.iml" filepath="$PROJECT_DIR$/VerificationCodeView.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/VerificationCodeView.iml" filepath="$PROJECT_DIR$/VerificationCodeView.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/simple/simple.iml" filepath="$PROJECT_DIR$/simple/simple.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/simple/simple.iml" filepath="$PROJECT_DIR$/simple/simple.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/verificationcodeview/verificationcodeview.iml" filepath="$PROJECT_DIR$/verificationcodeview/verificationcodeview.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/verificationcodeview/verificationcodeview.iml" filepath="$PROJECT_DIR$/verificationcodeview/verificationcodeview.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
|
||||
@@ -7,22 +7,22 @@
|
||||
android:orientation="vertical"
|
||||
tools:context="com.jyn.vcview.simple.MainActivity">
|
||||
|
||||
<com.jyn.vcview.VerificationCodeView
|
||||
android:id="@+id/verificationcodeview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="30dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:vcv_et_bg="@drawable/et_login_code"
|
||||
app:vcv_et_cursor="@drawable/et_cursor"
|
||||
app:vcv_et_inputType="numberPassword"
|
||||
app:vcv_et_number="4"
|
||||
app:vcv_et_text_color="@android:color/black"
|
||||
app:vcv_et_text_size="6sp" />
|
||||
<!--<com.jyn.vcview.VerificationCodeView-->
|
||||
<!--android:id="@+id/verificationcodeview"-->
|
||||
<!--android:layout_width="match_parent"-->
|
||||
<!--android:layout_height="wrap_content"-->
|
||||
<!--android:layout_marginTop="30dp"-->
|
||||
<!--android:gravity="center"-->
|
||||
<!--android:orientation="horizontal"-->
|
||||
<!--app:vcv_et_bg="@drawable/et_login_code"-->
|
||||
<!--app:vcv_et_cursor="@drawable/et_cursor"-->
|
||||
<!--app:vcv_et_inputType="number"-->
|
||||
<!--app:vcv_et_number="4"-->
|
||||
<!--app:vcv_et_text_color="@android:color/black"-->
|
||||
<!--app:vcv_et_text_size="6sp" />-->
|
||||
|
||||
<com.jyn.vcview.VerificationCodeView
|
||||
android:id="@+id/verificationcodeview2"
|
||||
android:id="@+id/verificationcodeview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="30dp"
|
||||
@@ -36,6 +36,11 @@
|
||||
app:vcv_et_text_color="@android:color/black"
|
||||
app:vcv_et_text_size="6sp" />
|
||||
|
||||
<EditText
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="numberPassword" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -42,7 +42,7 @@ def libName = "verificationcodeview"
|
||||
//compile引用时的第1部分
|
||||
group = "com.jyn.verificationcodeview"
|
||||
// 版本号,//compile引用时的最后部分项目名,下次更新是只需要更改版本号即可
|
||||
version = "1.0.0"
|
||||
version = "1.0.1"
|
||||
|
||||
//生成源文件
|
||||
task sourcesJar(type: Jar) {
|
||||
|
||||
@@ -8,6 +8,7 @@ import android.text.Editable;
|
||||
import android.text.InputFilter;
|
||||
import android.text.InputType;
|
||||
import android.text.TextWatcher;
|
||||
import android.text.method.PasswordTransformationMethod;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
@@ -158,6 +159,7 @@ public class VerificationCodeView extends LinearLayout implements TextWatcher, V
|
||||
int inputType = typedArray.getInt(R.styleable.vericationCodeView_vcv_et_inputType, VCInputType.NUMBER.ordinal());
|
||||
mEtInputType = VCInputType.values()[inputType];
|
||||
Log.i("main", "mEtInputType:" + mEtInputType);
|
||||
|
||||
mEtWidth = typedArray.getDimensionPixelSize(R.styleable.vericationCodeView_vcv_et_width, 120);
|
||||
mEtTextColor = typedArray.getColor(R.styleable.vericationCodeView_vcv_et_text_color, Color.BLACK);
|
||||
mEtTextSize = typedArray.getDimensionPixelSize(R.styleable.vericationCodeView_vcv_et_text_size, 16);
|
||||
@@ -206,13 +208,14 @@ public class VerificationCodeView extends LinearLayout implements TextWatcher, V
|
||||
editText.setInputType(InputType.TYPE_CLASS_NUMBER);
|
||||
break;
|
||||
case NUMBERPASSWORD:
|
||||
editText.setInputType(InputType.TYPE_NUMBER_VARIATION_PASSWORD);
|
||||
editText.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_VARIATION_PASSWORD);
|
||||
editText.setTransformationMethod(PasswordTransformationMethod.getInstance());
|
||||
break;
|
||||
case TEXT:
|
||||
editText.setInputType(InputType.TYPE_CLASS_TEXT);
|
||||
break;
|
||||
case TEXTPASSWORD:
|
||||
editText.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD);
|
||||
editText.setInputType(InputType.TYPE_CLASS_NUMBER);
|
||||
break;
|
||||
default:
|
||||
editText.setInputType(InputType.TYPE_CLASS_NUMBER);
|
||||
@@ -282,7 +285,7 @@ public class VerificationCodeView extends LinearLayout implements TextWatcher, V
|
||||
if (editText.getText().length() < 1) {
|
||||
if (cursorVisible) {
|
||||
editText.setCursorVisible(true);
|
||||
}else {
|
||||
} else {
|
||||
editText.setCursorVisible(false);
|
||||
}
|
||||
editText.requestFocus();
|
||||
@@ -307,7 +310,7 @@ public class VerificationCodeView extends LinearLayout implements TextWatcher, V
|
||||
editText.setText("");
|
||||
if (cursorVisible) {
|
||||
editText.setCursorVisible(true);
|
||||
}else {
|
||||
} else {
|
||||
editText.setCursorVisible(false);
|
||||
}
|
||||
editText.requestFocus();
|
||||
|
||||
Reference in New Issue
Block a user