Enable accessibility of Clear All button.
The button appears in the accessibility hierarchy as a child of RecentsView. This makes both Talkback and Switch access to work with it normally. Bug: 80156299 Test: Manual Change-Id: Ife2044b2ef78fb27b32f2d33fb17744662a2b054
This commit is contained in:
1 parent
a845e1500c
commit
a3e48d8035
3 files changed
+51
-11
No files matched your search
@@ -16,13 +16,11 @@
|
||||
|
||||
package com.android.quickstep.views;
|
||||
|
||||
import static android.view.accessibility.AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.accessibility.AccessibilityNodeInfo;
|
||||
import android.widget.Button;
|
||||
|
||||
public class ClearAllButton extends Button {
|
||||
@@ -37,12 +35,9 @@ public class ClearAllButton extends Button {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean performAccessibilityAction(int action, Bundle arguments) {
|
||||
final boolean res = super.performAccessibilityAction(action, arguments);
|
||||
if (action == ACTION_ACCESSIBILITY_FOCUS) {
|
||||
mRecentsView.revealClearAllButton();
|
||||
}
|
||||
return res;
|
||||
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
|
||||
super.onInitializeAccessibilityNodeInfo(info);
|
||||
info.setParent(mRecentsView); // Pretend we are a part of the task carousel.
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user