public final class

TextTrackStyle

extends Object
implements Parcelable
java.lang.Object
   ↳ com.google.android.gms.cast.TextTrackStyle

Class Overview

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.

Summary

Constants
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.
[Expand]
Inherited Constants
From interface android.os.Parcelable
Public Constructors
TextTrackStyle()
Constructs a new TextTrackStyle.
Public Methods
boolean equals(Object other)
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 setCustomData(JSONObject customData)
Sets the custom data object.
void setEdgeColor(int edgeColor)
Sets the window's edge color.
void setEdgeType(int edgeType)
Sets the caption window's edge type.
void setFontFamily(String fontFamily)
Sets the text's font family.
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)
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Constants

public static final int COLOR_UNSPECIFIED

A color value that indicates an unspecified (unset) color.

Constant Value: 0 (0x00000000)

public static final float DEFAULT_FONT_SCALE

The default font scale.

Constant Value: 1.0

public static final int EDGE_TYPE_DEPRESSED

An edge type indicating a depressed edge.

Constant Value: 4 (0x00000004)

public static final int EDGE_TYPE_DROP_SHADOW

An edge type indicating a drop shadow edge.

Constant Value: 2 (0x00000002)

public static final int EDGE_TYPE_NONE

An edge type indicating no edge.

Constant Value: 0 (0x00000000)

public static final int EDGE_TYPE_OUTLINE

An edge type indicating an outline edge.

Constant Value: 1 (0x00000001)

public static final int EDGE_TYPE_RAISED

An edge type indicating a raised edge.

Constant Value: 3 (0x00000003)

public static final int EDGE_TYPE_UNSPECIFIED

An edge type indicating an unspecified edge type.

Constant Value: -1 (0xffffffff)

public static final int FONT_FAMILY_CASUAL

A font family indicating Casual.

Constant Value: 4 (0x00000004)

public static final int FONT_FAMILY_CURSIVE

A font family indicating Cursive.

Constant Value: 5 (0x00000005)

public static final int FONT_FAMILY_MONOSPACED_SANS_SERIF

A font family indicating Monospaced Sans Serif.

Constant Value: 1 (0x00000001)

public static final int FONT_FAMILY_MONOSPACED_SERIF

A font family indicating Monospaced Serif.

Constant Value: 3 (0x00000003)

public static final int FONT_FAMILY_SANS_SERIF

A font family indicating Sans Serif.

Constant Value: 0 (0x00000000)

public static final int FONT_FAMILY_SERIF

A font family indicating Serif.

Constant Value: 2 (0x00000002)

public static final int FONT_FAMILY_SMALL_CAPITALS

A font family indicating Small Capitals.

Constant Value: 6 (0x00000006)

public static final int FONT_FAMILY_UNSPECIFIED

A font family indicating an unspecified font family.

Constant Value: -1 (0xffffffff)

public static final int FONT_STYLE_BOLD

A font style indicating a bold style.

Constant Value: 1 (0x00000001)

public static final int FONT_STYLE_BOLD_ITALIC

A font style indicating a bold and italic style.

Constant Value: 3 (0x00000003)

public static final int FONT_STYLE_ITALIC

A font style indicating an italic style.

Constant Value: 2 (0x00000002)

public static final int FONT_STYLE_NORMAL

A font style indicating a normal style.

Constant Value: 0 (0x00000000)

public static final int FONT_STYLE_UNSPECIFIED

A font style indicating an unspecified style.

Constant Value: -1 (0xffffffff)

public static final int WINDOW_TYPE_NONE

A window type indicating no window type.

Constant Value: 0 (0x00000000)

public static final int WINDOW_TYPE_NORMAL

A window type indicating a normal window.

Constant Value: 1 (0x00000001)

public static final int WINDOW_TYPE_ROUNDED

A window type indicating a window with rounded corners.

Constant Value: 2 (0x00000002)

public static final int WINDOW_TYPE_UNSPECIFIED

A window type indicating an unspecified window type.

Constant Value: -1 (0xffffffff)

Public Constructors

public TextTrackStyle ()

Constructs a new TextTrackStyle.

Public Methods

public boolean equals (Object other)

Parameters
other Object
Returns
boolean

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 Context: The calling context.
Returns
TextTrackStyle The new TextTrackStyle.

public int getBackgroundColor ()

Gets the text's background color.

Returns
int

public JSONObject getCustomData ()

Gets the custom data object.

Returns
JSONObject

public int getEdgeColor ()

Gets the window's edge color.

Returns
int

public int getEdgeType ()

Gets the caption window's edge type.

Returns
int

public String getFontFamily ()

Gets the text's font family.

Returns
String

public int getFontGenericFamily ()

Gets the text's generic font family.

Returns
int

public float getFontScale ()

Gets the font scale factor.

Returns
float

public int getFontStyle ()

Gets the text font style.

Returns
int

public int getForegroundColor ()

Gets the text's foreground color.

Returns
int

public int getWindowColor ()

Gets the window's color.

Returns
int

public int getWindowCornerRadius ()

Gets the window corner radius.

Returns
int

public int getWindowType ()

Gets the caption window type.

Returns
int

public int hashCode ()

Returns
int

public void setBackgroundColor (int backgroundColor)

Sets the text's background color.

Parameters
backgroundColor int: The color, as an ARGB value.

public void setCustomData (JSONObject customData)

Sets the custom data object.

Parameters
customData JSONObject

public void setEdgeColor (int edgeColor)

Sets the window's edge color.

Parameters
edgeColor int: The color, as an ARGB value.

public void setEdgeType (int edgeType)

Sets the caption window's edge type.

Parameters
edgeType int: The edge type; one of the EDGE_TYPE_ constants defined above.

public void setFontFamily (String fontFamily)

Sets the text's font family.

Parameters
fontFamily String: 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 int: 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.

Parameters
fontScale float

public void setFontStyle (int fontStyle)

Sets the text font style.

Parameters
fontStyle int: The font style; one of the FONT_STYLE_ constants defined above.

public void setForegroundColor (int foregroundColor)

Sets the text's foreground color.

Parameters
foregroundColor int: The color, as an ARGB value.

public void setWindowColor (int windowColor)

Sets the window's color.

Parameters
windowColor int: 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 int: The radius, in pixels. Must be a positive value.

public void setWindowType (int windowType)

Sets the window type.

Parameters
windowType int: The window type; one of the WINDOW_TYPE_ constants defined above.

public void writeToParcel (Parcel out, int flags)

Parameters
out Parcel
flags int