@UnstableApi
public final class Cue.Builder


A builder for Cue objects.

Summary

Public constructors

Public methods

Cue

Build the cue.

Cue.Builder

Sets windowColorSet to false.

@Nullable Bitmap

Gets the cue image.

float

Gets the bitmap height as a fraction of the viewport size.

float

Gets the position of the lineAnchor of the cue box within the viewport in the direction orthogonal to the writing direction.

int

Gets the cue box anchor positioned by line.

int

Gets the type of the value of getLine.

float

Gets the fractional position of the positionAnchor of the cue box within the viewport in the direction orthogonal to line.

int

Gets the cue box anchor positioned by position.

float

Gets the size of the cue box in the writing direction specified as a fraction of the viewport size in that direction.

@Nullable CharSequence

Gets the cue text.

@Nullable Layout.Alignment

Gets the alignment of the cue text within the cue box, or null if the alignment is undefined.

float

Gets the default text size for this cue's text.

int

Gets the default text size type for this cue's text.

int

Gets the vertical formatting for this Cue.

@ColorInt int

Gets the fill color of the window.

boolean

Returns true if the fill color of the window is set.

Cue.Builder

Sets the cue image.

Cue.Builder

Sets the bitmap height as a fraction of the viewport size.

Cue.Builder
@CanIgnoreReturnValue
setLine(float line, @Cue.LineType int lineType)

Sets the position of the cue box within the viewport in the direction orthogonal to the writing direction.

Cue.Builder

Sets the cue box anchor positioned by line.

Cue.Builder

Sets the multi-row alignment of the cue.

Cue.Builder

Sets the fractional position of the positionAnchor of the cue box within the viewport in the direction orthogonal to line.

Cue.Builder

Sets the cue box anchor positioned by position.

Cue.Builder

Sets the shear angle for this Cue.

Cue.Builder

Sets the size of the cue box in the writing direction specified as a fraction of the viewport size in that direction.

Cue.Builder

Sets the cue text.

Cue.Builder

Sets the alignment of the cue text within the cue box.

Cue.Builder
@CanIgnoreReturnValue
setTextSize(float textSize, @Cue.TextSizeType int textSizeType)

Sets the default text size and type for this cue's text.

Cue.Builder

Sets the vertical formatting for this Cue.

Cue.Builder

Sets the fill color of the window.

Public fields

bitmap

public @Nullable Bitmap bitmap

bitmapHeight

public float bitmapHeight

line

public float line

lineAnchor

@Cue.AnchorType
public int lineAnchor

lineType

@Cue.LineType
public int lineType

position

public float position

positionAnchor

@Cue.AnchorType
public int positionAnchor

size

public float size

text

public @Nullable CharSequence text

textAlignment

public @Nullable Layout.Alignment textAlignment

textSize

public float textSize

textSizeType

@Cue.TextSizeType
public int textSizeType

verticalType

@Cue.VerticalType
public int verticalType

windowColor

public @ColorInt int windowColor

Public constructors

Builder

public Builder()

Public methods

build

public Cue build()

Build the cue.

clearWindowColor

@CanIgnoreReturnValue
public Cue.Builder clearWindowColor()

Sets windowColorSet to false.

getBitmap

@Pure
public @Nullable Bitmap getBitmap()

Gets the cue image.

See also
bitmap

getBitmapHeight

@Pure
public float getBitmapHeight()

Gets the bitmap height as a fraction of the viewport size.

See also
bitmapHeight

getLine

@Pure
public float getLine()

Gets the position of the lineAnchor of the cue box within the viewport in the direction orthogonal to the writing direction.

See also
line

getLineAnchor

@Pure
@Cue.AnchorType
public int getLineAnchor()

Gets the cue box anchor positioned by line.

See also
lineAnchor

getLineType

@Pure
@Cue.LineType
public int getLineType()

Gets the type of the value of getLine.

See also
lineType

getPosition

@Pure
public float getPosition()

Gets the fractional position of the positionAnchor of the cue box within the viewport in the direction orthogonal to line.

See also
position

