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
RecyclerBinder mount and unmount assume that the same ViewTreeObserver is associated with the RecyclerView when that may not be the case.
There is one ViewTreeObserver that is active while the view is attached to the window, and another "floating" ViewTreeObserver that is active when the view is detached from the window.
Call RecyclerBinder#mount from Fragment's onCreateView lifecycle callback
Call RecyclerBinder#unmount from Fragment's onDestroyView lifecycle callback
Expected Behavior
When RecyclerBinder#unmount is called, expected that when unmount calls unregisterDrawListener that the OnPreDrawListener is removed from the ViewTreeObserver.
Actual Behavior
When RecyclerBinder#unmount is called, the OnPreDrawListener is not removed when unregisterDrawListener is called because the ViewTreeObserver returned is the one representing the "floating" detached view state.
This leaks the OnPreDrawListener.
The text was updated successfully, but these errors were encountered:
Version
0.39.0
Issues and Steps to Reproduce
RecyclerBinder mount and unmount assume that the same ViewTreeObserver is associated with the RecyclerView when that may not be the case.
There is one ViewTreeObserver that is active while the view is attached to the window, and another "floating" ViewTreeObserver that is active when the view is detached from the window.
See implementation of View#getViewTreeObserver for reference.
Using RecyclerBinder from a Fragment:
Expected Behavior
When RecyclerBinder#unmount is called, expected that when unmount calls unregisterDrawListener that the OnPreDrawListener is removed from the ViewTreeObserver.
Actual Behavior
When RecyclerBinder#unmount is called, the OnPreDrawListener is not removed when unregisterDrawListener is called because the ViewTreeObserver returned is the one representing the "floating" detached view state.
This leaks the OnPreDrawListener.
The text was updated successfully, but these errors were encountered: