Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9b466783 authored by Yuri Lin's avatar Yuri Lin
Browse files

Move long-click handling to BundleHeader

This allows talkback/accessibility focus to know that the row is long-clickable in addition to clickable. It calls through to the same existing long-click handler on ExpandableNotificationRow that was handling the functionality before.

Fixes: 424352595
Test: manual, confirmed talkback on header says "double-tap to activate. double-tap and hold to long press", and also that guts opens as expected and behaves normally
Flag: com.android.systemui.notification_bundle_ui
Change-Id: I3b51d240dd0ea7772274d3e78cff604d78e77e13
parent df017879
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ import androidx.compose.animation.core.LinearEasing
import androidx.compose.animation.core.tween
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.combinedClickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
@@ -86,6 +86,7 @@ fun BundleHeader(
    viewModel: BundleHeaderViewModel,
    modifier: Modifier = Modifier,
    onHeaderClicked: () -> Unit = {},
    onHeaderLongClicked: () -> Unit = {},
) {
    val state =
        rememberMutableSceneTransitionLayoutState(
@@ -139,11 +140,12 @@ fun BundleHeader(
        SceneTransitionLayout(
            state = state,
            modifier =
                Modifier.clickable(
                Modifier.combinedClickable(
                    onClick = {
                        viewModel.onHeaderClicked()
                        onHeaderClicked()
                    },
                    onLongClick = { onHeaderLongClicked() },
                    interactionSource = null,
                    indication = null,
                ),
+5 −1
Original line number Diff line number Diff line
@@ -176,7 +176,11 @@ private fun HeaderComposeViewContent(
            row.setBundleHeaderViewModel(viewModel)
            onDispose { row.setBundleHeaderViewModel(null) }
        }
        BundleHeader(viewModel, onHeaderClicked = { row.expandNotification() })
        BundleHeader(
            viewModel,
            onHeaderClicked = { row.expandNotification() },
            onHeaderLongClicked = { row.performLongClick() },
        )
    }
}