Skip to content

Commit

Permalink
add auto clearChar()
Browse files Browse the repository at this point in the history
  • Loading branch information
sangzn34 committed Aug 3, 2019
1 parent 19479e8 commit 21db8f0
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public class PasscodeView extends FrameLayout implements View.OnClickListener {
private int passcodeType = TYPE_SET_PASSCODE;

private boolean isAutoNext = false;
private boolean isAutoClear = false;

public PasscodeView(@NonNull Context context) {
this(context, null);
Expand Down Expand Up @@ -222,6 +223,11 @@ public PasscodeView setIsAutoNext(boolean isAutoNext) {
return this;
}

public PasscodeView setIsAutoClear(boolean isAutoClear) {
this.isAutoClear = isAutoClear;
return this;
}

public String getFirstInputTip() {
return firstInputTip;
}
Expand Down Expand Up @@ -458,6 +464,9 @@ public void onAnimationEnd(Animator animation) {
if (secondInput && listener != null) {
listener.onFail(getPasscodeFromView());
}
if (isAutoClear) {
clearChar();
}
}
});
animator.start();
Expand Down

0 comments on commit 21db8f0

Please sign in to comment.