-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use in RecyclerView to make it's child (ViewHolder) lifecycle aware? #1
Comments
Recycler view is a bit different, you must think about how to reuse views, when user do scroll, is not bound to lifecycle. Android lifecycle can help you to clear/init/pause/stop player according to android lifecycle, not scroll events. Here is an example:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Basically, I want to develop an Instagram kind of auto-play video in nested RecyclerView. So when the user scrolls and stops at a specific position and I would like to receive a callback like this is resumed/paused/stopped/destroyed. So I can make a proper call of ExoPlayer methods and make sure at a time only a single video is playing when the user is not scrolling.
It would be helpful if you can share a simple example of RecyclerView which ViweHolder receives the above-mentioend callbacks.
The text was updated successfully, but these errors were encountered: