Skip to content

Most visited

Recently visited

navigation
added in version 26.1.0
belongs to Maven artifact com.android.support:leanback-v17:27.0.0

PlaybackSeekDataProvider

public class PlaybackSeekDataProvider
extends Object

java.lang.Object
   ↳ android.support.v17.leanback.widget.PlaybackSeekDataProvider


Class to be implemented by app to provide seeking data and thumbnails to UI.

Summary

Nested classes

class PlaybackSeekDataProvider.ResultCallback

Client to receive result for getThumbnail(int, ResultCallback)

Public constructors

PlaybackSeekDataProvider()

Public methods

long[] getSeekPositions()

Get a list of sorted seek positions.

void getThumbnail(int index, PlaybackSeekDataProvider.ResultCallback callback)

Called to get thumbnail bitmap.

void reset()

Called when seek stops, Provider should cancel pending requests for the thumbnails.

Inherited methods

From class java.lang.Object

Public constructors

PlaybackSeekDataProvider

added in version 26.1.0
PlaybackSeekDataProvider ()

Public methods

getSeekPositions

added in version 26.1.0
long[] getSeekPositions ()

Get a list of sorted seek positions. The positions should not change after user starts seeking.

Returns
long[] A list of sorted seek positions.

getThumbnail

added in version 26.1.0
void getThumbnail (int index, 
                PlaybackSeekDataProvider.ResultCallback callback)

Called to get thumbnail bitmap. This method is called on UI thread. When provider finds cache bitmap, it may invoke onThumbnailLoaded(Bitmap, int) immediately. Provider may start background thread and invoke onThumbnailLoaded(Bitmap, int) later in UI thread. The method might be called multiple times for the same position, PlaybackSeekDataProvider must guarantee to replace pending PlaybackSeekDataProvider.ResultCallback with the new one. When seeking right, getThumbnail() will be called with increasing index; when seeking left, getThumbnail() will be called with decreasing index. The increment of index can be used by subclass to determine prefetch direction.

Parameters
index int: Index of position in getSeekPositions().

callback PlaybackSeekDataProvider.ResultCallback: The callback to receive the result on UI thread. It may be called within getThumbnail() if hit cache directly.

reset

added in version 26.1.0
void reset ()

Called when seek stops, Provider should cancel pending requests for the thumbnails.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)