Interface TextTrackStyle
-
- All Implemented Interfaces:
public interface TextTrackStyleThe text track style API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumTextTrackStyle.EdgeTypeThe edge type values for the text track.
public enumTextTrackStyle.FontStyleThe font style values for the text track.
public enumTextTrackStyle.FontFamilyThe font family values for the text track.
-
Method Summary
Modifier and Type Method Description abstract voidsetFontColor(@ColorInt() int color)Sets text font color abstract intgetFontColor()Returns current font color abstract voidsetBackgroundColor(@ColorInt() int color)Sets background color abstract intgetBackgroundColor()Returns current background color abstract voidsetWindowColor(@ColorInt() int color)Sets background color abstract intgetWindowColor()Returns current window color abstract voidsetEdgeColor(@ColorInt() int color)Sets edge color abstract intgetEdgeColor()Returns current edge color abstract voidsetEdgeType(@NonNull() TextTrackStyle.EdgeType type)Sets edge type abstract TextTrackStyle.EdgeTypegetEdgeType()Returns current edge type abstract voidsetFont(@Nullable() TextTrackStyle.FontFamily fontFamily, @NonNull() TextTrackStyle.FontStyle fontStyle)Sets font family and font style from the FontFamily and FontStyle enums abstract voidsetFont(@NonNull() String fontFile, @NonNull() TextTrackStyle.FontStyle fontStyle)Sets font from the font file abstract TextTrackStyle.FontStylegetFontStyle()Returns current font style value from FontStyle enum abstract TextTrackStyle.FontFamilygetFontFamily()Returns current font family value from FontFamily enum abstract StringgetFontFile()Returns name of the fonts file abstract voidsetFontSize(int fontSize)Sets font size in range 50% - 300% of default font size abstract intgetFontSize()Returns current font size in range 50% - 300% of default font size abstract voidsetMarginLeft(int marginLeft)Sets text left margin in range 0% - 100% of subtitle view width abstract voidsetMarginTop(int marginTop)Sets text top margin in range 0% - 100% of subtitle view height abstract intgetMarginLeft()Returns left margin value in range: 0% - 100% from subtitle view width abstract intgetMarginTop()Returns top margin value in range: 0% - 100% from subtitle view height abstract voidreset()Sets default values of colors, sizes, layout, styles of subtitles (from the subtitle description metadata) -
-
Method Detail
-
setFontColor
abstract void setFontColor(@ColorInt() int color)
Sets text font color
- Parameters:
color- - font color @see Colors
-
getFontColor
@ColorInt() abstract int getFontColor()
Returns current font color
- Returns:
font color
-
setBackgroundColor
abstract void setBackgroundColor(@ColorInt() int color)
Sets background color
- Parameters:
color- - background color
-
getBackgroundColor
@ColorInt() abstract int getBackgroundColor()
Returns current background color
- Returns:
background color
-
setWindowColor
abstract void setWindowColor(@ColorInt() int color)
Sets background color
- Parameters:
color- - window color
-
getWindowColor
@ColorInt() abstract int getWindowColor()
Returns current window color
- Returns:
window color
-
setEdgeColor
abstract void setEdgeColor(@ColorInt() int color)
Sets edge color
- Parameters:
color- - edge color
-
getEdgeColor
@ColorInt() abstract int getEdgeColor()
Returns current edge color
- Returns:
edge color
-
setEdgeType
abstract void setEdgeType(@NonNull() TextTrackStyle.EdgeType type)
Sets edge type
- Parameters:
type- - edge type
-
getEdgeType
@NonNull() abstract TextTrackStyle.EdgeType getEdgeType()
Returns current edge type
- Returns:
edge type
-
setFont
abstract void setFont(@Nullable() TextTrackStyle.FontFamily fontFamily, @NonNull() TextTrackStyle.FontStyle fontStyle)
Sets font family and font style from the FontFamily and FontStyle enums
- Parameters:
fontFamily- - font family valuefontStyle- - font style value
-
setFont
abstract void setFont(@NonNull() String fontFile, @NonNull() TextTrackStyle.FontStyle fontStyle)
Sets font from the font file
- Parameters:
fontFile- - font file namefontStyle- - font style value
-
getFontStyle
@NonNull() abstract TextTrackStyle.FontStyle getFontStyle()
Returns current font style value from FontStyle enum
- Returns:
font style
-
getFontFamily
@Nullable() abstract TextTrackStyle.FontFamily getFontFamily()
Returns current font family value from FontFamily enum
- Returns:
font family
-
getFontFile
@Nullable() abstract String getFontFile()
Returns name of the fonts file
- Returns:
name of font file
-
setFontSize
abstract void setFontSize(int fontSize)
Sets font size in range 50% - 300% of default font size
- Parameters:
fontSize- - font size value in range: 50% - 300% of default font size
-
getFontSize
abstract int getFontSize()
Returns current font size in range 50% - 300% of default font size
- Returns:
font style
-
setMarginLeft
abstract void setMarginLeft(int marginLeft)
Sets text left margin in range 0% - 100% of subtitle view width
- Parameters:
marginLeft- - text left margin in range 0% - 100% of subtitle view width
-
setMarginTop
abstract void setMarginTop(int marginTop)
Sets text top margin in range 0% - 100% of subtitle view height
- Parameters:
marginTop- - text top margin in range 0% - 100% of subtitle view height
-
getMarginLeft
abstract int getMarginLeft()
Returns left margin value in range: 0% - 100% from subtitle view width
- Returns:
left margin value
-
getMarginTop
abstract int getMarginTop()
Returns top margin value in range: 0% - 100% from subtitle view height
- Returns:
top margin value
-
reset
abstract void reset()
Sets default values of colors, sizes, layout, styles of subtitles (from the subtitle description metadata)
-
-
-
-