trying to set the layout elements to be RTL ordered
in 4.2 and above the line: layoutDirection="rtl"
and in the manifest: android:supportsRtl="true"
is working just fine.
but for below 4.2 its not.
solution anyone ?
trying to set the layout elements to be RTL ordered
in 4.2 and above the line: layoutDirection="rtl"
and in the manifest: android:supportsRtl="true"
is working just fine.
but for below 4.2 its not.
solution anyone ?
You won't be able to. It was added to in API Level 17 which is 4.2 so the older versions do not support it.
layout-v17
so that the new APIs use the RTL layout, then create a layout for older verions that have the XML in the way round you need –
Vibraculum Just use ViewCompat using android.support.v4.view to do it.
ViewCompat.setLayoutDirection(findViewById(R.id.my_view), ViewCompat.LAYOUT_DIRECTION_RTL);
You won't be able to. It was added to in API Level 17 which is 4.2 so the older versions do not support it.
layout-v17
so that the new APIs use the RTL layout, then create a layout for older verions that have the XML in the way round you need –
Vibraculum you can change your application language and solve this problem :
String languageToLoad = "en";
Locale locale = new Locale(languageToLoad);
Locale.setDefault(locale);
Configuration config = new Configuration();
config.locale = locale;
getBaseContext().getResources().updateConfiguration(config,
getBaseContext().getResources().getDisplayMetrics());
© 2022 - 2024 — McMap. All rights reserved.