public interface

SubtitleTrack.RenderingWidget

 androidx.media2.player.subtitle.SubtitleTrack.RenderingWidget

Overview

Interface for rendering subtitles onto a Canvas.

Summary

Methods
public voiddraw(Canvas c)

Renders subtitles onto a .

public voidonAttachedToWindow()

Called when the widget is attached to a window.

public voidonDetachedFromWindow()

Called when the widget is detached from a window.

public voidsetOnChangedListener(SubtitleTrack.RenderingWidget.OnChangedListener callback)

Sets the widget's callback, which is used to send updates when the rendered data has changed.

public voidsetSize(int width, int height)

Sets the widget's size.

public voidsetVisible(boolean visible)

Sets whether the widget should draw subtitles.

Methods

public void setOnChangedListener(SubtitleTrack.RenderingWidget.OnChangedListener callback)

Sets the widget's callback, which is used to send updates when the rendered data has changed.

Parameters:

callback: update callback

public void setSize(int width, int height)

Sets the widget's size.

Parameters:

width: width in pixels
height: height in pixels

public void setVisible(boolean visible)

Sets whether the widget should draw subtitles.

Parameters:

visible: true if subtitles should be drawn, false otherwise

public void draw(Canvas c)

Renders subtitles onto a .

Parameters:

c: canvas on which to render subtitles

public void onAttachedToWindow()

Called when the widget is attached to a window.

public void onDetachedFromWindow()

Called when the widget is detached from a window.