<#C04TPPEQKEJ|compose-android> How can I intercep...
# compose-android
d
#compose-android How can I intercept touch even in parent widget? like the demo, what should I do to control log print in Box?
Copy code
Box() {
    Text("test",Modifier.clickable {
        LogUtil.i("Text click")
    } )
}
k
You don’t need to tag the channel name in every post. You’re already here.
As to your question, is it only for touch events, or for any user interaction such as keyboard, accessibility traversal, etc? What do you mean by intercept - block, conditionally handle, something else?
d
only touch and draw,my requirement is if the main switch close, the other function can't operate, such as : click to open a dialog, draw a slider, click other switch
j
You should define a state e.g. (note this is pseudocode)
var isClicked = remember mutableStateOf false
And then you can do
onClick = { isClicked = true
} . To show a slider you use conditional rendering, e.g. with
AnimatedVisibility(isClicked) { Slider() }
. Opening a dialog is something else. I suggest you post another question here.