Override supports Rtl in one of the layouts
I set android:supportsRtl="true" to the <application> in AndroidManifest.xml, but I need one of the views to be left to right , even if the interface language is Hebrew or Arabic. How can I make a particular view be LTR in an RTL application?
In particular, I want to make the linear layout go from left to right, and not by default from right to left, even if the language is from right to left.
To complete responses other than XML, the layout direction can also be programmatically changed using ViewCompat.setLayoutDirection(view, LayoutDirection.RTL) . This API can be used from API 19 onwards, so if your minimum version of the SDK supports APIs below 19, you must run if -check:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { ViewCompat.setLayoutDirection(...)