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

ShimmerContainer and maskElements leaking views on multiple calls to VeilLayout#setLayout(View) #21

Merged
merged 1 commit into from
Feb 25, 2022

Conversation

AlexQuinlivan
Copy link
Contributor

VeilLayout#maskElements was an array that was seemingly unused, but multiple calls to setLayout would retain all previously held views and append the new views.

VeilLayout#shimmerContainer would eventually grow in size as multiple setLayout calls were made. This was remedied by removing all the views contained on setLayout.

I'm not sure many people have the same use case as I do, but for some of the views that I have their internals have mutable visibility and require multiple refreshes of the shimmer container contents. I was thinking that maybe I should also add an invalidateVeil that skips the removal of the contained layout, but recalculates the shimmer container. Not sure this is something that you'd be interested in, but probably calls for a seperate "New feature" PR.

Gradle spotless apply passes on this PR.

Guidelines

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.

Types of changes

What types of changes does your code introduce?

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Preparing a pull request for review

Ensure your change is properly formatted by running:

$ ./gradlew spotlessApply

Please correct any failures before requesting a review.

… setLayout

MaskElements was an array that was seemingly unused, but multiple calls to setLayout would retain all previously held views and append the new views as well.

ShimmerContainer would eventually grow in size as multiple setLayout calls were made. This can be remedied by removing all the views contained on setLayout.
Copy link
Owner

@skydoves skydoves left a comment

Choose a reason for hiding this comment

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

Hey @AlexQuinlivan,
This is looking great to me. Thank you for contributing this!

@skydoves skydoves merged commit 49d7261 into skydoves:master Feb 25, 2022
@AlexQuinlivan AlexQuinlivan deleted the patch-1 branch February 25, 2022 07:15
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.

None yet

2 participants