SubtitleStyle


@UnstableApi
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

A builder for SubtitleStyle instances.

The type of edge, which may be none.

Constants

const SubtitleStyle!

A SubtitleStyle with the default values specified by Builder.

const Int

Edge type value specifying depressed bevel character edges.

const Int

Edge type value specifying drop-shadowed character edges.

const Int

Edge type value specifying no character edges.

const Int

Edge type value specifying uniformly outlined character edges.

const Int

Edge type value specifying raised bevel character edges.

Public functions

SubtitleStyle.Builder!

Returns a Builder initialized with the values of this instance.

Boolean
equals(obj: Any?)
java-static SubtitleStyle!

Creates a SubtitleStyle from a provided CaptionStyle.

Int

Public properties

@ColorInt Int

The preferred background color.

@ColorInt Int

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

Int

The preferred edge type.

@ColorInt Int

The preferred foreground color.

Typeface?

The preferred typeface, or null if unspecified.

@ColorInt Int

The preferred window color.

Constants

DEFAULT

const val DEFAULT: SubtitleStyle!

A SubtitleStyle with the default values specified by Builder.

EDGE_TYPE_DEPRESSED

const val EDGE_TYPE_DEPRESSED = 4: Int

Edge type value specifying depressed bevel character edges.

EDGE_TYPE_DROP_SHADOW

const val EDGE_TYPE_DROP_SHADOW = 2: Int

Edge type value specifying drop-shadowed character edges.

EDGE_TYPE_NONE

const val EDGE_TYPE_NONE = 0: Int

Edge type value specifying no character edges.

EDGE_TYPE_OUTLINE

const val EDGE_TYPE_OUTLINE = 1: Int

Edge type value specifying uniformly outlined character edges.

EDGE_TYPE_RAISED

const val EDGE_TYPE_RAISED = 3: Int

Edge type value specifying raised bevel character edges.

Public functions

buildUpon

fun buildUpon(): SubtitleStyle.Builder!

Returns a Builder initialized with the values of this instance.

equals

fun equals(obj: Any?): Boolean

fromCaptionStyle

java-static fun fromCaptionStyle(captionStyle: CaptioningManager.CaptionStyle!): SubtitleStyle!

Creates a SubtitleStyle from a provided CaptionStyle.

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

Parameters
captionStyle: CaptioningManager.CaptionStyle!

A CaptionStyle.

Returns
SubtitleStyle!

The corresponding SubtitleStyle.

hashCode

fun hashCode(): Int

Public properties

backgroundColor

val backgroundColor: @ColorInt Int

The preferred background color.

edgeColor

val edgeColor: @ColorInt Int

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

foregroundColor

val foregroundColor: @ColorInt Int

The preferred foreground color.

typeface

val typeface: Typeface?

The preferred typeface, or null if unspecified.

windowColor

val windowColor: @ColorInt Int

The preferred window color.