Example usage for java.lang Character DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC

List of usage examples for java.lang Character DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC

Introduction

In this page you can find the example usage for java.lang Character DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC.

Prototype

byte DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC

To view the source code for java.lang Character DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC.

Click Source Link

Document

Strong bidirectional character type "AL" in the Unicode specification.

Usage

From source file:Main.java

public static void main(String[] args) {
    for (char ch = Character.MIN_VALUE; ch < Character.MAX_VALUE; ch++) {
        if (Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC == Character.getDirectionality(ch)) {
            String s = String.format("\\u%04x", (int) ch);
            System.out.println(s);
        }//from  ww w.  ja  v a 2s  . c o  m
    }
}

From source file:Main.java

public static boolean isRTL() {
    final int directionality = Character.getDirectionality(Locale.getDefault().getDisplayName().charAt(0));
    return directionality == Character.DIRECTIONALITY_RIGHT_TO_LEFT
            || directionality == Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC;
}

From source file:Main.java

public static boolean isRTL(Locale locale) {
    final int directionality = Character.getDirectionality(locale.getDisplayName().charAt(0));
    return directionality == Character.DIRECTIONALITY_RIGHT_TO_LEFT
            || directionality == Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC;
}

From source file:Main.java

private static boolean isRTL(Locale locale) {
    int directionality = Character.getDirectionality(locale.getDisplayName().charAt(0));
    return directionality == Character.DIRECTIONALITY_RIGHT_TO_LEFT
            || directionality == Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC;
}

From source file:com.hustunique.jianguo.materialsearchview.SearchViewUtil.java

private static boolean isRTL(Locale locale) {
    final int directionality = Character.getDirectionality(locale.getDisplayName().charAt(0));
    return directionality == Character.DIRECTIONALITY_RIGHT_TO_LEFT
            || directionality == Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC;
}

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:android.text.TextDirectionHeuristics.java

private static int isRtlText(int directionality) {
    switch (directionality) {
    case Character.DIRECTIONALITY_LEFT_TO_RIGHT:
        return STATE_FALSE;
    case Character.DIRECTIONALITY_RIGHT_TO_LEFT:
    case Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC:
        return STATE_TRUE;
    default:/*from w  w w .  java 2  s  .  c o  m*/
        return STATE_UNKNOWN;
    }
}

From source file:android.text.TextDirectionHeuristics.java

private static int isRtlTextOrFormat(int directionality) {
    switch (directionality) {
    case Character.DIRECTIONALITY_LEFT_TO_RIGHT:
    case Character.DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING:
    case Character.DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE:
        return STATE_FALSE;
    case Character.DIRECTIONALITY_RIGHT_TO_LEFT:
    case Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC:
    case Character.DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING:
    case Character.DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE:
        return STATE_TRUE;
    default:/*from   w  ww .  ja  v  a2s .  c  om*/
        return STATE_UNKNOWN;
    }
}

From source file:com.pdftron.pdf.utils.Utils.java

public static boolean isSystemLanguagePerAra() {
    if (!isJellyBeanMR1()) {
        return false;
    }//from   w  w w  .  jav a2  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 w  w w.  ja va 2  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;
    }
}