# CaptioningManager.CaptionStyle

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# CaptionStyle

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/view/accessibility/CaptioningManager.CaptionStyle "View this page in Java")  

```
class CaptionStyle
```

|---|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                                         ||
| ↳ | [android.view.accessibility.CaptioningManager.CaptionStyle](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#) |

Specifies visual properties for video captions, including foreground and background colors, edge properties, and typeface.

## Summary

|                                                                                                                                                   Constants                                                                                                                                                    ||
|----------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [EDGE_TYPE_DEPRESSED](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#EDGE_TYPE_DEPRESSED:kotlin.Int) Edge type value specifying depressed bevel character edges.   |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [EDGE_TYPE_DROP_SHADOW](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW:kotlin.Int) Edge type value specifying drop-shadowed character edges. |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [EDGE_TYPE_NONE](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#EDGE_TYPE_NONE:kotlin.Int) Edge type value specifying no character edges.                          |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [EDGE_TYPE_OUTLINE](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE:kotlin.Int) Edge type value specifying uniformly outlined character edges.    |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [EDGE_TYPE_RAISED](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#EDGE_TYPE_RAISED:kotlin.Int) Edge type value specifying raised bevel character edges.            |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [EDGE_TYPE_UNSPECIFIED](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#EDGE_TYPE_UNSPECIFIED:kotlin.Int) Unspecified edge type value.                              |

|                                                                                                                       Public methods                                                                                                                        ||
|---------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Typeface](https://developer.android.com/reference/kotlin/android/graphics/Typeface.html#)? | [getTypeface](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#getTypeface())`()` <br />               |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)          | [hasBackgroundColor](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#hasBackgroundColor())`()` <br /> |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)          | [hasEdgeColor](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#hasEdgeColor())`()` <br />             |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)          | [hasEdgeType](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#hasEdgeType())`()` <br />               |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)          | [hasForegroundColor](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#hasForegroundColor())`()` <br /> |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)          | [hasWindowColor](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#hasWindowColor())`()` <br />         |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Properties                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 ||
|----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [backgroundColor](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#backgroundColor:kotlin.Int) The preferred background color for video captions.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [edgeColor](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#edgeColor:kotlin.Int) The preferred edge color for video captions, if using an edge type other than[EDGE_TYPE_NONE](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#EDGE_TYPE_NONE:kotlin.Int).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [edgeType](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#edgeType:kotlin.Int) The preferred edge type for video captions, one of: - [EDGE_TYPE_UNSPECIFIED](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#EDGE_TYPE_UNSPECIFIED:kotlin.Int) - [EDGE_TYPE_NONE](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#EDGE_TYPE_NONE:kotlin.Int) - [EDGE_TYPE_OUTLINE](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE:kotlin.Int) - [EDGE_TYPE_DROP_SHADOW](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW:kotlin.Int) - [EDGE_TYPE_RAISED](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#EDGE_TYPE_RAISED:kotlin.Int) - [EDGE_TYPE_DEPRESSED](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#EDGE_TYPE_DEPRESSED:kotlin.Int) <br /> |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [foregroundColor](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#foregroundColor:kotlin.Int) The preferred foreground color for video captions.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [windowColor](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#windowColor:kotlin.Int) The preferred window color for video captions.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |

## Constants

### EDGE_TYPE_DEPRESSED

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val EDGE_TYPE_DEPRESSED: Int
```

Edge type value specifying depressed bevel character edges.  

    Value: 4

### EDGE_TYPE_DROP_SHADOW

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val EDGE_TYPE_DROP_SHADOW: Int
```

Edge type value specifying drop-shadowed character edges.  

    Value: 2

### EDGE_TYPE_NONE

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val EDGE_TYPE_NONE: Int
```

Edge type value specifying no character edges.  

    Value: 0

### EDGE_TYPE_OUTLINE

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val EDGE_TYPE_OUTLINE: Int
```

Edge type value specifying uniformly outlined character edges.  

    Value: 1

### EDGE_TYPE_RAISED

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val EDGE_TYPE_RAISED: Int
```

Edge type value specifying raised bevel character edges.  

    Value: 3

### EDGE_TYPE_UNSPECIFIED

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val EDGE_TYPE_UNSPECIFIED: Int
```

Unspecified edge type value.  

    Value: -1

## Public methods

### getTypeface

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getTypeface(): Typeface?
```

|                                                                                                                      Return                                                                                                                      ||
|---------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
| [Typeface](https://developer.android.com/reference/kotlin/android/graphics/Typeface.html#)? | the preferred[Typeface](https://developer.android.com/reference/kotlin/android/graphics/Typeface.html#)for video captions, or null if not specified |

### hasBackgroundColor

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun hasBackgroundColor(): Boolean
```

|                                                                                                Return                                                                                                ||
|------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `true`if the user has specified a background color that should override the application default,`false`otherwise |

### hasEdgeColor

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun hasEdgeColor(): Boolean
```

|                                                                                             Return                                                                                              ||
|------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `true`if the user has specified an edge color that should override the application default,`false`otherwise |

### hasEdgeType

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun hasEdgeType(): Boolean
```

|                                                                                             Return                                                                                             ||
|------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `true`if the user has specified an edge type that should override the application default,`false`otherwise |

### hasForegroundColor

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun hasForegroundColor(): Boolean
```

|                                                                                                Return                                                                                                ||
|------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `true`if the user has specified a foreground color that should override the application default,`false`otherwise |

### hasWindowColor

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun hasWindowColor(): Boolean
```

|                                                                                              Return                                                                                              ||
|------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `true`if the user has specified a window color that should override the application default,`false`otherwise |

## Properties

### backgroundColor

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
val backgroundColor: Int
```

The preferred background color for video captions.  

### edgeColor

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
val edgeColor: Int
```

The preferred edge color for video captions, if using an edge type other than[EDGE_TYPE_NONE](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#EDGE_TYPE_NONE:kotlin.Int).  

### edgeType

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
val edgeType: Int
```

The preferred edge type for video captions, one of:

- [EDGE_TYPE_UNSPECIFIED](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#EDGE_TYPE_UNSPECIFIED:kotlin.Int)
- [EDGE_TYPE_NONE](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#EDGE_TYPE_NONE:kotlin.Int)
- [EDGE_TYPE_OUTLINE](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#EDGE_TYPE_OUTLINE:kotlin.Int)
- [EDGE_TYPE_DROP_SHADOW](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#EDGE_TYPE_DROP_SHADOW:kotlin.Int)
- [EDGE_TYPE_RAISED](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#EDGE_TYPE_RAISED:kotlin.Int)
- [EDGE_TYPE_DEPRESSED](https://developer.android.com/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle#EDGE_TYPE_DEPRESSED:kotlin.Int)

<br />

### foregroundColor

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
val foregroundColor: Int
```

The preferred foreground color for video captions.  

### windowColor

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
val windowColor: Int
```

The preferred window color for video captions.