am 5a030078: Merge "Fixing issue where accessibility was reporting items behind an open folder. (Bug 8331717)" into jb-mr2-dev

* commit '5a0300783cef1216f5d13dcbe98ef44f8cc78fc7':
  Fixing issue where accessibility was reporting items behind an open folder. (Bug 8331717)
This commit is contained in:
Winson Chung
2013-04-16 10:17:54 -07:00
committed by Android Git Automerger
2 changed files with 35 additions and 0 deletions
+26
View File
@@ -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
+9
View File
@@ -2287,6 +2287,11 @@ public final class Launcher extends Activity
}
folder.animateOpen();
growAndFadeOutFolderIcon(folderIcon);
// Notify the accessibility manager that this folder "window" has appeared and occluded
// the workspace items
folder.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
getDragLayer().sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
}
public void closeFolder() {
@@ -2311,6 +2316,10 @@ public final class Launcher extends Activity
shrinkAndFadeInFolderIcon(fi);
}
folder.animateClosed();
// Notify the accessibility manager that this folder "window" has disappeard and no
// longer occludeds the workspace items
getDragLayer().sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
}
public boolean onLongClick(View v) {