Skip to content
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

Add unbind extension to ItemViewBindingEpoxyHolder #1223

Merged
merged 1 commit into from
Aug 27, 2021

Conversation

SubhrajyotiSen
Copy link
Contributor

In epoxy-sample, we show an example of using unbind to avoid memory leaks. Add an extension function for unbind to ItemViewBindingEpoxyHolder so that view binding can be used to clear listeners too.
The unbind extension function can be an optional override since not all ViewHolders will have listeners/resource allocation.

Also add example usage to kotlin-sample.

In epoxy-sample, we show an example of using `unbind` to avoid memory leaks. Add an extension function for unbind to ItemViewBindingEpoxyHolder so that view binding can be used to clear listeners too.
The `unbind` extension function can be an optional override since not all ViewHolders will have listeners/resource allocation.

Also add example usage to kotlin-sample.
Copy link
Contributor

@elihart elihart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, thanks!

@elihart elihart merged commit 1175771 into airbnb:master Aug 27, 2021
@SubhrajyotiSen SubhrajyotiSen deleted the view-binding-unbind branch May 19, 2023 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants