aabhasr1 / OtpView

A custom view to enter otp/pin of different sizes used usually in cases of authentication.
MIT License
382 stars 99 forks source link

showSuccess() and showError() doesn't work ? #6

Closed dariush-fathie closed 5 years ago

alicanaydemir commented 5 years ago

hi .did you find a solution for that issue ?

aabhasr1 commented 5 years ago

Hi can you explain me the issue

alicanaydemir commented 5 years ago

Yeap when run showSuccess or showError methods, nothing happens. setViewState method runs but views always equal null so no changes for views background

aabhasr1 commented 5 years ago

Thats weird... Let me look into it. You are calling these methods after the views are inflated right?

aabhasr1 commented 5 years ago

Also please share me your xml code for the otpview

alicanaydemir commented 5 years ago

Sorry already deleted the codes. So i can not share. But i have used same version of OtpTextView that you shared on github. Btw i am using androidx

aabhasr1 commented 5 years ago

ok let me check, will get this done by today

aabhasr1 commented 5 years ago

Hi, I have pushed a new version v1.1.1 for androidx. Let me know if you face the issue again

alicanaydemir commented 5 years ago

alright. i am working on another project now. if i encounter that issue again, i wil let you know

aabhasr1 commented 5 years ago

Alright. I am closing the issue till then. If you face the issue again please reopen the ticket

Mohsin92 commented 5 years ago

Hi, otp_view.showSuccess(); its not working if call after OTP completed.

` otp_view.setOtpListener(new OTPListener() { @Override public void onInteractionListener() {

        }

        @Override
        public void onOTPComplete(String otp) {
            if (otp.equalsIgnoreCase(String.valueOf(random_value))) {

                otp_view.showSuccess();

                Intent intent = new Intent(DriverOTPActivity.this, MainActivity.class);
                intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
                startActivity(intent);
                finish();

                Prefs.putString(IS_LOGIN, "true");
            } else {
                otp_view.showError();
            }
        }
    });`
aabhasr1 commented 5 years ago

looking into it

aabhasr1 commented 5 years ago

Hi, I have fixed the bug and created 2 new versions, v1.1.2 and v1.1.2-ktx. Please verify

Mohsin92 commented 5 years ago

Hey Aabhas, I have checked v1.1.2 Issue is fixed now, Its working like charm.

Thank you so much.