static boolean isRtl ( Context context ) { return Build . VERSION . SDK_INT >= Build . VERSION_CODES . JELLY_BEAN_MR1 && context . getResources ( ) . getConfiguration ( ) . getLayoutDirection ( ) == View . LAYOUT_DIRECTION_RTL ; }
Check if layout direction is RTL