diff --git a/modules/features/player/src/main/java/au/com/shiftyjelly/pocketcasts/player/view/PlayerHeaderFragment.kt b/modules/features/player/src/main/java/au/com/shiftyjelly/pocketcasts/player/view/PlayerHeaderFragment.kt index 46e55fce989..f55d358812a 100644 --- a/modules/features/player/src/main/java/au/com/shiftyjelly/pocketcasts/player/view/PlayerHeaderFragment.kt +++ b/modules/features/player/src/main/java/au/com/shiftyjelly/pocketcasts/player/view/PlayerHeaderFragment.kt @@ -376,6 +376,7 @@ class PlayerHeaderFragment : BaseFragment(), PlayerClickListener { } private fun AdapterPlayerHeaderBinding.openTranscript() { + updatePlayerViewsAccessibility(enable = false) playerGroup.layoutTransition = LayoutTransition() transcriptPage.isVisible = true shelf.isVisible = false @@ -393,6 +394,7 @@ class PlayerHeaderFragment : BaseFragment(), PlayerClickListener { private fun AdapterPlayerHeaderBinding.closeTranscript( withTransition: Boolean, ) { + updatePlayerViewsAccessibility(enable = true) playerGroup.layoutTransition = if (withTransition) LayoutTransition() else null shelf.isVisible = true transcriptPage.isVisible = false @@ -408,6 +410,16 @@ class PlayerHeaderFragment : BaseFragment(), PlayerClickListener { playerGroup.layoutTransition = null // Reset to null to avoid animation when changing children visibility anytime later } + private fun AdapterPlayerHeaderBinding.updatePlayerViewsAccessibility(enable: Boolean) { + val importantForAccessibility = if (enable) View.IMPORTANT_FOR_ACCESSIBILITY_YES else View.IMPORTANT_FOR_ACCESSIBILITY_NO + episodeTitle.importantForAccessibility = importantForAccessibility + chapterTimeRemaining.importantForAccessibility = importantForAccessibility + chapterSummary.importantForAccessibility = importantForAccessibility + nextChapter.importantForAccessibility = importantForAccessibility + previousChapter.importantForAccessibility = importantForAccessibility + podcastTitle.importantForAccessibility = importantForAccessibility + } + private fun setupUpNextDrag(binding: AdapterPlayerHeaderBinding) { val flingGestureDetector = GestureDetectorCompat( requireContext(), diff --git a/modules/features/player/src/main/java/au/com/shiftyjelly/pocketcasts/player/view/transcripts/TranscriptPageWrapper.kt b/modules/features/player/src/main/java/au/com/shiftyjelly/pocketcasts/player/view/transcripts/TranscriptPageWrapper.kt index 97785fe3414..8e36a1daf03 100644 --- a/modules/features/player/src/main/java/au/com/shiftyjelly/pocketcasts/player/view/transcripts/TranscriptPageWrapper.kt +++ b/modules/features/player/src/main/java/au/com/shiftyjelly/pocketcasts/player/view/transcripts/TranscriptPageWrapper.kt @@ -174,6 +174,11 @@ fun TranscriptToolbar( .padding(start = 16.dp), onClick = onCloseClick, tintColor = TranscriptColors.iconColor(), + contentDescription = if (expandSearch) { + stringResource(LR.string.transcript_search_close) + } else { + stringResource(LR.string.transcript_close) + }, ) } @@ -191,7 +196,7 @@ fun TranscriptToolbar( ) { Icon( imageVector = Icons.Default.Search, - contentDescription = stringResource(LR.string.search), + contentDescription = stringResource(LR.string.transcript_search), tint = Color.White, ) } diff --git a/modules/features/player/src/main/res/layout/adapter_player_header.xml b/modules/features/player/src/main/res/layout/adapter_player_header.xml index 62132a695a9..466fb4fab66 100644 --- a/modules/features/player/src/main/res/layout/adapter_player_header.xml +++ b/modules/features/player/src/main/res/layout/adapter_player_header.xml @@ -4,6 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" + android:importantForAccessibility="no" android:fillViewport="true"> + android:layout_height="match_parent" + android:importantForAccessibility="no"> diff --git a/modules/services/compose/src/main/java/au/com/shiftyjelly/pocketcasts/compose/buttons/CloseButton.kt b/modules/services/compose/src/main/java/au/com/shiftyjelly/pocketcasts/compose/buttons/CloseButton.kt index 7219a82f384..e2146448c23 100644 --- a/modules/services/compose/src/main/java/au/com/shiftyjelly/pocketcasts/compose/buttons/CloseButton.kt +++ b/modules/services/compose/src/main/java/au/com/shiftyjelly/pocketcasts/compose/buttons/CloseButton.kt @@ -17,13 +17,14 @@ fun CloseButton( onClick: () -> Unit, modifier: Modifier = Modifier, tintColor: Color = Color.White, + contentDescription: String = stringResource(NavigationButton.Close.contentDescription), ) = IconButton( onClick = onClick, modifier = modifier, ) { Icon( imageVector = NavigationButton.Close.image, - contentDescription = stringResource(NavigationButton.Close.contentDescription), + contentDescription = contentDescription, tint = tintColor, ) } diff --git a/modules/services/localization/src/main/res/values/strings.xml b/modules/services/localization/src/main/res/values/strings.xml index 1cc4e91fd2a..db62e5af4f5 100644 --- a/modules/services/localization/src/main/res/values/strings.xml +++ b/modules/services/localization/src/main/res/values/strings.xml @@ -1901,6 +1901,9 @@ up Sleeping in 1 chapter Sorry, but this transcript format is not supported: %s Sorry, but something went wrong while parsing this transcript. Transcript is empty. + Close transcript + Search transcript + Close search