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 the text font color. abstract intgetFontColor()Returns the current text font color. abstract voidsetBackgroundColor(@ColorInt() int color)Sets the background color. abstract intgetBackgroundColor()Returns the current background color. abstract voidsetWindowColor(@ColorInt() int color)Sets the window color. abstract intgetWindowColor()Returns the current window color. abstract voidsetEdgeColor(@ColorInt() int color)Sets the edge color. abstract intgetEdgeColor()Returns the current edge color. abstract voidsetEdgeType(@NonNull() TextTrackStyle.EdgeType type)Sets the edge type. abstract TextTrackStyle.EdgeTypegetEdgeType()Returns the current edge type. abstract voidsetFont(@Nullable() Typeface font)Sets the font. abstract voidsetFont(@Nullable() TextTrackStyle.FontFamily fontFamily, @NonNull() TextTrackStyle.FontStyle fontStyle)Sets the font family and font style. abstract voidsetFont(@NonNull() String fontFile, @NonNull() TextTrackStyle.FontStyle fontStyle)Sets the font from the font file. abstract TypefacegetFont()Returns the current font. abstract TextTrackStyle.FontStylegetFontStyle()Returns the current font style value. abstract TextTrackStyle.FontFamilygetFontFamily()Returns the current font family value. abstract StringgetFontFile()Returns the file name of the current font. abstract voidsetFontSize(@IntRange(from = 50, to = 300) int fontSize)Sets the font size, as a percentage of the default font size. abstract intgetFontSize()Returns the current font size, as a percentage of the default font size. abstract voidsetMarginLeft(@IntRange(from = 0, to = 100) int marginLeft)Sets the left margin of the subtitle drawing box, as a percentage of the player's width. abstract voidsetMarginRight(@IntRange(from = 0, to = 100) int marginRight)Sets the right margin of the subtitle drawing box, as a percentage of the player's width. abstract voidsetMarginTop(@IntRange(from = 0, to = 100) int marginTop)Sets the top margin of the subtitle drawing box, as a percentage of the player's height. abstract voidsetMarginBottom(@IntRange(from = 0, to = 100) int marginBottom)Sets the bottom margin of the subtitle drawing box, as a percentage of the player's height. abstract intgetMarginLeft()Returns the left margin of the subtitle drawing box, as a percentage of the player's width. abstract intgetMarginRight()Returns the right margin of the subtitle drawing box, as a percentage of the player's width. abstract intgetMarginTop()Returns the top margin of the subtitle drawing box, as a percentage of the player's height. abstract intgetMarginBottom()Returns the bottom margin of the subtitle drawing box, as a percentage of the player's height. abstract voidreset()Resets all properties to their default values. -
-
Method Detail
-
setFontColor
abstract void setFontColor(@ColorInt() int color)
Sets the text font color.
- Parameters:
color- - font color
-
getFontColor
@ColorInt() abstract int getFontColor()
Returns the current text font color.
- Returns:
font color
-
setBackgroundColor
abstract void setBackgroundColor(@ColorInt() int color)
Sets the background color.
- Parameters:
color- - background color
-
getBackgroundColor
@ColorInt() abstract int getBackgroundColor()
Returns the current background color.
- Returns:
background color
-
setWindowColor
abstract void setWindowColor(@ColorInt() int color)
Sets the window color.
- Parameters:
color- - window color
-
getWindowColor
@ColorInt() abstract int getWindowColor()
Returns the current window color.
- Returns:
window color
-
setEdgeColor
abstract void setEdgeColor(@ColorInt() int color)
Sets the edge color.
- Parameters:
color- - edge color
-
getEdgeColor
@ColorInt() abstract int getEdgeColor()
Returns the current edge color.
- Returns:
edge color
-
setEdgeType
abstract void setEdgeType(@NonNull() TextTrackStyle.EdgeType type)
Sets the edge type.
- Parameters:
type- - edge type
-
getEdgeType
@NonNull() abstract TextTrackStyle.EdgeType getEdgeType()
Returns the current edge type.
- Returns:
edge type
-
setFont
abstract void setFont(@Nullable() TextTrackStyle.FontFamily fontFamily, @NonNull() TextTrackStyle.FontStyle fontStyle)
Sets the font family and font style.
This is equivalent to calling setFont with the result of create.
- Parameters:
fontFamily- - font family valuefontStyle- - font style value
-
setFont
abstract void setFont(@NonNull() String fontFile, @NonNull() TextTrackStyle.FontStyle fontStyle)
Sets the font from the font file.
This is equivalent to calling setFont with the result of createFromFile.
- Parameters:
fontFile- - font file namefontStyle- - font style value
-
getFontStyle
@NonNull() abstract TextTrackStyle.FontStyle getFontStyle()
Returns the current font style value.
- Returns:
font style
-
getFontFamily
@Nullable() abstract TextTrackStyle.FontFamily getFontFamily()
Returns the current font family value.
- Returns:
font family
-
getFontFile
@Nullable() abstract String getFontFile()
Returns the file name of the current font.
- Returns:
file name of font
-
setFontSize
abstract void setFontSize(@IntRange(from = 50, to = 300) int fontSize)
Sets the font size, as a percentage of the default font size.
- Parameters:
fontSize- - font size, as a percentage between 50% - 300% of the default font size
-
getFontSize
abstract int getFontSize()
Returns the current font size, as a percentage of the default font size.
- Returns:
font size
-
setMarginLeft
abstract void setMarginLeft(@IntRange(from = 0, to = 100) int marginLeft)
Sets the left margin of the subtitle drawing box, as a percentage of the player's width.
- Parameters:
marginLeft- - left margin, as a percentage between 0% - 100% of the player's width
-
setMarginRight
abstract void setMarginRight(@IntRange(from = 0, to = 100) int marginRight)
Sets the right margin of the subtitle drawing box, as a percentage of the player's width.
- Parameters:
marginRight- - right margin, as a percentage between 0% - 100% of the player's width
-
setMarginTop
abstract void setMarginTop(@IntRange(from = 0, to = 100) int marginTop)
Sets the top margin of the subtitle drawing box, as a percentage of the player's height.
- Parameters:
marginTop- - top margin, as a percentage between 0% - 100% of the player's height
-
setMarginBottom
abstract void setMarginBottom(@IntRange(from = 0, to = 100) int marginBottom)
Sets the bottom margin of the subtitle drawing box, as a percentage of the player's height.
- Parameters:
marginBottom- - bottom margin, as a percentage between 0% - 100% of the player's height
-
getMarginLeft
@IntRange(from = 0, to = 100) abstract int getMarginLeft()
Returns the left margin of the subtitle drawing box, as a percentage of the player's width.
- Returns:
left margin
-
getMarginRight
@IntRange(from = 0, to = 100) abstract int getMarginRight()
Returns the right margin of the subtitle drawing box, as a percentage of the player's width.
- Returns:
right margin
-
getMarginTop
@IntRange(from = 0, to = 100) abstract int getMarginTop()
Returns the top margin of the subtitle drawing box, as a percentage of the player's height.
- Returns:
top margin
-
getMarginBottom
@IntRange(from = 0, to = 100) abstract int getMarginBottom()
Returns the bottom margin of the subtitle drawing box, as a percentage of the player's height.
- Returns:
bottom margin
-
reset
abstract void reset()
Resets all properties to their default values.
-
-
-
-