Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using left/right instead of start/end attributes [warning] #262

Open
uomar8 opened this issue Feb 10, 2023 · 1 comment
Open

Using left/right instead of start/end attributes [warning] #262

uomar8 opened this issue Feb 10, 2023 · 1 comment

Comments

@uomar8
Copy link
Contributor

uomar8 commented Feb 10, 2023

there are warnings on

-FloatingView.kt
-MovableFloatingView.kt

I think it will fix some layouts RTL problem

it says

Using left/right instead of start/end attributes Using Gravity#LEFT and Gravity#RIGHT can lead to problems when a layout is rendered in locales where text flows from right to left. Use Gravity#START and Gravity#END instead. Similarly, in XML gravity and layout_gravity attributes, use start rather than left. For XML attributes such as paddingLeft and layout_marginLeft, use paddingStart and layout_marginStart. NOTE: If your minSdkVersion is less than 17, you should add both the older left/right attributes as well as the new start/end attributes. On older platforms, where RTL is not supported and the start/end attributes are unknown and therefore ignored, you need the older left/right attributes. There is a separate lint check which catches that type of error. (Note: For Gravity#LEFT and Gravity#START, you can use these constants even when targeting older platforms, because the start bitmask is a superset of the left bitmask. Therefore, you can use gravity="start" rather than gravity="left|start".) Issue id: RtlHardcoded

@uomar8 uomar8 changed the title Using left/right instead of start/end attributes Using left/right instead of start/end attributes [warning] Feb 10, 2023
@uomar8
Copy link
Contributor Author

uomar8 commented Feb 10, 2023

-main/src/main/java/tw/firemaples/onscreenocr/floatings/base/FloatingView.kt
-main/src/main/java/tw/firemaples/onscreenocr/floatings/base/MovableFloatingView.kt

tried to change

Gravity.LEFT to Gravity.START

still RTL doesn't work 🤔 I think something else needs to be changed as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant