Sheroz Nazhmudinov
04/26/2020, 1:31 PMAdam Powell
04/26/2020, 4:51 PMui-foundation
layers as a lot of interaction constructs live there to be used in building components like thatSheroz Nazhmudinov
04/26/2020, 6:04 PM@Composable
fun Custom(modifier: Modifier = Modifier) {
Canvas(modifier = modifier.plus(
Modifier.draggable(dragDirection = DragDirection.Horizontal) {
// drag callback
}
)) {
drawRoundRect(...)
drawCircle(...)
}
}
Adam Powell
04/26/2020, 8:43 PMmodifier.draggable(...)
, modifier.plus(Modifier.draggable(...))
is entirely redundant 🙂Sheroz Nazhmudinov
04/27/2020, 11:39 AMCanvas
with Clickable
, and wanted to change the state of circle based on click. However, the click isn’t triggered. The only way I managed to trigger the onClick
was setting the specific width
and height
in Clickable
via the `modifier`… i guess i’d expect the Clickable
to have already the size of the content of the Canvas
. I hope it makes sense what I’m trying to say…Ash
04/27/2020, 8:42 PMSheroz Nazhmudinov
04/28/2020, 7:29 PMFunctions which invoke @Composable functions must be marked with the @Composable annotation