From a2454ad2d8dcffa94f670853eb464726c73597f1 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Fri, 22 Jul 2016 10:50:11 -0700 Subject: [PATCH] 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 --- res/layout/deep_shortcut.xml | 14 +- res/layout/deep_shortcuts_container.xml | 1 + res/values/config.xml | 7 +- res/values/styles.xml | 3 +- src/com/android/launcher3/Launcher.java | 20 +- src/com/android/launcher3/Workspace.java | 33 +-- .../android/launcher3/dragndrop/DragView.java | 42 +++- .../graphics/DragPreviewProvider.java | 17 +- .../shortcuts/DeepShortcutTextView.java | 6 +- .../launcher3/shortcuts/DeepShortcutView.java | 143 ++++++++---- .../shortcuts/DeepShortcutsContainer.java | 207 +++++++++++++++--- .../ShortcutDragPreviewProvider.java} | 68 +++--- .../util/PillRevealOutlineProvider.java | 8 +- .../util/PillWidthRevealOutlineProvider.java | 41 ++++ .../util/RevealOutlineAnimation.java | 9 +- 15 files changed, 456 insertions(+), 163 deletions(-) rename src/com/android/launcher3/{graphics/ScaledPreviewProvider.java => shortcuts/ShortcutDragPreviewProvider.java} (52%) create mode 100644 src/com/android/launcher3/util/PillWidthRevealOutlineProvider.java diff --git a/res/layout/deep_shortcut.xml b/res/layout/deep_shortcut.xml index 4fcbbd2066..2d66d728f5 100644 --- a/res/layout/deep_shortcut.xml +++ b/res/layout/deep_shortcut.xml @@ -21,8 +21,18 @@ android:elevation="@dimen/deep_shortcuts_elevation" android:background="@drawable/bg_white_pill"> - + android:layout_width="match_parent" + android:layout_height="match_parent" + android:focusable="true" /> + + + diff --git a/res/layout/deep_shortcuts_container.xml b/res/layout/deep_shortcuts_container.xml index 0441995f1c..92e7a83f3d 100644 --- a/res/layout/deep_shortcuts_container.xml +++ b/res/layout/deep_shortcuts_container.xml @@ -19,6 +19,7 @@ android:id="@+id/deep_shortcuts_container" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:clipChildren="false" android:elevation="@dimen/deep_shortcuts_elevation" android:orientation="vertical"> diff --git a/res/values/config.xml b/res/values/config.xml index 943804278e..94f02f9420 100644 --- a/res/values/config.xml +++ b/res/values/config.xml @@ -88,9 +88,10 @@ - 300 - 20 - 120 + 220 + 40 + 150 + 20 diff --git a/res/values/styles.xml b/res/values/styles.xml index a647cf2594..4c0230ac5b 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -80,8 +80,9 @@