Code Monkey home page Code Monkey logo

Comments (6)

aabhasr1 avatar aabhasr1 commented on August 21, 2024

ill look into this. till then see if you can use the non ktx version in the project

from otpview.

aabhasr1 avatar aabhasr1 commented on August 21, 2024

i am using this

otpTextView.otpListener = object : OTPListener {
            override fun onInteractionListener() {
                otpTextView.resetState()
            }

            override fun onOTPComplete(otp: String) {
            }
        }

and it is working fine

from otpview.

aabhasr1 avatar aabhasr1 commented on August 21, 2024

can you share me more of your code and use case and lets try to solve this

from otpview.

SemicolonIndia avatar SemicolonIndia commented on August 21, 2024

otpTextView.otpListener = object : OTPListener {
override fun onInteractionListener() {
otpTextView.resetState()
}

        override fun onOTPComplete(otp: String) {
        }
    }

By using this method control is not triggered and came to any of these overridden methods.
Whereas if I implement OTPListener and these two methods in .kt file

override fun onInteractionListener() {}

override fun onOTPComplete(otp: String) {
if (otp.equals("1234", true)) { //Hard codes example OTP as 1234
otpView.showSuccess() // Added a debbuger point here
} else {
otpView.showError() // And a debbuger point here
}
}
Then control is pointing to these methods but not entering in if condition or its else, it just retun without any errror message.

P.S. I am using Android Studio SDK 29, with JDK 8 with a setting of Support Instant App.

from otpview.

aabhasr1 avatar aabhasr1 commented on August 21, 2024

ok let me test

from otpview.

SemicolonIndia avatar SemicolonIndia commented on August 21, 2024

Hi,
I had made it work by setting the different background drawable for each error/success/neutral through program instead of assigning it through XML and using

showSuccess()

or

showError()

And do appreciate your approach to help your OTP View is very useful. Thank you very much for making it and sharing it in the public domain.

from otpview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.