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

Unwrap context to find parent activity in order to share viewpool #1157

Merged
merged 1 commit into from
Mar 31, 2021

Conversation

wbonnefond
Copy link
Contributor

@wbonnefond wbonnefond commented Mar 31, 2021

Fix for #1025. When EpoxyRecyclerView is used in a fragment in an app using Hilt, the context passed to the viewpool is a new FragmentContextWrapper instance for each fragment. This causes a cache miss in ActivityRecyclerPool and results in an ever growing list of pools.

This PR unwraps the context if it is a ContextWrapper in order to find the parent activity in order to share the viewpool.

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.

Thanks for adding this. Looks good to me

@elihart elihart merged commit 7ee9f69 into airbnb:master Mar 31, 2021
@elihart elihart mentioned this pull request Apr 13, 2021
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