Skip to content

Instantly share code, notes, and snippets.

@benbaxter
Created August 21, 2017 21:16
Show Gist options
  • Save benbaxter/b4e670aceea60ecba43a1ec7b1a03823 to your computer and use it in GitHub Desktop.
Save benbaxter/b4e670aceea60ecba43a1ec7b1a03823 to your computer and use it in GitHub Desktop.
Steps to get a thumbnail
@Override
public void getThumbnail(int index, final ResultCallback callback) {
// Step 1. Get position from the index.
long position = getSeekPositions()[index];
// Step 2. Retrieve thumbnail in the background to not block the UI thread.
retrieveThumbnailForPosition(position, index, (bitmap) -> {
// Step 3. Return the thumbnail to be presented in the UI.
callback.onThumbnailLoaded(bitmap, index);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment