Java Code Examples for android.text.TextUtils.getLayoutDirectionFromLocale()

The following are Jave code examples for showing how to use getLayoutDirectionFromLocale() of the android.text.TextUtils class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: android-dialer   File: DialpadView.java   Source Code and License Vote up 5 votes
public DialpadView(Context context, AttributeSet attrs, int defStyle) {
  super(context, attrs, defStyle);

  mTranslateDistance =
      getResources().getDimensionPixelSize(R.dimen.dialpad_key_button_translate_y);

  mIsLandscape =
      getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
  mIsRtl = Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 &&
      TextUtils.getLayoutDirectionFromLocale(Locale.getDefault()) == View.LAYOUT_DIRECTION_RTL;
}
 
Example 2
Project: boohee_v5.6   File: TextUtilsCompatJellybeanMr1.java   Source Code and License Vote up 4 votes
public static int getLayoutDirectionFromLocale(@Nullable Locale locale) {
    return TextUtils.getLayoutDirectionFromLocale(locale);
}
 
Example 3
Project: KomaMusic   File: Utils.java   Source Code and License Vote up 2 votes
/**
 * 阅读习惯是否是从右到左
 *
 * @return true:从右到左 false:从左到右
 */
public static boolean isRTL() {
    final Locale locale = Locale.getDefault();
    return TextUtils.getLayoutDirectionFromLocale(locale) == View.LAYOUT_DIRECTION_RTL;
}