fix: override setEnbled

This commit is contained in:
guangli.lgl
2017-03-06 22:16:41 +08:00
parent ebcb076a87
commit 3ce99e39a5
7 changed files with 18 additions and 6 deletions

1
.idea/gradle.xml generated
View File

@@ -8,6 +8,7 @@
<option name="modules"> <option name="modules">
<set> <set>
<option value="$PROJECT_DIR$" /> <option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/corelibrary" />
<option value="$PROJECT_DIR$/simple" /> <option value="$PROJECT_DIR$/simple" />
</set> </set>
</option> </option>

2
.idea/misc.xml generated
View File

@@ -37,7 +37,7 @@
<ConfirmationsSetting value="0" id="Add" /> <ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" /> <ConfirmationsSetting value="0" id="Remove" />
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="Android API 23 Platform" project-jdk-type="Android SDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="Android API 23 Platform" project-jdk-type="Android SDK">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="ProjectType"> <component name="ProjectType">

1
.idea/modules.xml generated
View File

@@ -3,6 +3,7 @@
<component name="ProjectModuleManager"> <component name="ProjectModuleManager">
<modules> <modules>
<module fileurl="file://$PROJECT_DIR$/VerificationCodeInput.iml" filepath="$PROJECT_DIR$/VerificationCodeInput.iml" /> <module fileurl="file://$PROJECT_DIR$/VerificationCodeInput.iml" filepath="$PROJECT_DIR$/VerificationCodeInput.iml" />
<module fileurl="file://$PROJECT_DIR$/corelibrary/corelibrary.iml" filepath="$PROJECT_DIR$/corelibrary/corelibrary.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" />
</modules> </modules>
</component> </component>

View File

@@ -68,7 +68,6 @@ Step 2. Add the dependency
dependencies { dependencies {
compile 'com.github.liuguangli:VerificationCodeInput:1.0' compile 'com.github.liuguangli:VerificationCodeInput:1.0'
} }
Share this release:
# MIT # MIT

View File

@@ -181,11 +181,22 @@ public class VerificationCodeInput extends ViewGroup {
if (listener != null) { if (listener != null) {
listener.onComplete(stringBuilder.toString()); listener.onComplete(stringBuilder.toString());
setEnabled(false);
} }
} }
} }
@Override
public void setEnabled(boolean enabled) {
int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
View child = getChildAt(i);
child.setEnabled(enabled);
}
}
public void setOnCompleteListener(Listener listener){ public void setOnCompleteListener(Listener listener){
this.listener = listener; this.listener = listener;
} }
@@ -239,7 +250,7 @@ public class VerificationCodeInput extends ViewGroup {
} }
public static interface Listener { public interface Listener {
void onComplete(String content); void onComplete(String content);
} }

View File

@@ -1 +1 @@
include ':simple'//, ':corelibrary' include ':simple', ':corelibrary'

View File

@@ -26,6 +26,6 @@ dependencies {
}) })
compile 'com.android.support:appcompat-v7:24.2.1' compile 'com.android.support:appcompat-v7:24.2.1'
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
compile 'com.github.liuguangli:VerificationCodeInput:1.0' //compile 'com.github.liuguangli:VerificationCodeInput:1.0'
//compile project(':corelibrary'); compile project(':corelibrary');
} }