diff options
Diffstat (limited to 'src/com/android/launcher3/folder')
-rw-r--r-- | src/com/android/launcher3/folder/Folder.java | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java index 99c800d14..b49952f15 100644 --- a/src/com/android/launcher3/folder/Folder.java +++ b/src/com/android/launcher3/folder/Folder.java @@ -31,6 +31,7 @@ import android.text.InputType; import android.text.Selection; import android.util.AttributeSet; import android.util.Log; +import android.util.Pair; import android.view.ActionMode; import android.view.FocusFinder; import android.view.KeyEvent; @@ -516,15 +517,11 @@ public class Folder extends AbstractFloatingView implements DragSource, public void onAnimationStart(Animator animation) { mFolderIcon.setBackgroundVisible(false); mFolderIcon.drawLeaveBehindIfExists(); - - sendCustomAccessibilityEvent( - Folder.this, - AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED, - mContent.getAccessibilityDescription()); } @Override public void onAnimationEnd(Animator animation) { mState = STATE_OPEN; + announceAccessibilityChanges(); mLauncher.getUserEventDispatcher().resetElapsedContainerMillis("folder opened"); mContent.setFocusOnFirstChild(); @@ -574,11 +571,6 @@ public class Folder extends AbstractFloatingView implements DragSource, } mContent.verifyVisibleHighResIcons(mContent.getNextPage()); - - // Notify the accessibility manager that this folder "window" has appeared and occluded - // the workspace items - sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED); - dragLayer.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED); } public void beginExternalDrag() { @@ -612,6 +604,7 @@ public class Folder extends AbstractFloatingView implements DragSource, animateClosed(); } else { closeComplete(false); + post(this::announceAccessibilityChanges); } // Notify the accessibility manager that this folder "window" has disappeared and no @@ -626,18 +619,18 @@ public class Folder extends AbstractFloatingView implements DragSource, @Override public void onAnimationEnd(Animator animation) { closeComplete(true); - } - @Override - public void onAnimationStart(Animator animation) { - sendCustomAccessibilityEvent( - Folder.this, - AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED, - getContext().getString(R.string.folder_closed)); + announceAccessibilityChanges(); } }); startAnimation(a); } + @Override + protected Pair<View, String> getAccessibilityTarget() { + return Pair.create(mContent, mIsOpen ? mContent.getAccessibilityDescription() + : getContext().getString(R.string.folder_closed)); + } + private void closeComplete(boolean wasAnimated) { // TODO: Clear all active animations. DragLayer parent = (DragLayer) getParent(); |