valentinilk / compose-shimmer

A simple shimmer library for Jetpack Compose.
https://valentinilk.github.io/compose-shimmer/
Apache License 2.0
634 stars 35 forks source link

A simple way to change the animation time #4

Closed PierreVieira closed 2 years ago

PierreVieira commented 2 years ago

Would it be possible to develop something like passing the animation time in milliseconds like .shimmer(time = 500)?

valentinilk commented 2 years ago

It's been a while since you asked, but I just had a look. Seems like the necessary constructors are locked up quite well.

So I don't think I'll add something like the suggested time parameter to the library itself, but I could rearrange a bit of code to enable you to write it on your own.

I'll give you an update in a day or two. :)

valentinilk commented 2 years ago

Just released version v1.0.2, which exposes the theming as a parameter for the rememberShimmer function. This will allow you to write a custom modifier, so you can extend it to fit your needs.

Please have a look at the new section in the readme: Custom Modifier