https://kotlinlang.org logo
p

pavi2410

10/30/2020, 6:10 PM
Do anybody know how to make dynamic gradient list like this? I tried to use ScrollableColumn with its scrollState, but I am super confused how to vary the gradient on scroll
3
c

Colton Idle

10/30/2020, 6:49 PM
This looks really cool! (idk how I would feel about this as a user) but it does look cool!
a

Adriano Celentano

10/30/2020, 7:12 PM
Looks nice. I didnt really work with scrollable composables yet. But i would guess u can have the scroll position as a state. I think u could then pass that state to the children of the list. Inside the children u could use Lineargadient and use the Color lerp function to get the current value of the color based on the scrollstate.
p

pavi2410

10/30/2020, 7:22 PM
Good tip @Adriano Celentano about the Color.lerp function 👍
🙂 1
c

caelum19

10/31/2020, 10:52 AM
Would be lovely if Compose offered some DSLs for making and applying filters. A single gradient transparent block above the message backgrounds and under the white text would be a nice way to do this
I suppose you could already do that but without any "blending mode"s the background would have the gradient too
s

Se7eN

11/06/2020, 1:07 PM
Did anyone do this?
3 Views