summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Launcher.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2016-07-22 10:50:11 -0700
committerSunny Goyal <sunnygoyal@google.com>2016-07-27 17:37:23 -0700
commita2454ad2d8dcffa94f670853eb464726c73597f1 (patch)
tree63899483e75a7faadff477cb117bf5c5cfc54962 /src/com/android/launcher3/Launcher.java
parent71538da6e2e70af15684cc270a6e67c9b5a010dc (diff)
downloadandroid_packages_apps_Trebuchet-a2454ad2d8dcffa94f670853eb464726c73597f1.tar.gz
android_packages_apps_Trebuchet-a2454ad2d8dcffa94f670853eb464726c73597f1.tar.bz2
android_packages_apps_Trebuchet-a2454ad2d8dcffa94f670853eb464726c73597f1.zip
Launcher shortcuts animations update.
> The shortcut container closes with an animation > When opening/closing the animation only the icon scales and not the title and drag handle > When dragging the icon, it starts from the original icon position and moves under the user finger. The container grows to follow the drag view. Bug: 28980830 Change-Id: Ic0353c30b682d1f018cbf4d62e8a6e8e7d7d4664
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r--src/com/android/launcher3/Launcher.java20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 3f12abfd4..d668d2a74 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -1864,7 +1864,7 @@ public class Launcher extends Activity
mWorkspace.exitWidgetResizeMode();
closeFolder(alreadyOnHome);
- closeShortcutsContainer();
+ closeShortcutsContainer(alreadyOnHome);
exitSpringLoadedDragMode();
// If we are already on home, then just animate back to the workspace,
@@ -1951,8 +1951,7 @@ public class Launcher extends Activity
// this state is reflected.
// TODO: Move folderInfo.isOpened out of the model and make it a UI state.
closeFolder(false);
-
- closeShortcutsContainer();
+ closeShortcutsContainer(false);
if (mPendingAddInfo.container != ItemInfo.NO_ID && mPendingAddInfo.screenId > -1 &&
mWaitingForResult) {
@@ -3130,11 +3129,17 @@ public class Launcher extends Activity
}
public void closeShortcutsContainer() {
+ closeShortcutsContainer(true);
+ }
+
+ public void closeShortcutsContainer(boolean animate) {
DeepShortcutsContainer deepShortcutsContainer = getOpenShortcutsContainer();
if (deepShortcutsContainer != null) {
- deepShortcutsContainer.cleanupDeferredDrag(true);
- mDragController.removeDragListener(deepShortcutsContainer);
- mDragLayer.removeView(deepShortcutsContainer);
+ if (animate) {
+ deepShortcutsContainer.animateClose();
+ } else {
+ deepShortcutsContainer.close();
+ }
}
}
@@ -3146,7 +3151,8 @@ public class Launcher extends Activity
// and will be one of the last views.
for (int i = mDragLayer.getChildCount() - 1; i >= 0; i--) {
View child = mDragLayer.getChildAt(i);
- if (child instanceof DeepShortcutsContainer) {
+ if (child instanceof DeepShortcutsContainer
+ && ((DeepShortcutsContainer) child).isOpen()) {
return (DeepShortcutsContainer) child;
}
}