CaptionStyleCompat


@UnstableApi
public final class CaptionStyleCompat


A compatibility wrapper for CaptionStyle.

Summary

Nested types

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(value = )
public annotation CaptionStyleCompat.EdgeType

The type of edge, which may be none.

Constants

static final CaptionStyleCompat

Default caption style.

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.

static final int

Use color setting specified by the track and fallback to default caption style.

Public fields

final int

The preferred background color.

final int

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

final int

The preferred edge type.

final int

The preferred foreground color.

final @Nullable Typeface

The preferred typeface, or null if unspecified.

final int

The preferred window color.

Public constructors

CaptionStyleCompat(
    int foregroundColor,
    int backgroundColor,
    int windowColor,
    @CaptionStyleCompat.EdgeType int edgeType,
    int edgeColor,
    @Nullable Typeface typeface
)

Public methods

static CaptionStyleCompat

Creates a CaptionStyleCompat equivalent to a provided CaptionStyle.

Constants

DEFAULT

public static final CaptionStyleCompat DEFAULT

Default caption style.

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.

USE_TRACK_COLOR_SETTINGS

public static final int USE_TRACK_COLOR_SETTINGS = 1

Use color setting specified by the track and fallback to default caption style.

Public fields

backgroundColor

public final int backgroundColor

The preferred background color.

edgeColor

public final int edgeColor

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

foregroundColor

public final int foregroundColor

The preferred foreground color.

typeface

public final @Nullable Typeface typeface

The preferred typeface, or null if unspecified.

windowColor

public final int windowColor

The preferred window color.

Public constructors

CaptionStyleCompat

public CaptionStyleCompat(
    int foregroundColor,
    int backgroundColor,
    int windowColor,
    @CaptionStyleCompat.EdgeType int edgeType,
    int edgeColor,
    @Nullable Typeface typeface
)
Parameters
int foregroundColor

See foregroundColor.

int backgroundColor

See backgroundColor.

int windowColor

See windowColor.

@CaptionStyleCompat.EdgeType int edgeType

See edgeType.

int edgeColor

See edgeColor.

@Nullable Typeface typeface

See typeface.

Public methods

createFromCaptionStyle

public static CaptionStyleCompat createFromCaptionStyle(CaptioningManager.CaptionStyle captionStyle)

Creates a CaptionStyleCompat equivalent to a provided CaptionStyle.

Parameters
CaptioningManager.CaptionStyle captionStyle

A CaptionStyle.

Returns
CaptionStyleCompat

The equivalent CaptionStyleCompat.