Fixing issue where accessibility was reporting items behind an open folder. (Bug 8331717)
Change-Id: Ibaec4144ee911c6d784737cf56a4fc8a1dad2886
This commit is contained in:
@@ -34,6 +34,7 @@ import android.view.ViewGroup;
|
||||
import android.view.ViewParent;
|
||||
import android.view.accessibility.AccessibilityEvent;
|
||||
import android.view.accessibility.AccessibilityManager;
|
||||
import android.view.accessibility.AccessibilityNodeInfo;
|
||||
import android.view.animation.DecelerateInterpolator;
|
||||
import android.view.animation.Interpolator;
|
||||
import android.widget.FrameLayout;
|
||||
@@ -221,6 +222,31 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onRequestSendAccessibilityEvent(View child, AccessibilityEvent event) {
|
||||
Folder currentFolder = mLauncher.getWorkspace().getOpenFolder();
|
||||
if (currentFolder != null) {
|
||||
if (child == currentFolder) {
|
||||
return super.onRequestSendAccessibilityEvent(child, event);
|
||||
}
|
||||
// Skip propagating onRequestSendAccessibilityEvent all for other children
|
||||
// when a folder is open
|
||||
return false;
|
||||
}
|
||||
return super.onRequestSendAccessibilityEvent(child, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addChildrenForAccessibility(ArrayList<View> childrenForAccessibility) {
|
||||
Folder currentFolder = mLauncher.getWorkspace().getOpenFolder();
|
||||
if (currentFolder != null) {
|
||||
// Only add the folder as a child for accessibility when it is open
|
||||
childrenForAccessibility.add(currentFolder);
|
||||
} else {
|
||||
super.addChildrenForAccessibility(childrenForAccessibility);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onHoverEvent(MotionEvent ev) {
|
||||
// If we've received this, we've already done the necessary handling
|
||||
|
||||
Reference in New Issue
Block a user