From ba9fb710cae5e509d7c7647b53f26389e7ae3412 Mon Sep 17 00:00:00 2001 From: chuongdevJC Date: Mon, 13 Jul 2020 15:48:20 +0700 Subject: [PATCH] Add input uncomplete listener --- vcv/src/main/java/com/ccc/vcv/VerificationCodeView.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vcv/src/main/java/com/ccc/vcv/VerificationCodeView.kt b/vcv/src/main/java/com/ccc/vcv/VerificationCodeView.kt index cbe9eb0..e9b50e1 100644 --- a/vcv/src/main/java/com/ccc/vcv/VerificationCodeView.kt +++ b/vcv/src/main/java/com/ccc/vcv/VerificationCodeView.kt @@ -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() } } }) @@ -362,7 +364,6 @@ class VerificationCodeView : AppCompatEditText { mTextPaint.apply { color = mTextColor textSize = mTextSize -// isAntiAlias = true style = Paint.Style.FILL typeface = this@VerificationCodeView.typeface } @@ -463,5 +464,6 @@ class VerificationCodeView : AppCompatEditText { interface OnInputVerificationCodeListener { fun onInputVerificationCodeComplete() + fun onInputVerificationCodeUnComplete() } -} \ No newline at end of file +}