SubtitleStyle


@UnstableApi
public final class SubtitleStyle


Styling for subtitles that isn't carried by the media, such as user or app preferences.

An instance can be created from the user's system caption style using fromCaptionStyle with getUserStyle, or constructed directly with Builder.

Summary

Nested types

public final class SubtitleStyle.Builder

A builder for SubtitleStyle instances.

The type of edge, which may be none.

Constants

static final SubtitleStyle

A SubtitleStyle with the default values specified by Builder.

static final int

Edge type value specifying depressed bevel character edges.

static final int

Edge type value specifying drop-shadowed character edges.

static final int

Edge type value specifying no character edges.

static final int

Edge type value specifying uniformly outlined character edges.

static final int

Edge type value specifying raised bevel character edges.

Public fields

final @ColorInt int

The preferred background color.

final @ColorInt int

The preferred edge color, if using an edge type other than EDGE_TYPE_NONE.

final int

The preferred edge type.

final @ColorInt int

The preferred foreground color.

final @Nullable Typeface

The preferred typeface, or null if unspecified.

final @ColorInt int

The preferred window color.

Public methods

SubtitleStyle.Builder

Returns a Builder initialized with the values of this instance.

boolean
static SubtitleStyle

Creates a SubtitleStyle from a provided CaptionStyle.

int

Constants

DEFAULT

public static final SubtitleStyle DEFAULT

A SubtitleStyle with the default values specified by Builder.

EDGE_TYPE_DEPRESSED

public static final int EDGE_TYPE_DEPRESSED = 4

Edge type value specifying depressed bevel character edges.

EDGE_TYPE_DROP_SHADOW

public static final int EDGE_TYPE_DROP_SHADOW = 2

Edge type value specifying drop-shadowed character edges.

EDGE_TYPE_NONE

public static final int EDGE_TYPE_NONE = 0

Edge type value specifying no character edges.

EDGE_TYPE_OUTLINE

public static final int EDGE_TYPE_OUTLINE = 1

Edge type value specifying uniformly outlined character edges.

EDGE_TYPE_RAISED

public static final int EDGE_TYPE_RAISED = 3

Edge type value specifying raised bevel character edges.

Public fields

backgroundColor

public final @ColorInt int backgroundColor

The preferred background color.

edgeColor

public final @ColorInt int edgeColor

The preferred edge color, if using an edge type other than EDGE_TYPE_NONE.

foregroundColor

public final @ColorInt int foregroundColor

The preferred foreground color.

typeface

public final @Nullable Typeface typeface

The preferred typeface, or null if unspecified.

windowColor

public final @ColorInt int windowColor

The preferred window color.

Public methods

buildUpon

public SubtitleStyle.Builder buildUpon()

Returns a Builder initialized with the values of this instance.

equals

public boolean equals(@Nullable Object obj)

fromCaptionStyle

public static SubtitleStyle fromCaptionStyle(CaptioningManager.CaptionStyle captionStyle)

Creates a SubtitleStyle from a provided CaptionStyle.

Any properties that aren't set in the CaptionStyle are taken from DEFAULT.

Parameters
CaptioningManager.CaptionStyle captionStyle

A CaptionStyle.

Returns
SubtitleStyle

The corresponding SubtitleStyle.

hashCode

public int hashCode()