Ayfri
06/14/2023, 6:30 AMJonas
06/14/2023, 6:35 AM.drawBehind
then draw a rect with rounded corners and a triangle. + some paddingAyla
06/14/2023, 6:39 AMAyfri
06/14/2023, 6:40 AMJonas
06/14/2023, 6:41 AMAyla
06/14/2023, 6:50 AM@Composable
fun waveShape(): GenericShape {
return remember() {
GenericShape { size: Size, layoutDirection: LayoutDirection ->
//do like what you do on a canvas
}
}
}
@Composable
fun Box(){
Surface(shape=waveShape()...){}
}
Jonas
06/14/2023, 6:58 AMEganathan R
06/14/2023, 7:01 AMephemient
06/14/2023, 7:02 AMephemient
06/14/2023, 7:02 AMOleksandr Balan
06/14/2023, 8:01 AMGenericShape
and paths union operation
https://kotlinlang.slack.com/archives/CJLTWPH7S/p1682318620876329ephemient
06/14/2023, 8:11 AMModifier.clip(shape).background(...)
than Modifier.border()
, but that's the right ideaephemient
06/14/2023, 8:13 AMModifier.clip(shape).background(...).clickable { }.padding(...)
you can see that the ripple covers the right area, whereas that doesn't automatically happen with .border()
ephemient
06/14/2023, 8:22 AMAyfri
06/14/2023, 10:05 AMStylianos Gakis
06/14/2023, 12:59 PMop
exists, I guess it’d be better for me to do that instead of just adding the two paths to my path object, thanks about that!