mukeshsolanki / android-otpview-pinview

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

Direction issue in arabic #53

Closed umeshkumar1990 closed 5 years ago

umeshkumar1990 commented 5 years ago

Subject of the issue

In arabic OTP view should start from right to left.

Steps to reproduce

Change language from english to arabic.

Expected behaviour

It should start from right to left in arabic.

Actual behaviour

It's starting from left to right in arabic.

aantoniv commented 5 years ago

I also need the right to left textDirection feature. I've tried to use android:textDirection="rtl" or android:gravity="right" but it does not work correctly with OtpView. @mukeshsolanki Any chances to fix that ?

umeshkumar1990 commented 5 years ago

@aantoniv yes i found the solution for that. Just use android:scaleX="-1" in case of arabic and "1" in case of english. It will work according to language.

aantoniv commented 5 years ago

@umeshkumar1990 I think, that is not exactly what I need :( Probably I mixed two issues.... One regarding arabic language, and other about RTL text direction. If you check usual AppCompatEditText with android:gravity="right" , you'll see what I am trying to achieve

mukeshsolanki commented 5 years ago

@aantoniv I'm held up with other tasks at moment and would probably fix that in the future release but feel free to create a PR for it

mukeshsolanki commented 5 years ago

fixed in the latest version

khan807 commented 3 years ago

how to change the otpview from ltr to rtl direction programatically? @mukeshsolanki