One Off the Slack: Implementing a Shimmer Effect
Karandeep Singh implemented a shimmer effect, the sort of gradient-based animated shine effect that you see in some UIs. However, Karandeep was not happy with the implementation and asked for advice.
Google’s Leland Richardson went one step further and posted
a gist with two implementations of the effect.
Unfortunately, his gist previewed an upcoming feature of Compose:
composed function for creating a
Modifier. That needs to be
converted into a
@Composable function for now.
The discussion continued on whether or not
can return values. They can — that has been possible since
though some older documentation has not been updated to reflect this fact.
A fair bit of Compose now is in the form of
@Composable functions that
return values, though typically a
@Composable function either renders UI
nodes or returns something, usually not both.