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.
Hello there 馃憢
I'm going to be using a shimmer in my application and thought this package was great! However, I desired more customization over the gradient.
Overview
I change
GradientMask
to supply the definition used for the underlyingLinearGradient
. The default values match the current gradient.Example
Since
GradientMask.startPoint
andGradientMask.endPoint
are properties, this allows the gradient to "move" in different directions. Due to this, I think that this overrides #4.Right to Left Example
Screen.Recording.2022-11-12.at.2.55.22.PM.mov
Top to Bottom Example
Screen.Recording.2022-11-12.at.2.56.06.PM.mov
Inverse mask
Currently, the gradient is applied as a plain
.mask(...)
which doesn't suite my needs, as it changes the opacity of the underlying view to the opacity of the edge points of theLinearGradient
, and I don't think that a shimmer should change the opacity of the underlying view.GradientMask.inverse
determines whether the mask should be inverted or not, therefore having the shimmer effect be the gradient itself, and not a mask over the gradient. I personally think this should be the default behavior but I won't change the current implementation.Current Implementation Example
Screen.Recording.2022-11-12.at.2.57.18.PM.mov
Inverted Mask Example
Screen.Recording.2022-11-12.at.2.54.33.PM.mov
Other
Shimmer
object. Redundant for this package's use.GradientMask
customization