Spikey Sanju
06/06/2021, 10:15 AMCombinedClickable
takes 1-2 seconds
to perform action?. Is there any workaround solution for this?
Code in Thread 🙇Spikey Sanju
06/06/2021, 10:16 AMfun TaskItemCard(task: Task, onClick: () -> Unit, onDoubleTap: () -> Unit, onLongClick: () -> Unit) {
// Emoji + (title + category)
Row(
modifier = Modifier
.fillMaxWidth()
.combinedClickable(onClick = {
onClick()
}, onDoubleClick = {
onDoubleTap()
}, onLongClick = {
onLongClick()
}),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.Start
) {
// Emoji Text View
EmojiTextView(emoji = task.emoji)
Spacer(modifier = Modifier.width(12.dp))
// Title + Content
Column(
modifier = Modifier
.align(Alignment.CenterVertically),
) {
Text(
text = task.title,
style = typography.subtitle1,
color = colors.onPrimary,
maxLines = 1,
overflow = TextOverflow.Ellipsis
)
Spacer(modifier = Modifier.height(12.dp))
Text(
text = task.category,
style = typography.caption,
color = colors.onPrimary.copy(.7f)
)
}
}
}
ste
06/06/2021, 10:26 AMSpikey Sanju
06/06/2021, 10:27 AMtap gestures
to handle multiple touch events. But with those implementation also I face the same performance issue!Colton Idle
06/06/2021, 1:01 PMSpikey Sanju
06/06/2021, 1:02 PMSpikey Sanju
06/06/2021, 1:46 PMSpikey Sanju
06/06/2021, 1:46 PMColton Idle
06/06/2021, 1:48 PMRick Regan
06/06/2021, 3:56 PMLouis Pullen-Freilich [G]
06/06/2021, 5:28 PMmatvei
06/07/2021, 10:30 AMcombinedClickable
modifier, when you have onDoubleClick
set, onClick will fire only after 300ms
of the click event, since we need to disambiguate between click and doubleclick and we need to wait 300ms for a potential doubleckick to happen (or not). This is the same way it works in the android views.
We hopefully can do better, but this is exactly the issue on why combinedClickable
is experimental, so proceed with caution on this one.
This is most probably what is causing the delay in your case. If you see other delays and if you are able to provide a sample that will help me to reproduce the issue with the >300ms delay -- please file a bug and we will take a look.Spikey Sanju
06/07/2021, 4:50 PM