Created
August 21, 2017 21:16
-
-
Save benbaxter/b4e670aceea60ecba43a1ec7b1a03823 to your computer and use it in GitHub Desktop.
Steps to get a thumbnail
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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