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

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

Introduction

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

Prototype

TextDirectionHeuristicCompat LOCALE

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

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 w w  .  ja  v  a  2s. c o  m*/

        // 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;
        }
    }
}