getPositionAnchor

@Pure
@Cue.AnchorType
public int getPositionAnchor()

Gets the cue box anchor positioned by position.

See also
positionAnchor

getSize

@Pure
public float getSize()

Gets the size of the cue box in the writing direction specified as a fraction of the viewport size in that direction.

See also
size

getText

@Pure
public @Nullable CharSequence getText()

Gets the cue text.

See also
text

getTextAlignment

@Pure
public @Nullable Layout.Alignment getTextAlignment()

Gets the alignment of the cue text within the cue box, or null if the alignment is undefined.

See also
textAlignment

getTextSize

@Pure
public float getTextSize()

Gets the default text size for this cue's text.

See also
textSize

getTextSizeType

@Pure
@Cue.TextSizeType
public int getTextSizeType()

Gets the default text size type for this cue's text.

See also
textSizeType

getVerticalType

@Pure
@Cue.VerticalType
public int getVerticalType()

Gets the vertical formatting for this Cue.

See also
verticalType

getWindowColor

@Pure
public @ColorInt int getWindowColor()

Gets the fill color of the window.

See also
windowColor

isWindowColorSet

public boolean isWindowColorSet()

Returns true if the fill color of the window is set.

See also
windowColorSet

setBitmap

@CanIgnoreReturnValue
public Cue.Builder setBitmap(Bitmap bitmap)

Sets the cue image.

See also
bitmap

setBitmapHeight

@CanIgnoreReturnValue
public Cue.Builder setBitmapHeight(float bitmapHeight)

Sets the bitmap height as a fraction of the viewport size.

See also
bitmapHeight

setLine

@CanIgnoreReturnValue
public Cue.Builder setLine(float line, @Cue.LineType int lineType)

Sets the position of the cue box within the viewport in the direction orthogonal to the writing direction.

See also
line
lineType

setLineAnchor

@CanIgnoreReturnValue
public Cue.Builder setLineAnchor(@Cue.AnchorType int lineAnchor)

Sets the cue box anchor positioned by line.

See also
lineAnchor

setMultiRowAlignment

@CanIgnoreReturnValue
public Cue.Builder setMultiRowAlignment(@Nullable Layout.Alignment multiRowAlignment)

Sets the multi-row alignment of the cue.

Passing null means the alignment is undefined.

setPosition

@CanIgnoreReturnValue
public Cue.Builder setPosition(float position)

Sets the fractional position of the positionAnchor of the cue box within the viewport in the direction orthogonal to line.

See also
position

setPositionAnchor

@CanIgnoreReturnValue
public Cue.Builder setPositionAnchor(@Cue.AnchorType int positionAnchor)

Sets the cue box anchor positioned by position.

See also
positionAnchor

setShearDegrees

@CanIgnoreReturnValue
public Cue.Builder setShearDegrees(float shearDegrees)

Sets the shear angle for this Cue.

setSize

@CanIgnoreReturnValue
public Cue.Builder setSize(float size)

Sets the size of the cue box in the writing direction specified as a fraction of the viewport size in that direction.

See also
size

setText

@CanIgnoreReturnValue
public Cue.Builder setText(CharSequence text)

Sets the cue text.

Note that text may be decorated with styling spans.

See also
text

setTextAlignment

@CanIgnoreReturnValue
public Cue.Builder setTextAlignment(@Nullable Layout.Alignment textAlignment)

Sets the alignment of the cue text within the cue box.

Passing null means the alignment is undefined.

See also
textAlignment

setTextSize

@CanIgnoreReturnValue
public Cue.Builder setTextSize(float textSize, @Cue.TextSizeType int textSizeType)

Sets the default text size and type for this cue's text.

setVerticalType

@CanIgnoreReturnValue
public Cue.Builder setVerticalType(@Cue.VerticalType int verticalType)

Sets the vertical formatting for this Cue.

See also
verticalType

setWindowColor

@CanIgnoreReturnValue
public Cue.Builder setWindowColor(@ColorInt int windowColor)

Sets the fill color of the window.

Also sets windowColorSet to true.