You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to update the ViewHolder just as the View appears on the Window from the Adapter. However, I am unable to do so, as the onViewAttachedToWindow() callback is not triggered as views are recycled and displayed in the pager.
Please state the best way to achieve this. Using onBindViewHolder() callback, the layout can be changed when not visible on screen. Essentially I have a View Animator holding several ImageViews for a slideshow. My dilemma is: I only wish to add Images to the layout when the view is becoming visible in the RecyclerViewPager.
Moreover, is there a way to limit the number of Views created in the pager? I'm looking for a method similar to the standard ViewPager's setOffscreenPageLimit(int pages)
Thanks,
Arjun
The text was updated successfully, but these errors were encountered:
Hi,
I am trying to update the ViewHolder just as the View appears on the Window from the Adapter. However, I am unable to do so, as the onViewAttachedToWindow() callback is not triggered as views are recycled and displayed in the pager.
Please state the best way to achieve this. Using onBindViewHolder() callback, the layout can be changed when not visible on screen. Essentially I have a View Animator holding several ImageViews for a slideshow. My dilemma is: I only wish to add Images to the layout when the view is becoming visible in the RecyclerViewPager.
Moreover, is there a way to limit the number of Views created in the pager? I'm looking for a method similar to the standard ViewPager's setOffscreenPageLimit(int pages)
Thanks,
Arjun
The text was updated successfully, but these errors were encountered: