Is there a way to determine if the device is in a right to left language (something like Arabic) as opposed to something that\'s left to right (English)?
Something c
I think this is a better way:
val isLeftToRight = TextUtilsCompat.getLayoutDirectionFromLocale(Locale.getDefault()) == ViewCompat.LAYOUT_DIRECTION_LTR
Docs:
https://developer.android.com/reference/android/support/v4/text/TextUtilsCompat.html#getLayoutDirectionFromLocale(java.util.Locale)
Or, if you have minAPI 17 or above, you can just use this:
val isLeftToRight=TextUtils.getLayoutDirectionFromLocale(Locale.getDefault())==View.LAYOUT_DIRECTION_LTR
Docs:
https://developer.android.com/reference/android/text/TextUtils.html#getLayoutDirectionFromLocale(java.util.Locale)