public final class

Cue.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.media3.common.text.Cue.Builder

Overview

A builder for Cue objects.

Summary

Constructors
publicBuilder()

Methods
public Cuebuild()

Build the cue.

public Cue.BuilderclearWindowColor()

Sets Cue.windowColorSet to false.

public BitmapgetBitmap()

Gets the cue image.

public floatgetBitmapHeight()

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

public floatgetLine()

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

public intgetLineAnchor()

Gets the cue box anchor positioned by line.

public intgetLineType()

Gets the type of the value of Cue.Builder.getLine().

public floatgetPosition()

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

public intgetPositionAnchor()

Gets the cue box anchor positioned by position.

public floatgetSize()

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

public java.lang.CharSequencegetText()

Gets the cue text.

public AlignmentgetTextAlignment()

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

public floatgetTextSize()

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

public intgetTextSizeType()

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

public intgetVerticalType()

Gets the vertical formatting for this Cue.

public intgetWindowColor()

Gets the fill color of the window.

public booleanisWindowColorSet()

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

public Cue.BuildersetBitmap(Bitmap bitmap)

Sets the cue image.

public Cue.BuildersetBitmapHeight(float bitmapHeight)

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

public Cue.BuildersetLine(float line, int lineType)

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

public Cue.BuildersetLineAnchor(int lineAnchor)

Sets the cue box anchor positioned by line.

public Cue.BuildersetMultiRowAlignment(Layout.Alignment multiRowAlignment)

Sets the multi-row alignment of the cue.

public Cue.BuildersetPosition(float position)

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

public Cue.BuildersetPositionAnchor(int positionAnchor)

Sets the cue box anchor positioned by position.

public Cue.BuildersetShearDegrees(float shearDegrees)

Sets the shear angle for this Cue.

public Cue.BuildersetSize(float size)

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

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

Sets the cue text.

public Cue.BuildersetTextAlignment(Layout.Alignment textAlignment)

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

public Cue.BuildersetTextSize(float textSize, int textSizeType)

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

public Cue.BuildersetVerticalType(int verticalType)

Sets the vertical formatting for this Cue.

public Cue.BuildersetWindowColor(int windowColor)

Sets the fill color of the window.

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

Constructors

public Builder()

Methods

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

Sets the cue text.

Note that text may be decorated with styling spans.

See also: Cue.text

public java.lang.CharSequence getText()

Gets the cue text.

See also: Cue.text

public Cue.Builder setBitmap(Bitmap bitmap)

Sets the cue image.

See also: Cue.bitmap

public Bitmap getBitmap()

Gets the cue image.

See also: Cue.bitmap

public Cue.Builder setTextAlignment(Layout.Alignment textAlignment)

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

Passing null means the alignment is undefined.

See also: Cue.textAlignment

public Alignment getTextAlignment()

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

See also: Cue.textAlignment

public Cue.Builder setMultiRowAlignment(Layout.Alignment multiRowAlignment)

Sets the multi-row alignment of the cue.

Passing null means the alignment is undefined.

See also: Cue.multiRowAlignment

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

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

See also: Cue.line, Cue.lineType

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: Cue.line

public int getLineType()

Gets the type of the value of Cue.Builder.getLine().

See also: Cue.lineType

public Cue.Builder setLineAnchor(int lineAnchor)

Sets the cue box anchor positioned by line.

See also: Cue.lineAnchor

public int getLineAnchor()

Gets the cue box anchor positioned by line.

See also: Cue.lineAnchor

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: Cue.position

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: Cue.position

public Cue.Builder setPositionAnchor(int positionAnchor)

Sets the cue box anchor positioned by position.

See also: Cue.positionAnchor

public int getPositionAnchor()

Gets the cue box anchor positioned by position.

See also: Cue.positionAnchor

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

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

See also: Cue.textSize, Cue.textSizeType

public int getTextSizeType()

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

See also: Cue.textSizeType

public float getTextSize()

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

See also: Cue.textSize

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: Cue.size

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: Cue.size

public Cue.Builder setBitmapHeight(float bitmapHeight)

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

See also: Cue.bitmapHeight

public float getBitmapHeight()

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

See also: Cue.bitmapHeight

public Cue.Builder setWindowColor(int windowColor)

Sets the fill color of the window.

Also sets Cue.windowColorSet to true.

See also: Cue.windowColor, Cue.windowColorSet

public Cue.Builder clearWindowColor()

Sets Cue.windowColorSet to false.

public boolean isWindowColorSet()

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

See also: Cue.windowColorSet

public int getWindowColor()

Gets the fill color of the window.

See also: Cue.windowColor

public Cue.Builder setVerticalType(int verticalType)

Sets the vertical formatting for this Cue.

See also: Cue.verticalType

public Cue.Builder setShearDegrees(float shearDegrees)

Sets the shear angle for this Cue.

public int getVerticalType()

Gets the vertical formatting for this Cue.

See also: Cue.verticalType

public Cue build()

Build the cue.