david.bilik
12/05/2022, 10:52 AMBox
and a single Box
as a child. I have a long press listener on the parent and normal click listener on a child. My problem is - when I long press the child, the parent long press listener is not fired. Is there any way how to achieve this without specifying the long press listener on the child as well?david.bilik
12/05/2022, 10:52 AMBox(
modifier = Modifier
.fillMaxWidth()
.combinedClickable(
onLongClick = {
Toast
.makeText(context, "Long click parent", Toast.LENGTH_SHORT)
.show()
},
onClick = {
Toast
.makeText(context, "Normal click parent", Toast.LENGTH_SHORT)
.show()
}
)
.padding(16.dp)
) {
Box(
modifier = Modifier
.height(100.dp)
.fillMaxWidth()
.background(color = Color.Green)
.clickable {
Toast
.makeText(context, "Normal click child", Toast.LENGTH_SHORT)
.show()
}
)
}