Thread
#compose
    Spikey Sanju

    Spikey Sanju

    1 year ago
    Hello All 👋 , Why
    CombinedClickable
    takes
    1-2 seconds
    to perform action?. Is there any workaround solution for this? Code in Thread 🙇
    Sample Code 👀
    fun 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)
                )
            }
        }
    }
    s

    ste

    1 year ago
    It happens to me too at the very first click after app startup
    Spikey Sanju

    Spikey Sanju

    1 year ago
    Also I tried to use
    tap gestures
    to handle multiple touch events. But with those implementation also I face the same performance issue!
    Colton Idle

    Colton Idle

    1 year ago
    Romain has asked for any reproducable perf issues to be reported on the issuetracker for more visibility and so they can hopefully fix by 1.0 I would file there with the code and a video?
    Spikey Sanju

    Spikey Sanju

    1 year ago
    Sure gimme a moment will send you the code & video
    Colton Idle

    Colton Idle

    1 year ago
    Take those samples and file a bug on issue tracker. 😁 I'm not on the compose team and have no idea why the issue might be happening.
    Rick Regan

    Rick Regan

    1 year ago
    ste: There have been a few discussions of performance at app startup, like this thread from Mar 11https://kotlinlang.slack.com/archives/CJLTWPH7S/p1615475836408100 and this one from May 10 https://kotlinlang.slack.com/archives/CJLTWPH7S/p1620669472316800
    l

    Louis Pullen-Freilich [G]

    1 year ago
    @matvei
    matvei

    matvei

    1 year ago
    With the
    combinedClickable
    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

    Spikey Sanju

    1 year ago
    Got it. Sure will file a bug!