mukeshsolanki / android-otpview-pinview

A custom view to enter otp of different sizes used usually in cases of authentication.
MIT License
714 stars 206 forks source link

Set custom OTP count #17

Closed omkar243 closed 6 years ago

omkar243 commented 6 years ago

How to add OTP count in OTP view. it takes default 4 numbers but I want 6 numbers in OTP.

mukeshsolanki commented 6 years ago

add app:length="4" to your xml view

omkar243 commented 6 years ago

I tried this but it shows error

error: attribute 'mypackagename:length' not found.

my code

  <com.mukesh.OtpView
                android:id="@+id/otp_view"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="42dp"
                android:inputType="number"
                app:otp="-"
                app:length="6"
                android:textColor="#fff"/>
omkar243 commented 6 years ago

Issue Resolved ! error belongs to dependency version I used old version 1.0.2 app:length="6" working in latest version 1.0.5

mukeshsolanki commented 6 years ago

okay thanks for the update