Giter Site home page Giter Site logo

aabhasr1 / otpview Goto Github PK

View Code? Open in Web Editor NEW
358.0 9.0 97.0 2.46 MB

A custom view to enter otp/pin of different sizes used usually in cases of authentication.

License: MIT License

Kotlin 100.00%
otp pinview android android-library pinview-library android-application java-8 xml java library

otpview's Introduction

Hi 👋, I'm Aabhas Jindal

Connect with me:

https://www.linkedin.com/in/aabhas-jindal-b7b863109/    https://stackoverflow.com/users/7241617/aabhas-jindal    @aabhasr1

Languages and Tools:

Programming Languages
java javascript
Mobile App Development
android kotlin
DevOps
aws circleci
Backend as a Service(BaaS)
firebase
Database
mongodb mysql sqlite realm
Backend Development
nodejs
Testing
selenium
Other Tools
sketch postman linux git

aabhasr1

 aabhasr1

otpview's People

Contributors

aabhasr1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

otpview's Issues

Can not find com.github.aabhasr1:OtpView:v1.1.2-ktx

I expect that if I have a check for instance

if(otp=="123456"){
otpTextView?.showSuccess()
}
else {
otpTextView?.showError()
}

But it's not updating the state, it only updates the state when I tap on a button and set the state.

how to change font in otpView

hello, thanks for your great library

i would like to ask, how do i change font in otpView? i see there's attribute called app:text_typeface, but i dont know how to use it programmatically / directly from xml..

thank you

Not working on below Android 6.0

04-04 22:16:01.952 31908-31908/com.spinapp.spinapp E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.spinapp.spinapp, PID: 31908
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.spinapp.spinapp/com.spinapp.spinapp.activity.otplogin.VerifyPhoneActivity}: android.view.InflateException: Binary XML file line #73: Binary XML file line #73: Error inflating class in.aabhasjindal.otptextview.OtpTextView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2560)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2626)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1475)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5740)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:766)
Caused by: android.view.InflateException: Binary XML file line #73: Binary XML file line #73: Error inflating class in.aabhasjindal.otptextview.OtpTextView
at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
at androidx.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:303)
at androidx.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:284)
at com.spinapp.spinapp.activity.otplogin.VerifyPhoneActivity.onCreate(VerifyPhoneActivity.kt:51)
at android.app.Activity.performCreate(Activity.java:6543)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1113)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2513)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2626) 
at android.app.ActivityThread.-wrap11(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1475) 
at android.os.Handler.dispatchMessage(Handler.java:111) 
at android.os.Looper.loop(Looper.java:207) 
at android.app.ActivityThread.main(ActivityThread.java:5740) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:766) 
Caused by: android.view.InflateException: Binary XML file line #73: Error inflating class in.aabhasjindal.otptextview.OtpTextView
at android.view.LayoutInflater.createView(LayoutInflater.java:645)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:838)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:838)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:838)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555) 
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161) 
at androidx.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:303) 
at androidx.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:284) 
at com.spinapp.spinapp.activity.otplogin.VerifyPhoneActivity.onCreate(VerifyPhoneActivity.kt:51) 
at android.app.Activity.performCreate(Activity.java:6543) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1113) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2513) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2626) 
at android.app.ActivityThread.-wrap11(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1475) 
at android.os.Handler.dispatchMessage(Handler.java:111) 
at android.os.Looper.loop(Looper.java:207) 
at android.app.ActivityThread.main(ActivityThread.java:5740) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:766) 
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance(Native Method)
at android.view.LayoutInflater.createView(LayoutInflater.java:619)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:835) 
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:838) 
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:838) 
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:838) 
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:515) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555) 
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161) 
at androidx.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:303) 
at androidx.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:284) 
at com.spinapp.spinapp.activity.otplogin.VerifyPhoneActivity.onCreate(VerifyPhoneActivity.kt:51) 
at android.app.Activity.performCreate(Activity.java:6543) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1113) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2513) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2626) 
at android.app.ActivityThread.-wrap11(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1475) 
at android.os.Handler.dispatchMessage(Handler.java:111) 
at android.os.Looper.loop(Looper.java:207) 
at android.app.ActivityThread.main(ActivityThread.java:5740) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:766) 
Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f0801e4
at android.content.res.Resources.getValue(Resources.java:1552)
at android.content.res.Resources.getDrawable(Resources.java:926)
at android.content.Context.getDrawable(Context.java:463)
at android.view.View.setBackgroundResource(View.java:17558)
at in.aabhasjindal.otptextview.ItemView.generateViews(ItemView.kt:80)
at in.aabhasjindal.otptextview.ItemView.init(ItemView.kt:46)
at in.aabhasjindal.otptextview.ItemView.(ItemView.kt:36)
at in.aabhasjindal.otptextview.OtpTextView.generateViews(OtpTextView.kt:96)
at in.aabhasjindal.otptextview.OtpTextView.styleEditTexts(OtpTextView.kt:61)
at in.aabhasjindal.otptextview.OtpTextView.init(OtpTextView.kt:55)
at in.aabhasjindal.otptextview.OtpTextView.(OtpTextView.kt:46)
at java.lang.reflect.Constructor.newInstance(Native Method) 
at android.view.LayoutInflater.createView(LayoutInflater.java:619) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:835) 
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:838) 
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:838) 
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:838) 
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:515) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555) 
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161) 
at androidx.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:303) 
at androidx.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:284) 
at com.spinapp.spinapp.activity.otplogin.VerifyPhoneActivity.onCreate(VerifyPhoneActivity.kt:51) 
at android.app.Activity.performCreate(Activity.java:6543) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1113) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2513) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2626) 
at android.app.ActivityThread.-wrap11(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1475) 
at android.os.Handler.dispatchMessage(Handler.java:111) 
at android.os.Looper.loop(Looper.java:207) 
at android.app.ActivityThread.main(ActivityThread.java:5740) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:766) 

Unable to enter OTP

Used the java code but was unable to enter the values(when clicked, the keyboard also not visible)

<in.aabhasjindal.otptextview.OtpTextView
android:id="@+id/otp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black"
app:height="40dp"
app:width="40dp"
app:length="6"
app:otp="123456"
app:otp_text_size="@dimen/size_20"
app:otp_box_background="@drawable/otp_box_bg"
android:focusableInTouchMode="true"
android:inputType="number"
android:layout_marginTop="@dimen/cmn_margin" />

First box background focused by default

First of all, great job with the library, I love it.
However, I've noted that the first box's background gives the impression of being focused by default which is misleading for instances where there is another view (Edittext) in focus at the time. Users thinking the pinview is focused type out the pin in the wrong view. Is it possible to only have the focused background either once a user clicks on it or once it is focused on?

Disable Click

How should I restrict user to click and type value in otp view?

Can't work whit the animateLayoutChanges

Hi dude, first nice work with the library, second have been test a little bit and see that when you have a animated layout, the keyboard appear but the focus is not on the EditText,,, for fix it, you must force the keyboard like this for example

this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN)

Error with Kotlin

otpView.setOtpListener(object : OTPListener {
override fun onInteractionListener() {
}

        override fun onOTPComplete(otp: String) {

        }
    })

Error: Unresolved reference: setOtpListner when using in Kotlin
Whereas I had also tried this
otpView.otpListener = (object : OTPListener {
override fun onInteractionListener() {
}

        override fun onOTPComplete(otp: String) {

        }
    })

But the control won't go at listener if OTP text changed.
Can you please help?

Suggestions

box_margin according width of view?
First box left margin & last box right margin = 0

app:hide_otp_drawable=""

When I use this attribute .. the shape will fill whole the box even if I make the vector width and height ="1dp"

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="1dp"
    android:height="1dp"
    android:viewportWidth="48"
    android:viewportHeight="48">
  <path
      android:pathData="M24,24m-24,0a24,24 0,1 1,48 0a24,24 0,1 1,-48 0"
      android:fillColor="#241F20"/>
</vector>

2021-02-23_111846

Needs post-inflation setter for otp_length

Also, please branch development out for people who can't use AndroidX yet so you deploy two artifacts please. Or, at least, backport this change into 1.1.1, I can't use AndroidX.

Error inflating class in.aabhasjindal.otptextview.OtpTextView

I am faced in "Error inflating class in.aabhasjindal.otptextview.OtpTextView" this issue when import the
dependencies {
implementation 'com.github.aabhasr1:OtpView:v1.1.2'
}
library file.

I am also implement OtpTextView library file source code in my project.
How can i fix it?

Two way databinding on otp field

Hello,

First, great job for this library !!!!

Is it possible to add two way data binding on "app:otp" field ?
If you want i can make de changes in a PR.

