List of usage examples for java.lang Character getDirectionality
public static byte getDirectionality(int codePoint)
From source file:Main.java
public static boolean isStrongRightToLeft(char c) { byte dir = Character.getDirectionality(c); return (dir == Character.DIRECTIONALITY_RIGHT_TO_LEFT) || (dir == Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC) || (dir == Character.DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING) || (dir == Character.DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE); }
From source file:com.pdftron.pdf.utils.Utils.java
public static boolean isSystemLanguagePerAra() { if (!isJellyBeanMR1()) { return false; }/*ww w. j ava 2 s . c om*/ final int directionality = Character.getDirectionality(Locale.getDefault().getDisplayName().charAt(0)); if (directionality == Character.DIRECTIONALITY_RIGHT_TO_LEFT || directionality == Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC) { return true; } return false; }
From source file:com.jecelyin.editor.v2.core.text.TextUtils.java
/** * Fallback algorithm to detect the locale direction. Rely on the fist char of the * localized locale name. This will not work if the localized locale name is in English * (this is the case for ICU 4.4 and "Urdu" script) * * @param locale//from ww w.jav a2 s . c om * @return the layout direction. This may be one of: * {@link android.view.View#LAYOUT_DIRECTION_LTR} or * {@link android.view.View#LAYOUT_DIRECTION_RTL}. * * Be careful: this code will need to be updated when vertical scripts will be supported * * @hide */ private static int getLayoutDirectionFromFirstChar(Locale locale) { switch (Character.getDirectionality(locale.getDisplayName(locale).charAt(0))) { case Character.DIRECTIONALITY_RIGHT_TO_LEFT: case Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC: return View.LAYOUT_DIRECTION_RTL; case Character.DIRECTIONALITY_LEFT_TO_RIGHT: default: return View.LAYOUT_DIRECTION_LTR; } }