I change my layoutDirection to RTL, but in both RTL and LTR direction getX() method return the same number. this method calculate X from left side of screen. How can I change the behavior of the layout to calculate X from the right of the screen ? thanks alot.
View system in android works independently from layout directions! which means ,in your case and any others cases, it works properly and calculates X and Y from top-left of the screen!
for your problem there is two approaches :
one calculate x from right of the screen with like below pseudo
screenWidth - getX()
two reverse your code to work with real X.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With