public class

BoringLayoutCompat.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.text.BoringLayoutCompat.Builder

Overview

Builder class for BoringLayout.

Summary

Constructors
publicBuilder(java.lang.CharSequence text, TextPaint paint, int width, BoringLayout.Metrics metrics)

Methods
public BoringLayoutbuild()

Create a BoringLayout with the specified values.

public BoringLayoutCompat.BuildersetAlignment(Layout.Alignment align)

Set the alignment.

public BoringLayoutCompat.BuildersetEllipsize(TextUtils.TruncateAt ellipsize)

Set ellipsizing on the layout.

public BoringLayoutCompat.BuildersetEllipsizedWidth(int ellipsizedWidth)

Set the width as used for ellipsizing purposes, if it differs from the normal layout width.

public BoringLayoutCompat.BuildersetIncludePad(boolean includePad)

Set whether to include extra space beyond font ascent and descent (which is needed to avoid clipping in some languages, such as Arabic and Kannada).

public BoringLayoutCompat.BuildersetMetrics(BoringLayout.Metrics metrics)

Set the metric.

public BoringLayoutCompat.BuildersetPaint(TextPaint paint)

Set the paint.

public BoringLayoutCompat.BuildersetText(java.lang.CharSequence text)

Set the text.

public BoringLayoutCompat.BuildersetWidth(int width)

Set the width.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder(java.lang.CharSequence text, TextPaint paint, int width, BoringLayout.Metrics metrics)

Methods

public BoringLayoutCompat.Builder setText(java.lang.CharSequence text)

Set the text. Only useful when re-using the builder.

Parameters:

text: The text to be displayed

Returns:

this builder, useful for chaining

public BoringLayoutCompat.Builder setPaint(TextPaint paint)

Set the paint. Internal for reuse cases only.

Parameters:

paint: The base paint used for layout

Returns:

this builder, useful for chaining

public BoringLayoutCompat.Builder setWidth(int width)

Set the width. Internal for reuse cases only.

Parameters:

width: The width in pixels

Returns:

this builder, useful for chaining

public BoringLayoutCompat.Builder setMetrics(BoringLayout.Metrics metrics)

Set the metric. Internal for reuse cases only.

Parameters:

metrics: the metrics result computed by BoringLayoutCompat.isBoring(CharSequence, TextPaint, TextDirectionHeuristic)

Returns:

this builder, useful for chaining

public BoringLayoutCompat.Builder setAlignment(Layout.Alignment align)

Set the alignment.

Parameters:

align: The width in pixels

Returns:

this builder, useful for chaining

public BoringLayoutCompat.Builder setIncludePad(boolean includePad)

Set whether to include extra space beyond font ascent and descent (which is needed to avoid clipping in some languages, such as Arabic and Kannada). The default is true.

Parameters:

includePad: whether to include padding

Returns:

this builder, useful for chaining

See also: android.widget.TextView

public BoringLayoutCompat.Builder setEllipsize(TextUtils.TruncateAt ellipsize)

Set ellipsizing on the layout. Causes words that are longer than the view is wide, , to be ellipsized instead of broken. The default is null, indicating no ellipsis is to be applied.

Parameters:

ellipsize: type of ellipsis behavior

Returns:

this builder, useful for chaining

See also: android.widget.TextView

public BoringLayoutCompat.Builder setEllipsizedWidth(int ellipsizedWidth)

Set the width as used for ellipsizing purposes, if it differs from the normal layout width. The default is the width passed to BoringLayoutCompat.Builder.Builder(CharSequence, TextPaint, int, BoringLayout.Metrics).

Parameters:

ellipsizedWidth: width used for ellipsizing, in pixels

Returns:

this builder, useful for chaining

See also: android.widget.TextView

public BoringLayout build()

Create a BoringLayout with the specified values.

Returns:

a BoringLayout created with given values.