A class that specifies how a text track's text will be displayed on-screen. The text is displayed inside a rectangular "window". The appearance of both the text and the window are configurable.
With the exception of the font scale, which has a predefined default value, any attribute that is not explicitly set will remain "unspecified", and the Cast Receiver will select an appropriate value.
Constant Summary
int | COLOR_UNSPECIFIED | A color value that indicates an unspecified (unset) color. |
float | DEFAULT_FONT_SCALE | The default font scale. |
int | EDGE_TYPE_DEPRESSED | An edge type indicating a depressed edge. |
int | EDGE_TYPE_DROP_SHADOW | An edge type indicating a drop shadow edge. |
int | EDGE_TYPE_NONE | An edge type indicating no edge. |
int | EDGE_TYPE_OUTLINE | An edge type indicating an outline edge. |
int | EDGE_TYPE_RAISED | An edge type indicating a raised edge. |
int | EDGE_TYPE_UNSPECIFIED | An edge type indicating an unspecified edge type. |
int | FONT_FAMILY_CASUAL | A font family indicating Casual. |
int | FONT_FAMILY_CURSIVE | A font family indicating Cursive. |
int | FONT_FAMILY_MONOSPACED_SANS_SERIF | A font family indicating Monospaced Sans Serif. |
int | FONT_FAMILY_MONOSPACED_SERIF | A font family indicating Monospaced Serif. |
int | FONT_FAMILY_SANS_SERIF | A font family indicating Sans Serif. |
int | FONT_FAMILY_SERIF | A font family indicating Serif. |
int | FONT_FAMILY_SMALL_CAPITALS | A font family indicating Small Capitals. |
int | FONT_FAMILY_UNSPECIFIED | A font family indicating an unspecified font family. |
int | FONT_STYLE_BOLD | A font style indicating a bold style. |
int | FONT_STYLE_BOLD_ITALIC | A font style indicating a bold and italic style. |
int | FONT_STYLE_ITALIC | A font style indicating an italic style. |
int | FONT_STYLE_NORMAL | A font style indicating a normal style. |
int | FONT_STYLE_UNSPECIFIED | A font style indicating an unspecified style. |
int | WINDOW_TYPE_NONE | A window type indicating no window type. |
int | WINDOW_TYPE_NORMAL | A window type indicating a normal window. |
int | WINDOW_TYPE_ROUNDED | A window type indicating a window with rounded corners. |
int | WINDOW_TYPE_UNSPECIFIED | A window type indicating an unspecified window type. |
Inherited Constant Summary
Public Constructor Summary
TextTrackStyle()
Constructs a new TextTrackStyle.
|
Public Method Summary
boolean | |
static TextTrackStyle |
fromSystemSettings(Context
context)
Constructs a new TextTrackStyle based on the system's current closed caption
style settings.
|
int |
getBackgroundColor()
Gets the text's background color.
|
JSONObject |
getCustomData()
Gets the custom data object.
|
int |
getEdgeColor()
Gets the window's edge color.
|
int |
getEdgeType()
Gets the caption window's edge type.
|
String |
getFontFamily()
Gets the text's font family.
|
int |
getFontGenericFamily()
Gets the text's generic font family.
|
float |
getFontScale()
Gets the font scale factor.
|
int |
getFontStyle()
Gets the text font style.
|
int |
getForegroundColor()
Gets the text's foreground color.
|
int |
getWindowColor()
Gets the window's color.
|
int |
getWindowCornerRadius()
Gets the window corner radius.
|
int |
getWindowType()
Gets the caption window type.
|
int |
hashCode()
|
void |
setBackgroundColor(int backgroundColor)
Sets the text's background color.
|
void | |
void |
setEdgeColor(int edgeColor)
Sets the window's edge color.
|
void |
setEdgeType(int edgeType)
Sets the caption window's edge type.
|
void | |
void |
setFontGenericFamily(int fontGenericFamily)
Sets the text's generic font family.
|
void |
setFontScale(float fontScale)
Sets the font scale factor.
|
void |
setFontStyle(int fontStyle)
Sets the text font style.
|
void |
setForegroundColor(int foregroundColor)
Sets the text's foreground color.
|
void |
setWindowColor(int windowColor)
Sets the window's color.
|
void |
setWindowCornerRadius(int windowCornerRadius)
If the window type is
WINDOW_TYPE_ROUNDED , sets the radius for the window's corners.
|
void |
setWindowType(int windowType)
Sets the window type.
|
void |
writeToParcel(Parcel out, int
flags)
|
Inherited Method Summary
Constants
public static final int COLOR_UNSPECIFIED
A color value that indicates an unspecified (unset) color.
public static final float DEFAULT_FONT_SCALE
The default font scale.
public static final int EDGE_TYPE_DEPRESSED
An edge type indicating a depressed edge.
public static final int EDGE_TYPE_DROP_SHADOW
An edge type indicating a drop shadow edge.
public static final int EDGE_TYPE_NONE
An edge type indicating no edge.
public static final int EDGE_TYPE_OUTLINE
An edge type indicating an outline edge.
public static final int EDGE_TYPE_RAISED
An edge type indicating a raised edge.
public static final int EDGE_TYPE_UNSPECIFIED
An edge type indicating an unspecified edge type.
public static final int FONT_FAMILY_CASUAL
A font family indicating Casual.
public static final int FONT_FAMILY_CURSIVE
A font family indicating Cursive.
public static final int FONT_FAMILY_MONOSPACED_SANS_SERIF
A font family indicating Monospaced Sans Serif.
public static final int FONT_FAMILY_MONOSPACED_SERIF
A font family indicating Monospaced Serif.
public static final int FONT_FAMILY_SANS_SERIF
A font family indicating Sans Serif.
public static final int FONT_FAMILY_SERIF
A font family indicating Serif.
public static final int FONT_FAMILY_SMALL_CAPITALS
A font family indicating Small Capitals.
public static final int FONT_FAMILY_UNSPECIFIED
A font family indicating an unspecified font family.
public static final int FONT_STYLE_BOLD
A font style indicating a bold style.
public static final int FONT_STYLE_BOLD_ITALIC
A font style indicating a bold and italic style.
public static final int FONT_STYLE_ITALIC
A font style indicating an italic style.
public static final int FONT_STYLE_NORMAL
A font style indicating a normal style.
public static final int FONT_STYLE_UNSPECIFIED
A font style indicating an unspecified style.
public static final int WINDOW_TYPE_NONE
A window type indicating no window type.
public static final int WINDOW_TYPE_NORMAL
A window type indicating a normal window.
public static final int WINDOW_TYPE_ROUNDED
A window type indicating a window with rounded corners.
public static final int WINDOW_TYPE_UNSPECIFIED
A window type indicating an unspecified window type.
Public Constructors
public TextTrackStyle ()
Constructs a new TextTrackStyle.
Public Methods
public boolean equals (Object other)
public static TextTrackStyle fromSystemSettings (Context context)
Constructs a new TextTrackStyle based on the system's current closed caption style settings. On platform levels below 19, this returns an object with "unspecified" values for all fields.
Parameters
context | The calling context. |
---|
Returns
- The new TextTrackStyle.
public int getBackgroundColor ()
Gets the text's background color.
public JSONObject getCustomData ()
Gets the custom data object.
public int getEdgeColor ()
Gets the window's edge color.
public int getEdgeType ()
Gets the caption window's edge type.
public String getFontFamily ()
Gets the text's font family.
public int getFontGenericFamily ()
Gets the text's generic font family.
public float getFontScale ()
Gets the font scale factor.
public int getFontStyle ()
Gets the text font style.
public int getForegroundColor ()
Gets the text's foreground color.
public int getWindowColor ()
Gets the window's color.
public int getWindowCornerRadius ()
Gets the window corner radius.
public int getWindowType ()
Gets the caption window type.
public int hashCode ()
public void setBackgroundColor (int backgroundColor)
Sets the text's background color.
Parameters
backgroundColor | The color, as an ARGB value. |
---|
public void setCustomData (JSONObject customData)
Sets the custom data object.
public void setEdgeColor (int edgeColor)
Sets the window's edge color.
Parameters
edgeColor | The color, as an ARGB value. |
---|
public void setEdgeType (int edgeType)
Sets the caption window's edge type.
Parameters
edgeType | The edge type; one of the EDGE_TYPE_ constants defined above. |
---|
public void setFontFamily (String fontFamily)
Sets the text's font family.
Parameters
fontFamily | The text font family. |
---|
public void setFontGenericFamily (int fontGenericFamily)
Sets the text's generic font family. This will be used if the font family specified
with
setFontFamily(String)
(if any) is unavailable.
Parameters
fontGenericFamily | The generic family; one of the FONT_FAMILY_ constants defined
above. |
---|
public void setFontScale (float fontScale)
Sets the font scale factor. The default is
DEFAULT_FONT_SCALE
.
public void setFontStyle (int fontStyle)
Sets the text font style.
Parameters
fontStyle | The font style; one of the FONT_STYLE_ constants defined
above. |
---|
public void setForegroundColor (int foregroundColor)
Sets the text's foreground color.
Parameters
foregroundColor | The color, as an ARGB value. |
---|
public void setWindowColor (int windowColor)
Sets the window's color.
Parameters
windowColor | The color, as an ARGB value. |
---|
public void setWindowCornerRadius (int windowCornerRadius)
If the window type is
WINDOW_TYPE_ROUNDED
, sets the radius for the window's corners.
Parameters
windowCornerRadius | The radius, in pixels. Must be a positive value. |
---|
public void setWindowType (int windowType)
Sets the window type.
Parameters
windowType | The window type; one of the WINDOW_TYPE_ constants defined
above. |
---|