From 8d9ed68cdb1d9211a0f836a60099aaacc79be737 Mon Sep 17 00:00:00 2001 From: Michael Mikhail Date: Fri, 20 Jan 2023 18:42:53 +0000 Subject: [Media TTT] Fix a11y focus on receiver icon Talkback annonces the content description of the icon. View doesn't get the focus so any icon overlapping with the view can be able to get the focus. Fixes: 265616840 Test: Checked UI using adb command adb shell cmd statusbar media-ttt-chip-receiver CLOSE_TO_SENDER useAppIcon=true. Change-Id: I46db3839e9384ee88cdfe3e0de2bea5d8e384429 --- .../media/taptotransfer/receiver/MediaTttChipControllerReceiver.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/SystemUI/src') diff --git a/packages/SystemUI/src/com/android/systemui/media/taptotransfer/receiver/MediaTttChipControllerReceiver.kt b/packages/SystemUI/src/com/android/systemui/media/taptotransfer/receiver/MediaTttChipControllerReceiver.kt index 6884370c505c..60dd5dab7538 100644 --- a/packages/SystemUI/src/com/android/systemui/media/taptotransfer/receiver/MediaTttChipControllerReceiver.kt +++ b/packages/SystemUI/src/com/android/systemui/media/taptotransfer/receiver/MediaTttChipControllerReceiver.kt @@ -30,6 +30,7 @@ import android.view.View import android.view.ViewGroup import android.view.WindowManager import android.view.accessibility.AccessibilityManager +import android.view.View.ACCESSIBILITY_LIVE_REGION_ASSERTIVE import com.android.internal.widget.CachingIconView import com.android.systemui.R import com.android.systemui.common.shared.model.ContentDescription @@ -198,6 +199,7 @@ open class MediaTttChipControllerReceiver @Inject constructor( val iconView = currentView.getAppIconView() iconView.setPadding(iconPadding, iconPadding, iconPadding, iconPadding) + iconView.accessibilityLiveRegion = ACCESSIBILITY_LIVE_REGION_ASSERTIVE TintedIconViewBinder.bind(iconInfo.toTintedIcon(), iconView) } @@ -207,8 +209,6 @@ open class MediaTttChipControllerReceiver @Inject constructor( val rippleView: ReceiverChipRippleView = view.requireViewById(R.id.ripple) animateViewTranslationAndFade(appIconView, -1 * getTranslationAmount(), 1f) animateViewTranslationAndFade(iconRippleView, -1 * getTranslationAmount(), 1f) - // Using withEndAction{} doesn't apply a11y focus when screen is unlocked. - appIconView.postOnAnimation { view.requestAccessibilityFocus() } rippleController.expandToInProgressState(rippleView, iconRippleView) } -- cgit v1.2.3-59-g8ed1b