Closed kjeremy closed 8 years ago
Note that I also tried creating my own RecycledViewPool where we clear the bindings on Clear
but that didn't help. I have a feeling that if someone wanted to share views between adapters/recyclerviews they'd have to customize the RecycledViewPool
as well so maybe we shouldn't really worry about someone sharing views right now.
I don't see a lot of cases where you would want to share the RecyclerViewAdapter between shown views on the screen anyways.
I think this is good as is. Then we can take the edge case of sharing views in the future.
Keep WeakReferences of all ViewHolders created by the adapter. When the associated RecyclerView is detached from the window we clear the bindings. Note that this does not Dispose of the ViewHolder since the Adapter doesn't really manage the lifetime of the ViewHolder and there is no callback for when the ViewHolder is destroyed.
Without this we leak target bindings.
Fixes https://github.com/MvvmCross/MvvmCross/issues/1379