SubtitleStyle.Builder


public final class SubtitleStyle.Builder


A builder for SubtitleStyle instances.

Summary

Public constructors

Creates an instance with default initial values.

Public methods

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

public Builder()

Creates an instance with default initial values.

Public methods

build

public SubtitleStyle build()

Builds a SubtitleStyle instance.

setBackgroundColor

@CanIgnoreReturnValue
public SubtitleStyle.Builder setBackgroundColor(@ColorInt int backgroundColor)

Sets the preferred background color.

The default is BLACK.

Parameters
@ColorInt int backgroundColor

See backgroundColor.

Returns
SubtitleStyle.Builder

This builder.

setEdgeColor

@CanIgnoreReturnValue
public SubtitleStyle.Builder setEdgeColor(@ColorInt int edgeColor)

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

The default is WHITE.

Parameters
@ColorInt int edgeColor

See edgeColor.

Returns
SubtitleStyle.Builder

This builder.

setEdgeType

@CanIgnoreReturnValue
public SubtitleStyle.Builder setEdgeType(@SubtitleStyle.EdgeType int edgeType)

Sets the preferred edge type.

The default is EDGE_TYPE_NONE.

Parameters
@SubtitleStyle.EdgeType int edgeType

See edgeType.

Returns
SubtitleStyle.Builder

This builder.

setForegroundColor

@CanIgnoreReturnValue
public SubtitleStyle.Builder setForegroundColor(@ColorInt int foregroundColor)

Sets the preferred foreground color.

The default is WHITE.

Parameters
@ColorInt int foregroundColor

See foregroundColor.

Returns
SubtitleStyle.Builder

This builder.

setTypeface

@CanIgnoreReturnValue
public SubtitleStyle.Builder setTypeface(@Nullable Typeface typeface)

Sets the preferred typeface, or null if unspecified.

The default is null.

Parameters
@Nullable Typeface typeface

See typeface.

Returns
SubtitleStyle.Builder

This builder.

setWindowColor

@CanIgnoreReturnValue
public SubtitleStyle.Builder setWindowColor(@ColorInt int windowColor)

Sets the preferred window color.

The default is TRANSPARENT.

Parameters
@ColorInt int windowColor

See windowColor.

Returns
SubtitleStyle.Builder

This builder.