Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b8c5103d authored by Evan Laird's avatar Evan Laird
Browse files

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
parent 445d7b38
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -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