Class Cue.Builder
- java.lang.Object
-
- com.google.android.exoplayer2.text.Cue.Builder
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Cuebuild()Build the cue.Cue.BuilderclearWindowColor()SetsCue.windowColorSetto false.BitmapgetBitmap()Gets the cue image.floatgetBitmapHeight()Gets the bitmap height as a fraction of the viewport size.floatgetLine()Gets the position of thelineAnchorof the cue box within the viewport in the direction orthogonal to the writing direction.@com.google.android.exoplayer2.text.Cue.AnchorType intgetLineAnchor()Gets the cue box anchor positioned byline.@com.google.android.exoplayer2.text.Cue.LineType intgetLineType()Gets the type of the value ofgetLine().floatgetPosition()Gets the fractional position of thepositionAnchorof the cue box within the viewport in the direction orthogonal toline.@com.google.android.exoplayer2.text.Cue.AnchorType intgetPositionAnchor()Gets the cue box anchor positioned byposition.floatgetSize()Gets the size of the cue box in the writing direction specified as a fraction of the viewport size in that direction.CharSequencegetText()Gets the cue text.Layout.AlignmentgetTextAlignment()Gets the alignment of the cue text within the cue box, or null if the alignment is undefined.floatgetTextSize()Gets the default text size for this cue's text.@com.google.android.exoplayer2.text.Cue.TextSizeType intgetTextSizeType()Gets the default text size type for this cue's text.@com.google.android.exoplayer2.text.Cue.VerticalType intgetVerticalType()Gets the vertical formatting for this Cue.intgetWindowColor()Gets the fill color of the window.booleanisWindowColorSet()Returns true if the fill color of the window is set.Cue.BuildersetBitmap(Bitmap bitmap)Sets the cue image.Cue.BuildersetBitmapHeight(float bitmapHeight)Sets the bitmap height as a fraction of the viewport size.Cue.BuildersetLine(float line, @com.google.android.exoplayer2.text.Cue.LineType int lineType)Sets the position of the cue box within the viewport in the direction orthogonal to the writing direction.Cue.BuildersetLineAnchor(@com.google.android.exoplayer2.text.Cue.AnchorType int lineAnchor)Sets the cue box anchor positioned byline.Cue.BuildersetMultiRowAlignment(Layout.Alignment multiRowAlignment)Sets the multi-row alignment of the cue.Cue.BuildersetPosition(float position)Sets the fractional position of thepositionAnchorof the cue box within the viewport in the direction orthogonal toline.Cue.BuildersetPositionAnchor(@com.google.android.exoplayer2.text.Cue.AnchorType int positionAnchor)Sets the cue box anchor positioned byposition.Cue.BuildersetShearDegrees(float shearDegrees)Sets the shear angle for this Cue.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.Cue.BuildersetText(CharSequence text)Sets the cue text.Cue.BuildersetTextAlignment(Layout.Alignment textAlignment)Sets the alignment of the cue text within the cue box.Cue.BuildersetTextSize(float textSize, @com.google.android.exoplayer2.text.Cue.TextSizeType int textSizeType)Sets the default text size and type for this cue's text.Cue.BuildersetVerticalType(@com.google.android.exoplayer2.text.Cue.VerticalType int verticalType)Sets the vertical formatting for this Cue.Cue.BuildersetWindowColor(int windowColor)Sets the fill color of the window.
-
-
-
Method Detail
-
setText
@CanIgnoreReturnValue public Cue.Builder setText(CharSequence text)
Sets the cue text.Note that
textmay be decorated with styling spans.- See Also:
Cue.text
-
getText
@Pure @Nullable public CharSequence getText()
Gets the cue text.- See Also:
Cue.text
-
setBitmap
@CanIgnoreReturnValue public Cue.Builder setBitmap(Bitmap bitmap)
Sets the cue image.- See Also:
Cue.bitmap
-
getBitmap
@Pure @Nullable public Bitmap getBitmap()
Gets the cue image.- See Also:
Cue.bitmap
-
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:
Cue.textAlignment
-
getTextAlignment
@Pure @Nullable public Layout.Alignment getTextAlignment()
Gets the alignment of the cue text within the cue box, or null if the alignment is undefined.- See Also:
Cue.textAlignment
-
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.
- See Also:
Cue.multiRowAlignment
-
setLine
@CanIgnoreReturnValue public Cue.Builder setLine(float line, @LineType @com.google.android.exoplayer2.text.Cue.LineType 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
-
getLine
@Pure public float getLine()
Gets the position of thelineAnchorof the cue box within the viewport in the direction orthogonal to the writing direction.- See Also:
Cue.line
-
getLineType
@Pure @LineType public @com.google.android.exoplayer2.text.Cue.LineType int getLineType()
Gets the type of the value ofgetLine().- See Also:
Cue.lineType
-
setLineAnchor
@CanIgnoreReturnValue public Cue.Builder setLineAnchor(@AnchorType @com.google.android.exoplayer2.text.Cue.AnchorType int lineAnchor)
Sets the cue box anchor positioned byline.- See Also:
Cue.lineAnchor
-
getLineAnchor
@Pure @AnchorType public @com.google.android.exoplayer2.text.Cue.AnchorType int getLineAnchor()
Gets the cue box anchor positioned byline.- See Also:
Cue.lineAnchor
-
setPosition
@CanIgnoreReturnValue public Cue.Builder setPosition(float position)
Sets the fractional position of thepositionAnchorof the cue box within the viewport in the direction orthogonal toline.- See Also:
Cue.position
-
getPosition
@Pure public float getPosition()
Gets the fractional position of thepositionAnchorof the cue box within the viewport in the direction orthogonal toline.- See Also:
Cue.position
-
setPositionAnchor
@CanIgnoreReturnValue public Cue.Builder setPositionAnchor(@AnchorType @com.google.android.exoplayer2.text.Cue.AnchorType int positionAnchor)
Sets the cue box anchor positioned byposition.- See Also:
Cue.positionAnchor
-
getPositionAnchor
@Pure @AnchorType public @com.google.android.exoplayer2.text.Cue.AnchorType int getPositionAnchor()
Gets the cue box anchor positioned byposition.- See Also:
Cue.positionAnchor
-
setTextSize
@CanIgnoreReturnValue public Cue.Builder setTextSize(float textSize, @TextSizeType @com.google.android.exoplayer2.text.Cue.TextSizeType int textSizeType)
Sets the default text size and type for this cue's text.- See Also:
Cue.textSize,Cue.textSizeType
-
getTextSizeType
@Pure @TextSizeType public @com.google.android.exoplayer2.text.Cue.TextSizeType int getTextSizeType()
Gets the default text size type for this cue's text.- See Also:
Cue.textSizeType
-
getTextSize
@Pure public float getTextSize()
Gets the default text size for this cue's text.- See Also:
Cue.textSize
-
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:
Cue.size
-
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:
Cue.size
-
setBitmapHeight
@CanIgnoreReturnValue public Cue.Builder setBitmapHeight(float bitmapHeight)
Sets the bitmap height as a fraction of the viewport size.- See Also:
Cue.bitmapHeight
-
getBitmapHeight
@Pure public float getBitmapHeight()
Gets the bitmap height as a fraction of the viewport size.- See Also:
Cue.bitmapHeight
-
setWindowColor
@CanIgnoreReturnValue public Cue.Builder setWindowColor(@ColorInt int windowColor)
Sets the fill color of the window.Also sets
Cue.windowColorSetto true.- See Also:
Cue.windowColor,Cue.windowColorSet
-
clearWindowColor
@CanIgnoreReturnValue public Cue.Builder clearWindowColor()
SetsCue.windowColorSetto false.
-
isWindowColorSet
public boolean isWindowColorSet()
Returns true if the fill color of the window is set.- See Also:
Cue.windowColorSet
-
getWindowColor
@Pure @ColorInt public int getWindowColor()
Gets the fill color of the window.- See Also:
Cue.windowColor
-
setVerticalType
@CanIgnoreReturnValue public Cue.Builder setVerticalType(@VerticalType @com.google.android.exoplayer2.text.Cue.VerticalType int verticalType)
Sets the vertical formatting for this Cue.- See Also:
Cue.verticalType
-
setShearDegrees
@CanIgnoreReturnValue public Cue.Builder setShearDegrees(float shearDegrees)
Sets the shear angle for this Cue.
-
getVerticalType
@Pure @VerticalType public @com.google.android.exoplayer2.text.Cue.VerticalType int getVerticalType()
Gets the vertical formatting for this Cue.- See Also:
Cue.verticalType
-
build
public Cue build()
Build the cue.
-
-