I have recently checked a widget of an application I developed on a device running lollipop and a right-to-left locale (Hebrew). The problem is that Android 5 (lollipop) automatically mirrors everything on the widget (even images), so a text or image that is left adjusted will become right adjusted. This breaks up the widget design. Is there a way to tell Android not to do this for the widget? Is there a layout setting that will prevent this from happening?
Just found the answer. Add to the main/outer layout of the widget the following,
android:layoutDirection="ltr"
and it will force the layout to be left-to-right, even in right-to-left languages. It looks like Lollipop has changed the default setting of the above attribute according to the text direction of the currently active locale.
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