diff options
author | 2025-02-04 04:41:26 -0800 | |
---|---|---|
committer | 2025-02-04 04:41:26 -0800 | |
commit | 3d86ac6147ad6979c3bd2277a22d6609cc8a148e (patch) | |
tree | d3c6248c574082d93e873005dc087066684f8301 /photopicker | |
parent | 7e7d2e377807b7e1e007d6264f47d75d231b17fa (diff) | |
parent | d388cfa5ec1cf3132bee7ea9bebca722a1390641 (diff) |
Merge "Fix double talkback announcement of photos and albumbs tab." into main
Diffstat (limited to 'photopicker')
3 files changed, 5 insertions, 16 deletions
diff --git a/photopicker/src/com/android/photopicker/features/albumgrid/AlbumGrid.kt b/photopicker/src/com/android/photopicker/features/albumgrid/AlbumGrid.kt index f0e993170..7cec24324 100644 --- a/photopicker/src/com/android/photopicker/features/albumgrid/AlbumGrid.kt +++ b/photopicker/src/com/android/photopicker/features/albumgrid/AlbumGrid.kt @@ -31,8 +31,6 @@ import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.Modifier import androidx.compose.ui.input.pointer.pointerInput import androidx.compose.ui.res.stringResource -import androidx.compose.ui.semantics.contentDescription -import androidx.compose.ui.semantics.semantics import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.paging.compose.collectAsLazyPagingItems @@ -194,7 +192,6 @@ fun AlbumGridNavButton(modifier: Modifier) { val events = LocalEvents.current val sessionId = LocalPhotopickerConfiguration.current.sessionId val packageUid = LocalPhotopickerConfiguration.current.callingPackageUid ?: -1 - val contentDescriptionString = stringResource(R.string.photopicker_albums_nav_button_label) NavigationBarButton( onClick = { @@ -211,7 +208,7 @@ fun AlbumGridNavButton(modifier: Modifier) { } navController.navigateToAlbumGrid() }, - modifier = modifier.semantics { contentDescription = contentDescriptionString }, + modifier = modifier, isCurrentRoute = { route -> route == PhotopickerDestinations.ALBUM_GRID.route }, ) { Text(stringResource(R.string.photopicker_albums_nav_button_label)) diff --git a/photopicker/src/com/android/photopicker/features/categorygrid/CategoryGrid.kt b/photopicker/src/com/android/photopicker/features/categorygrid/CategoryGrid.kt index 4e8e427b7..0c3270ab5 100644 --- a/photopicker/src/com/android/photopicker/features/categorygrid/CategoryGrid.kt +++ b/photopicker/src/com/android/photopicker/features/categorygrid/CategoryGrid.kt @@ -39,7 +39,6 @@ import androidx.compose.ui.input.pointer.pointerInput import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.vectorResource import androidx.compose.ui.semantics.contentDescription -import androidx.compose.ui.semantics.semantics import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle @@ -216,7 +215,6 @@ fun CategoryButton(modifier: Modifier) { val events = LocalEvents.current val sessionId = LocalPhotopickerConfiguration.current.sessionId val packageUid = LocalPhotopickerConfiguration.current.callingPackageUid ?: -1 - val contentDescriptionString = stringResource(R.string.photopicker_categories_nav_button_label) val featureManager = LocalFeatureManager.current val searchFeatureEnabled = featureManager.isFeatureEnabled(SearchFeature::class.java) @@ -235,7 +233,7 @@ fun CategoryButton(modifier: Modifier) { } navController.navigateToCategoryGrid() }, - modifier = modifier.semantics { contentDescription = contentDescriptionString }, + modifier = modifier, isCurrentRoute = { route -> route == PhotopickerDestinations.ALBUM_GRID.route }, ) { when { @@ -244,7 +242,7 @@ fun CategoryButton(modifier: Modifier) { Icon( imageVector = ImageVector.vectorResource(R.drawable.photopicker_category_icon), - contentDescription = contentDescriptionString, + contentDescription = null, ) Spacer(Modifier.width(8.dp)) Text( diff --git a/photopicker/src/com/android/photopicker/features/photogrid/PhotoGrid.kt b/photopicker/src/com/android/photopicker/features/photogrid/PhotoGrid.kt index b2db34b0a..f5dfa8eec 100644 --- a/photopicker/src/com/android/photopicker/features/photogrid/PhotoGrid.kt +++ b/photopicker/src/com/android/photopicker/features/photogrid/PhotoGrid.kt @@ -48,7 +48,6 @@ import androidx.compose.ui.input.pointer.pointerInput import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.res.stringResource import androidx.compose.ui.semantics.contentDescription -import androidx.compose.ui.semantics.semantics import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle @@ -361,7 +360,6 @@ fun PhotoGridNavButton(modifier: Modifier) { val scope = rememberCoroutineScope() val events = LocalEvents.current val configuration = LocalPhotopickerConfiguration.current - val contentDescriptionString = stringResource(R.string.photopicker_photos_nav_button_label) val featureManager = LocalFeatureManager.current val categoryFeatureEnabled = featureManager.isFeatureEnabled(CategoryGridFeature::class.java) val searchFeatureEnabled = featureManager.isFeatureEnabled(SearchFeature::class.java) @@ -381,17 +379,13 @@ fun PhotoGridNavButton(modifier: Modifier) { } navController.navigateToPhotoGrid() }, - modifier = modifier.semantics { contentDescription = contentDescriptionString }, + modifier = modifier, isCurrentRoute = { route -> route == PHOTO_GRID.route }, ) { when { categoryFeatureEnabled && searchFeatureEnabled -> { Row(verticalAlignment = Alignment.CenterVertically) { - Icon( - imageVector = Icons.Outlined.PhotoAlbum, - contentDescription = - stringResource(R.string.photopicker_photos_nav_button_label), - ) + Icon(imageVector = Icons.Outlined.PhotoAlbum, contentDescription = null) Spacer(Modifier.width(8.dp)) Text( stringResource(R.string.photopicker_photos_nav_button_label), |