I Have a Relative layout and its direction based on app language (there are two directions: LTR and RTL), and I have one view (CheckBox) inside that layout. now I want to make the Checbox direction to the opposite direction to its layout.
Any advice?
Edit
when be the layout direction is LTR I want to make this checkbox direction is RTL, as well when be the layout direction is RTL I want to make this checkbox direction is LTR.
You can use this code:
to determine wether the LayoutDirection is RTL or LTR and set the position of the Checkbox programmatically.
Here is an example:
layout.xml:
MainActivity.java: