appsfeature / otp-view

OTP View in Android
18 stars 3 forks source link

Direction #2

Open Samira6488 opened 10 months ago

Samira6488 commented 10 months ago

Hello, thanks for your library. I used it in my project. I saw a problem. I configured the direction of project in my theme file. it was like this: rtl, but I wanted to set the direction of OTPTextView to Left-to-right. Unfortunately, it didn't apply. why? what is problem. It is important to say you, I could change the direction of other components easily. could you solve your problem? thanks in advance

appsfeature commented 10 months ago

Are you trying this code android:layoutDirection="ltr" in your OTPTextView <com.otpview.OTPTextView ... android:layoutDirection="ltr" />

Samira6488 commented 10 months ago

Yes, I did, but it didn't apply because I have set bottom style in my themes file:

<style name="Base.Theme.Sample" parent="Theme.Material3.DayNight.NoActionBar">
    <!-- Customize your light theme here. -->
    <item name="fontFamily">@font/vazirmatn</item>
    <item name="android:layoutDirection">rtl</item>
    <item name="android:direction">right_to_left</item>
    <item name="android:textDirection">rtl</item>
    <!-- <item name="colorPrimary">@color/my_light_primary</item> -->
</style>

When I removed rtl from theme bottom lines was applied very well <com.otpview.OTPTextView ... android:layoutDirection="ltr" /> but I don't want to remove rtl from theme do you have any idea or solution?