SubtitleStyle.Builder


class SubtitleStyle.Builder


A builder for SubtitleStyle instances.

Summary

Public constructors

Creates an instance with default initial values.

Public functions

SubtitleStyle!

Builds a SubtitleStyle instance.

SubtitleStyle.Builder!

Sets the preferred background color.

SubtitleStyle.Builder!

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

SubtitleStyle.Builder!

Sets the preferred edge type.

SubtitleStyle.Builder!

Sets the preferred foreground color.

SubtitleStyle.Builder!

Sets the preferred typeface, or null if unspecified.

SubtitleStyle.Builder!

Sets the preferred window color.

Public constructors

Builder

Builder()

Creates an instance with default initial values.

Public functions

build

fun build(): SubtitleStyle!

Builds a SubtitleStyle instance.

setBackgroundColor

@CanIgnoreReturnValue
fun setBackgroundColor(backgroundColor: @ColorInt Int): SubtitleStyle.Builder!

Sets the preferred background color.

The default is BLACK.

Parameters
backgroundColor: @ColorInt Int

See backgroundColor.

Returns
SubtitleStyle.Builder!

This builder.

setEdgeColor

@CanIgnoreReturnValue
fun setEdgeColor(edgeColor: @ColorInt Int): SubtitleStyle.Builder!

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

The default is WHITE.

Parameters
edgeColor: @ColorInt Int

See edgeColor.

Returns
SubtitleStyle.Builder!

This builder.

setEdgeType

@CanIgnoreReturnValue
fun setEdgeType(@SubtitleStyle.EdgeType edgeType: Int): SubtitleStyle.Builder!

Sets the preferred edge type.

The default is EDGE_TYPE_NONE.

Parameters
@SubtitleStyle.EdgeType edgeType: Int

See edgeType.

Returns
SubtitleStyle.Builder!

This builder.

setForegroundColor

@CanIgnoreReturnValue
fun setForegroundColor(foregroundColor: @ColorInt Int): SubtitleStyle.Builder!

Sets the preferred foreground color.

The default is WHITE.

Parameters
foregroundColor: @ColorInt Int

See foregroundColor.

Returns
SubtitleStyle.Builder!

This builder.

setTypeface

@CanIgnoreReturnValue
fun setTypeface(typeface: Typeface?): SubtitleStyle.Builder!

Sets the preferred typeface, or null if unspecified.

The default is null.

Parameters
typeface: Typeface?

See typeface.

Returns
SubtitleStyle.Builder!

This builder.

setWindowColor

@CanIgnoreReturnValue
fun setWindowColor(windowColor: @ColorInt Int): SubtitleStyle.Builder!

Sets the preferred window color.

The default is TRANSPARENT.

Parameters
windowColor: @ColorInt Int

See windowColor.

Returns
SubtitleStyle.Builder!

This builder.