Utkarsh Tiwari
08/18/2021, 12:04 PMtalkback a11y
doesn't focus on the text anymore. Doesn't anyone know what could be wrong with this approach?
var isTextPressed by remember { mutableStateOf(false) }
Text(
modifier = Modifier
.pointerInput(Unit) {
detectTapGestures(
onPress = {
isTextPressed = true
if (tryAwaitRelease()) {
isTextPressed = false
}
},
onTap = {
onClick.invoke()
}
)
}
...
...
)
Tepes Lucian Victor
03/31/2022, 8:39 AMUtkarsh Tiwari
03/31/2022, 9:19 AMval interactionSource = remember { MutableInteractionSource() }
val isPressed by interactionSource.collectIsPressedAsState()
val interactionModifier =
Modifier
.clickable(
interactionSource,
indication = rememberRipple(color = Color.Blue),
enabled = enabled
) { onClick() }
Utkarsh Tiwari
03/31/2022, 9:19 AMinteractionModifier
to your target composableTepes Lucian Victor
03/31/2022, 9:24 AMpointerInput
to detect zoom and pan on an imageTepes Lucian Victor
03/31/2022, 9:25 AMTobias Preuss
04/09/2024, 10:19 PMcomposed { }
.