Skip to content

Commit

Permalink
Add input uncomplete listener
Browse files Browse the repository at this point in the history
  • Loading branch information
chuongdevJC committed Jul 13, 2020
1 parent 232bd65 commit ba9fb71
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions vcv/src/main/java/com/ccc/vcv/VerificationCodeView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,8 @@ class VerificationCodeView : AppCompatEditText {
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {
if (s.length >= mInputCount) {
mOnInputVerificationCode?.onInputVerificationCodeComplete()
} else {
mOnInputVerificationCode?.onInputVerificationCodeUnComplete()
}
}
})
Expand Down Expand Up @@ -362,7 +364,6 @@ class VerificationCodeView : AppCompatEditText {
mTextPaint.apply {
color = mTextColor
textSize = mTextSize
// isAntiAlias = true
style = Paint.Style.FILL
typeface = this@VerificationCodeView.typeface
}
Expand Down Expand Up @@ -463,5 +464,6 @@ class VerificationCodeView : AppCompatEditText {

interface OnInputVerificationCodeListener {
fun onInputVerificationCodeComplete()
fun onInputVerificationCodeUnComplete()
}
}
}

0 comments on commit ba9fb71

Please sign in to comment.