Example usage for android.support.v4.text TextDirectionHeuristicsCompat RTL

List of usage examples for android.support.v4.text TextDirectionHeuristicsCompat RTL

Introduction

In this page you can find the example usage for android.support.v4.text TextDirectionHeuristicsCompat RTL.

Prototype

TextDirectionHeuristicCompat RTL

To view the source code for android.support.v4.text TextDirectionHeuristicsCompat RTL.

Click Source Link

Usage

From source file:com.bitflake.counter.HorizontalPicker.java

private TextDirectionHeuristicCompat getTextDirectionHeuristic() {

    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {

        return TextDirectionHeuristicsCompat.FIRSTSTRONG_LTR;

    } else {//from w ww  . j ava  2s.  com

        // Always need to resolve layout direction first
        final boolean defaultIsRtl = (getLayoutDirection() == LAYOUT_DIRECTION_RTL);

        switch (getTextDirection()) {
        default:
        case TEXT_DIRECTION_FIRST_STRONG:
            return (defaultIsRtl ? TextDirectionHeuristicsCompat.FIRSTSTRONG_RTL
                    : TextDirectionHeuristicsCompat.FIRSTSTRONG_LTR);
        case TEXT_DIRECTION_ANY_RTL:
            return TextDirectionHeuristicsCompat.ANYRTL_LTR;
        case TEXT_DIRECTION_LTR:
            return TextDirectionHeuristicsCompat.LTR;
        case TEXT_DIRECTION_RTL:
            return TextDirectionHeuristicsCompat.RTL;
        case TEXT_DIRECTION_LOCALE:
            return TextDirectionHeuristicsCompat.LOCALE;
        }
    }
}