Stay organized with collections Save and categorize content based on your preferences.

CaptionStyleCompat

@UnstableApi
class CaptionStyleCompat


A compatibility wrapper for CaptionStyle.

Summary

Nested types

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

The type of edge, which may be none.

Constants

const CaptionStyleCompat!

Default caption style.

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.

const Int

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

Public constructors

CaptionStyleCompat(
    foregroundColor: Int,
    backgroundColor: Int,
    windowColor: Int,
    @CaptionStyleCompat.EdgeType edgeType: Int,
    edgeColor: Int,
    typeface: Typeface?
)

Public functions

java-static CaptionStyleCompat!

Creates a CaptionStyleCompat equivalent to a provided CaptionStyle.

Public properties

Int

The preferred background color.

Int

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

Int

The preferred edge type.

Int

The preferred foreground color.

Typeface?

The preferred typeface, or null if unspecified.

Int

The preferred window color.

Constants

DEFAULT

const val DEFAULTCaptionStyleCompat!

Default caption style.

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.

USE_TRACK_COLOR_SETTINGS

const val USE_TRACK_COLOR_SETTINGS = 1: Int

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

Public constructors

CaptionStyleCompat

CaptionStyleCompat(
    foregroundColor: Int,
    backgroundColor: Int,
    windowColor: Int,
    @CaptionStyleCompat.EdgeType edgeType: Int,
    edgeColor: Int,
    typeface: Typeface?
)
Parameters
foregroundColor: Int

See foregroundColor.

backgroundColor: Int

See backgroundColor.

windowColor: Int

See windowColor.

@CaptionStyleCompat.EdgeType edgeType: Int

See edgeType.

edgeColor: Int

See edgeColor.

typeface: Typeface?

See typeface.

Public functions

createFromCaptionStyle

@RequiresApi(value = 19)
java-static fun createFromCaptionStyle(captionStyle: CaptioningManager.CaptionStyle!): CaptionStyleCompat!

Creates a CaptionStyleCompat equivalent to a provided CaptionStyle.

Parameters
captionStyle: CaptioningManager.CaptionStyle!

A CaptionStyle.

Returns
CaptionStyleCompat!

The equivalent CaptionStyleCompat.

Public properties

backgroundColor

val backgroundColorInt

The preferred background color.

edgeColor

val edgeColorInt

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

foregroundColor

val foregroundColorInt

The preferred foreground color.

typeface

val typefaceTypeface?

The preferred typeface, or null if unspecified.

windowColor

val windowColorInt

The preferred window color.