how to change text_typeFace

how can I change app:text_typeface.
I did it like this. -> app:text_typeface: "myFont.ttf".
but it didn't work.

is there any solution?

Text Color not change

android:textColor="@color/colorPrimaryDark"
thie property already Added.
I want to change the color of pin Text, try many colors doesn't work.
please tell which property use for color change of text
Display only White color text only

Does it support custom keypad android

I have a custom keypad for OTP fields but this OTPtextview open default android number keypad and it is not triggered in touch or click event. Does it has the support?

Thanks in advance!

android:textColor property not working

I try to set android:textColor="@color/red", its not working, after typing the dot color of box is always white, which is not visible if I change the activity color to white.
Please check, I want when I type in the box, the color of the text(which is dot right now) should be black, which is coming white as of now.
As you also shown in attached gif demo file, but what if the screen is white and when I type in the box, the text is not visible.

Error inflating class

Error inflating class in.aabhasjindal.otptextview.OtpTextView

It seems the R class is not found in the init and other subsequent methods

Full sreen view

Is there any possibility to make view match screen width? The view is not adaptive at all

Fill not working on Android 13 running on Samsung 22

On Samsung devices when an OTP text message is sent to the device, it appears as a shortcut in the keyboard to fill the field. This causes the app to freeze on Android 13 running on Samsung 22. On the same device before the update there was no issue. Can supply video.

App crashing when app:hide_otp is set to "true"

It's crashing when app:hide_otp is set to "true". Working perfectly when it's set to "false".

/AndroidRuntime: FATAL EXCEPTION: main
Process: com.aku.myreferrals, PID: 14571
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.aku.myreferrals/com.aku.myreferrals.activities.PinCodeActivity}: android.view.InflateException: Binary XML file line #76: Binary XML file line #76: Error inflating class in.aabhasjindal.otptextview.OtpTextView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: android.view.InflateException: Binary XML file line #76: Binary XML file line #76: Error inflating class in.aabhasjindal.otptextview.OtpTextView
Caused by: android.view.InflateException: Binary XML file line #76: Error inflating class in.aabhasjindal.otptextview.OtpTextView
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at android.view.LayoutInflater.createView(LayoutInflater.java:647)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:699)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:195)
at com.aku.myreferrals.activities.PinCodeActivity.onCreate(PinCodeActivity.java:25)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: android.content.res.Resources$NotFoundException: Resource ID #0xffffff
at android.content.res.ResourcesImpl.getValueForDensity(ResourcesImpl.java:225)
at android.content.res.Resources.getDrawableForDensity(Resources.java:887)
at android.content.res.Resources.getDrawable(Resources.java:827)
at android.content.Context.getDrawable(Context.java:626)
at android.view.View.setBackgroundResource(View.java:21451)
at in.aabhasjindal.otptextview.ItemView.setText(ItemView.java:145)
at in.aabhasjindal.otptextview.OtpTextView.setOTP(OtpTextView.java:177)
at in.aabhasjindal.otptextview.OtpTextView$1.onTextChanged(OtpTextView.java:142)
at android.widget.TextView.sendOnTextChanged(TextView.java:9754)
at android.widget.TextView.setText(TextView.java:5733)
at android.widget.TextView.setText(TextView.java:5571)
at android.widget.EditText.setText(EditText.java:122)
at android.widget.TextView.setText(TextView.java:5528)
at in.aabhasjindal.otptextview.OtpTextView.setOTP(OtpTextView.java:235)
at in.aabhasjindal.otptextview.OtpTextView.generateViews(OtpTextView.java:112)
at in.aabhasjindal.otptextview.OtpTextView.styleEditTexts(OtpTextView.java:69)
at in.aabhasjindal.otptextview.OtpTextView.init(OtpTextView.java:63)
at in.aabhasjindal.otptextview.OtpTextView.(OtpTextView.java:52)
... 28 more

How to prevent keyboard showing after click otpTextView

i have tried using this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN) or android:windowSoftInputMode="stateHidden|adjustResize" in manifest but after tapping otpTextView, the keyboard still showing

showSuccess() not working

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

               }

        override fun onOTPComplete(otp: String) {
            Toasty.success(this@MainActivity, "The OTP is $otp", Toast.LENGTH_SHORT).show()
            otpTextView?.showSuccess()
        }
    }

not working as expected in your sample

if you are using ktx lib showSuccess() working perfectly

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.