ShimmerContainer and maskElements leaking views on multiple calls to VeilLayout#setLayout(View) #21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?
Preparing a pull request for review
Ensure your change is properly formatted by running:
$ ./gradlew spotlessApply
Please correct any failures before requesting a review.