From dbd0f8b60577150cbf7c0593a820dcfcbccc9e00 Mon Sep 17 00:00:00 2001 From: gmerino Date: Wed, 20 Sep 2023 12:02:37 +0200 Subject: [PATCH] ANDROID-13761 Adding semantics to the popover --- .../java/com/telefonica/mistica/compose/popover/PopOver.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/src/main/java/com/telefonica/mistica/compose/popover/PopOver.kt b/library/src/main/java/com/telefonica/mistica/compose/popover/PopOver.kt index a5bfd3d61..727c083f6 100644 --- a/library/src/main/java/com/telefonica/mistica/compose/popover/PopOver.kt +++ b/library/src/main/java/com/telefonica/mistica/compose/popover/PopOver.kt @@ -22,11 +22,14 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment +import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.onGloballyPositioned import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.painterResource +import androidx.compose.ui.semantics.semantics +import androidx.compose.ui.semantics.testTagsAsResourceId import androidx.compose.ui.unit.dp import com.skydoves.balloon.ArrowPositionRules import com.skydoves.balloon.BalloonAnimation @@ -42,6 +45,7 @@ import com.telefonica.mistica.compose.popover.Popover.TestTag.POPOVER_SUBTITLE import com.telefonica.mistica.compose.popover.Popover.TestTag.POPOVER_TITLE import com.telefonica.mistica.compose.theme.MisticaTheme +@OptIn(ExperimentalComposeUiApi::class) @Composable fun PopOver( modifier: Modifier = Modifier, @@ -83,6 +87,7 @@ fun PopOver( .fillMaxWidth() .padding(start = 16.dp, top = 8.dp, end = 8.dp, bottom = 16.dp) .background(Color.Transparent) + .semantics { testTagsAsResourceId = true } .testTag(POPOVER_CONTENT), ) { Row(