Search in sources :

Example 6 with TextDirectionHeuristic

use of android.text.TextDirectionHeuristic in project android_frameworks_base by crdroidandroid.

the class TextView method onRtlPropertiesChanged.

@Override
public void onRtlPropertiesChanged(int layoutDirection) {
    super.onRtlPropertiesChanged(layoutDirection);
    final TextDirectionHeuristic newTextDir = getTextDirectionHeuristic();
    if (mTextDir != newTextDir) {
        mTextDir = newTextDir;
        if (mLayout != null) {
            checkForRelayout();
        }
    }
}
Also used : TextDirectionHeuristic(android.text.TextDirectionHeuristic)

Example 7 with TextDirectionHeuristic

use of android.text.TextDirectionHeuristic in project incubator-weex by apache.

the class StaticLayoutProxy method create.

public static StaticLayout create(CharSequence source, TextPaint paint, int width, Layout.Alignment align, float spacingmult, float spacingadd, boolean includepad, boolean forceRtl) {
    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR2 && forceRtl) {
        TextDirectionHeuristic textDir = TextDirectionHeuristics.RTL;
        StaticLayout rtlLayout = createInternal(source, paint, width, align, textDir, spacingmult, spacingadd, includepad);
        if (rtlLayout != null) {
            return rtlLayout;
        }
    }
    return new StaticLayout(source, paint, width, align, spacingmult, spacingadd, includepad);
}
Also used : TextDirectionHeuristic(android.text.TextDirectionHeuristic) StaticLayout(android.text.StaticLayout)

Aggregations

TextDirectionHeuristic (android.text.TextDirectionHeuristic)7 TargetApi (android.annotation.TargetApi)1 CheckResult (android.support.annotation.CheckResult)1 StaticLayout (android.text.StaticLayout)1 PasswordTransformationMethod (android.text.method.PasswordTransformationMethod)1