From b8c5103d4c3ae8761ad7f15bb67b08732b416634 Mon Sep 17 00:00:00 2001 From: Evan Laird Date: Fri, 7 Jun 2019 14:55:59 -0400 Subject: [PATCH] Invalidate talkback accessibility tree after transitioning Using AutoTransition seems to allow the talkback accessibility nodes to stay out of sync if the user starts iterating the view during the transition. Calling `notifySubtreeAccessibilityStateChangedIfNeeded()` on the end of the transition gets us back into the correct state. Test: manual; start iterating view via talkback swiping while the channel dialog editor transitions between app notifications on/off Fixes: 133822221 Change-Id: I7218bc0734cf05372b8fbecfb6eeef69cb3f1d40 --- .../notification/row/ChannelEditorListView.kt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ChannelEditorListView.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ChannelEditorListView.kt index 6fe14777e41f7..6faf77ec60c7e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ChannelEditorListView.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ChannelEditorListView.kt @@ -24,6 +24,7 @@ import android.content.Context import android.graphics.drawable.Drawable import android.text.TextUtils import android.transition.AutoTransition +import android.transition.Transition import android.transition.TransitionManager import android.util.AttributeSet import android.view.LayoutInflater @@ -62,6 +63,23 @@ class ChannelEditorListView(c: Context, attrs: AttributeSet) : LinearLayout(c, a val transition = AutoTransition() transition.duration = 200 + transition.addListener(object : Transition.TransitionListener { + override fun onTransitionEnd(p0: Transition?) { + notifySubtreeAccessibilityStateChangedIfNeeded() + } + + override fun onTransitionResume(p0: Transition?) { + } + + override fun onTransitionPause(p0: Transition?) { + } + + override fun onTransitionCancel(p0: Transition?) { + } + + override fun onTransitionStart(p0: Transition?) { + } + }) TransitionManager.beginDelayedTransition(this, transition) // Remove any rows