A jetpack compose shimmer effect modifier library ...
# compose
k
A jetpack compose shimmer effect modifier library https://github.com/kazemihabib/compose-shimmer
πŸ‘ 14
a
You don't need to mark modifier factories as
@Composable
when you use the
Modifier.composed {}
builder
being able to omit that and construct modifiers that require composition outside of composition is part of the point of
composed {}
πŸ™‚
k
Oh, thank you, I forgot to remove that after I update to
composed{}
πŸ˜…
πŸ‘ 1
a
I spent part of the morning doing the same updates to my own code πŸ˜„
πŸ‘ 1
r
@Kazemihabib1996 Is the
saveLayer()
necessary?
k
@romainguy Yeah, the result without it:
r
you could try to just draw an alpha gradient with a multiply or add blend mode
But yeah if you want to fade out the base content you'll need the layer unfortunately
k
Yeah, unfortunately, for fade out the base, I need that 😞
@romainguy There isn't any saveLayer in the CanvasScope, and it handles expensive tasks like allocating
Paint
it self. The draw functions of it accept a
blendMode
and we can pass any blendMode to it. So maybe, it should also handle the expensive saveLayer it self some how πŸ€”πŸ€” like what you did with Paint. (I'm not sure just the idea came to my mind after you asked about the saveLayer)
r
Well saveLayer is expensive not matter who executes it
πŸ‘ 1
Moving it to CanvasScope wouldn't change anything
k
Yeah, I was thinking about preventing unnecessary saveLayers. but I don't think it's possible by the way.