Package com.google.android.exoplayer2.ui

## Class CaptionStyleCompat

- java.lang.Object
- - com.google.android.exoplayer2.ui.CaptionStyleCompat

-     public final class CaptionStyleCompat
      extends Object

  A compatibility wrapper for `CaptioningManager.CaptionStyle`.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static interface` | `CaptionStyleCompat.EdgeType` | The type of edge, which may be none.

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `int` | `backgroundColor` | The preferred background color.
    `static CaptionStyleCompat` | `DEFAULT` | Default caption style.
    `static int` | `EDGE_TYPE_DEPRESSED` | Edge type value specifying depressed bevel character edges.
    `static int` | `EDGE_TYPE_DROP_SHADOW` | Edge type value specifying drop-shadowed character edges.
    `static int` | `EDGE_TYPE_NONE` | Edge type value specifying no character edges.
    `static int` | `EDGE_TYPE_OUTLINE` | Edge type value specifying uniformly outlined character edges.
    `static int` | `EDGE_TYPE_RAISED` | Edge type value specifying raised bevel character edges.
    `int` | `edgeColor` | The preferred edge color, if using an edge type other than `EDGE_TYPE_NONE`.
    `int` | `edgeType` | The preferred edge type.
    `int` | `foregroundColor` | The preferred foreground color.
    `Typeface` | `typeface` | The preferred typeface, or `null` if unspecified.
    `static int` | `USE_TRACK_COLOR_SETTINGS` | Use color setting specified by the track and fallback to default caption style.
    `int` | `windowColor` | The preferred window color.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `CaptionStyleCompat​(int foregroundColor, int backgroundColor, int windowColor, int edgeType, int edgeColor, Typeface typeface)` |

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static CaptionStyleCompat` | `createFromCaptionStyle​(CaptioningManager.CaptionStyle captionStyle)` | Creates a `CaptionStyleCompat` equivalent to a provided `CaptioningManager.CaptionStyle`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### EDGE_TYPE_NONE

          public static final int EDGE_TYPE_NONE

      Edge type value specifying no character edges.
      See Also:
        Constant Field Values

    - #### EDGE_TYPE_OUTLINE

          public static final int EDGE_TYPE_OUTLINE

      Edge type value specifying uniformly outlined character edges.
      See Also:
        Constant Field Values

    - #### EDGE_TYPE_DROP_SHADOW

          public static final int EDGE_TYPE_DROP_SHADOW

      Edge type value specifying drop-shadowed character edges.
      See Also:
        Constant Field Values

    - #### EDGE_TYPE_RAISED

          public static final int EDGE_TYPE_RAISED

      Edge type value specifying raised bevel character edges.
      See Also:
        Constant Field Values

    - #### EDGE_TYPE_DEPRESSED

          public static final int EDGE_TYPE_DEPRESSED

      Edge type value specifying depressed bevel character edges.
      See Also:
        Constant Field Values

    - #### USE_TRACK_COLOR_SETTINGS

          public static final int USE_TRACK_COLOR_SETTINGS

      Use color setting specified by the track and fallback to default caption style.
      See Also:
        Constant Field Values

    - #### DEFAULT

          public static final CaptionStyleCompat DEFAULT

      Default caption style.

    - #### foregroundColor

          public final int foregroundColor

      The preferred foreground color.

    - #### backgroundColor

          public final int backgroundColor

      The preferred background color.

    - #### windowColor

          public final int windowColor

      The preferred window color.

    - #### edgeType

          @EdgeType
          public final int edgeType

      The preferred edge type. One of:
      - `EDGE_TYPE_NONE`
      - `EDGE_TYPE_OUTLINE`
      - `EDGE_TYPE_DROP_SHADOW`
      - `EDGE_TYPE_RAISED`
      - `EDGE_TYPE_DEPRESSED`

    - #### edgeColor

          public final int edgeColor

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

    - #### typeface

          @Nullable
          public final Typeface typeface

      The preferred typeface, or `null` if unspecified.

  - ### Constructor Detail

    - #### CaptionStyleCompat

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

      Parameters:
        `foregroundColor` - See `foregroundColor`.
        `backgroundColor` - See `backgroundColor`.
        `windowColor` - See `windowColor`.
        `edgeType` - See `edgeType`.
        `edgeColor` - See `edgeColor`.
        `typeface` - See `typeface`.

  - ### Method Detail

    - #### createFromCaptionStyle

          @RequiresApi(19)
          public static CaptionStyleCompat createFromCaptionStyle​(CaptioningManager.CaptionStyle captionStyle)

      Creates a `CaptionStyleCompat` equivalent to a provided `CaptioningManager.CaptionStyle`.
      Parameters:
        `captionStyle` - A `CaptioningManager.CaptionStyle`.
      Returns:
        The equivalent `CaptionStyleCompat`.