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();
}
}
}
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);
}
Aggregations