aabhasr1/OtpView

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

dariush-fathie opened this issue · 14 comments

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

hi .did you find a solution for that issue ?

Hi can you explain me the issue

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

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

Also please share me your xml code for the otpview

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

ok let me check, will get this done by today

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

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

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

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

  • but If call when we click on Show Error button then it is working fine.

` 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();
            }
        }
    });`

looking into it

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

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

Thank you so much.