Allow icon add animations when user touches the screen.
Fixes: 199483081
Test: manual, repeatedly tapped screen until and while app icon was added, repeatedly changed pages until and while app icon was added
Change-Id: I286b52527dfe6e5bfdfedbbbf1eed72061fb5599
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index ed9f044..b886bba 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -2273,7 +2273,7 @@
final boolean focusFirstItemForAccessibility) {
// Get the list of added items and intersect them with the set of items here
final Collection<Animator> bounceAnims = new ArrayList<>();
- final boolean animateIcons = forceAnimateIcons && canRunNewAppsAnimation();
+ boolean canAnimatePageChange = canAnimatePageChange();
Workspace workspace = mWorkspace;
int newItemsScreenId = -1;
int end = items.size();
@@ -2334,7 +2334,7 @@
}
}
workspace.addInScreenFromBind(view, item);
- if (animateIcons) {
+ if (forceAnimateIcons) {
// Animate all the applications up now
view.setAlpha(0f);
view.setScaleX(0f);
@@ -2350,7 +2350,7 @@
View viewToFocus = newView;
// Animate to the correct pager
- if (animateIcons && newItemsScreenId > -1) {
+ if (forceAnimateIcons && newItemsScreenId > -1) {
AnimatorSet anim = new AnimatorSet();
anim.playTogether(bounceAnims);
if (focusFirstItemForAccessibility && viewToFocus != null) {
@@ -2366,7 +2366,7 @@
final int newScreenIndex = mWorkspace.getPageIndexForScreenId(newItemsScreenId);
final Runnable startBounceAnimRunnable = anim::start;
- if (newItemsScreenId != currentScreenId) {
+ if (canAnimatePageChange && newItemsScreenId != currentScreenId) {
// We post the animation slightly delayed to prevent slowdowns
// when we are loading right after we return to launcher.
mWorkspace.postDelayed(new Runnable() {
@@ -2642,7 +2642,7 @@
TraceHelper.INSTANCE.endSection(traceToken);
}
- private boolean canRunNewAppsAnimation() {
+ private boolean canAnimatePageChange() {
if (mDragController.isDragging()) {
return false;
} else {