List of usage examples for android.text TextDirectionHeuristics FIRSTSTRONG_LTR
TextDirectionHeuristic FIRSTSTRONG_LTR
To view the source code for android.text TextDirectionHeuristics FIRSTSTRONG_LTR.
Click Source Link
From source file:android.support.v7.widget.AppCompatTextViewAutoSizeHelper.java
@TargetApi(23) private StaticLayout createStaticLayoutForMeasuring(CharSequence text, Layout.Alignment alignment, int availableWidth, int maxLines) { // Can use the StaticLayout.Builder (along with TextView params added in or after // API 23) to construct the layout. final TextDirectionHeuristic textDirectionHeuristic = invokeAndReturnWithDefault(mTextView, "getTextDirectionHeuristic", TextDirectionHeuristics.FIRSTSTRONG_LTR); final StaticLayout.Builder layoutBuilder = StaticLayout.Builder.obtain(text, 0, text.length(), mTempTextPaint, availableWidth); return layoutBuilder.setAlignment(alignment) .setLineSpacing(mTextView.getLineSpacingExtra(), mTextView.getLineSpacingMultiplier()) .setIncludePad(mTextView.getIncludeFontPadding()).setBreakStrategy(mTextView.getBreakStrategy()) .setHyphenationFrequency(mTextView.getHyphenationFrequency()) .setMaxLines(maxLines == -1 ? Integer.MAX_VALUE : maxLines).setTextDirection(textDirectionHeuristic) .build();/*from w ww.j a v a2 s . co m*/ }