Improvement: Add method to IFlexible/AbstractFlexibleItem which is invoked by the adapter when RecyclerView.Adapter.onViewAttachedToWindow() is called
See original GitHub issueWhen RecyclerView.Adapter.onViewAttachedToWindow()
is invoked, it’s guaranteed that the view was actually attached to the Window and most likely shown to the user. And correspondingly when onViewDetachedFromWindow()
we know for sure that the user can no longer see the View.
There are some cases where we want to take action for individual items when these events happen - (e.g) stop playing GIFs/videos so that they don’t continue playing unnecessarily while the View is offscreen (this happens when using Glide).
Could you please add some callbacks to IFlexible
that are called when these adapter methods are called?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
RecyclerView.Adapter - Android Developers
This method internally calls onBindViewHolder to update the ViewHolder contents with the item at the given position and also sets up some ...
Read more >Using the RecyclerView | CodePath Android Cliffnotes
The RecyclerView is a ViewGroup that renders any adapter-based view in a similar way. It is supposed to be the successor of ListView...
Read more >RecyclerView.Adapter onViewDetachedFromWindow never ...
Only onViewAttachedToWindow is called when the activity is entered and i can see my items. My adapter looks like this: public class Adapter...
Read more >Android Fundamentals: Working with the RecyclerView ...
onCreateViewHolder(ViewGroup, int). This method is called right when the adapter is created and is used to initialize your ViewHolder(s).
Read more >Look Deep Into ViewPager2 - ProAndroidDev
In the Constructor method in VP2, there is a method called initialize(). ... Let's create an adapter, it has the same usage as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, audio/video/GIFs or any dynamic content whose state needs to be changed based on when they are actually become visible/invisible to the user.
On Dec 7, 2017 15:34, “Davide Steduto” notifications@github.com wrote:
Awesome, thank you!