diff options
| author | 2024-12-23 16:28:19 +0000 | |
|---|---|---|
| committer | 2024-12-23 08:57:33 -0800 | |
| commit | 3d8de9ce553f7e30b3e611c05b231bbf0c13351e (patch) | |
| tree | bc0a308e842887842e1e4556d4d23546bc9713b1 | |
| parent | ff05aae2126887e08e69826352f11a9d23c7b2f9 (diff) | |
A11y - Focus on customize lock screen button
When activated. Talkback makes it clear to the user that
long-pressing on the lockscreen should activate the customize
lock screen button. Set focus to this element.
Fixes: 318028938
Test: manual - use talkback to activate customize lock screen
Flag: EXEMPT bugfix
Change-Id: I4b3e09127b66889bf62b55beee157aa8f14b03c0
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardSettingsViewBinder.kt | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardSettingsViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardSettingsViewBinder.kt index 79360370d937..13c2ffb70220 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardSettingsViewBinder.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardSettingsViewBinder.kt @@ -19,6 +19,8 @@ package com.android.systemui.keyguard.ui.binder import android.graphics.Rect import android.view.View +import android.view.accessibility.AccessibilityEvent.TYPE_VIEW_FOCUSED +import android.widget.TextView import androidx.core.view.isVisible import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle @@ -47,7 +49,7 @@ object KeyguardSettingsViewBinder { touchHandlingViewModel: KeyguardTouchHandlingViewModel, rootViewModel: KeyguardRootViewModel?, vibratorHelper: VibratorHelper, - activityStarter: ActivityStarter + activityStarter: ActivityStarter, ): DisposableHandle { val disposableHandle = view.repeatWhenAttached { @@ -57,19 +59,16 @@ object KeyguardSettingsViewBinder { view.animateVisibility(visible = isVisible) if (isVisible) { vibratorHelper.vibrate(KeyguardBottomAreaVibrations.Activated) + val textView = view.requireViewById(R.id.text) as TextView view.setOnTouchListener( - KeyguardSettingsButtonOnTouchListener( - viewModel = viewModel, - ) + KeyguardSettingsButtonOnTouchListener(viewModel = viewModel) ) IconViewBinder.bind( icon = viewModel.icon, view = view.requireViewById(R.id.icon), ) - TextViewBinder.bind( - view = view.requireViewById(R.id.text), - viewModel = viewModel.text, - ) + TextViewBinder.bind(view = textView, viewModel = viewModel.text) + textView.sendAccessibilityEvent(TYPE_VIEW_FOCUSED) } } } @@ -108,15 +107,12 @@ object KeyguardSettingsViewBinder { } /** Opens the wallpaper picker screen after the device is unlocked by the user. */ - private fun navigateToLockScreenSettings( - activityStarter: ActivityStarter, - view: View, - ) { + private fun navigateToLockScreenSettings(activityStarter: ActivityStarter, view: View) { activityStarter.postStartActivityDismissingKeyguard( WallpaperPickerIntentUtils.getIntent(view.context, LAUNCH_SOURCE_KEYGUARD), /* delay= */ 0, /* animationController= */ ActivityTransitionAnimator.Controller.fromView(view), - /* customMessage= */ view.context.getString(R.string.keyguard_unlock_to_customize_ls) + /* customMessage= */ view.context.getString(R.string.keyguard_unlock_to_customize_ls), ) } |