Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a2454ad2 authored by Sunny Goyal's avatar Sunny Goyal
Browse files

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
parent 71538da6
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -24,5 +24,15 @@
<com.android.launcher3.shortcuts.DeepShortcutTextView
        android:id="@+id/deep_shortcut"
        style="@style/Icon.DeepShortcut"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:focusable="true" />

    <View
        android:id="@+id/deep_shortcut_icon"
        android:layout_width="@dimen/deep_shortcut_icon_size"
        android:layout_height="@dimen/deep_shortcut_icon_size"
        android:layout_margin="@dimen/deep_shortcut_padding_start"
        android:layout_gravity="start" />

</com.android.launcher3.shortcuts.DeepShortcutView>
+1 −0
Original line number Diff line number Diff line
@@ -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">

+4 −3
Original line number Diff line number Diff line
@@ -88,9 +88,10 @@
    <item type="id" name="cell_layout_jail_id" />

<!-- Deep shortcuts -->
    <integer name="config_deepShortcutOpenDuration">300</integer>
    <integer name="config_deepShortcutOpenStagger">20</integer>
    <integer name="config_deepShortcutHoverDuration">120</integer>
    <integer name="config_deepShortcutOpenDuration">220</integer>
    <integer name="config_deepShortcutOpenStagger">40</integer>
    <integer name="config_deepShortcutCloseDuration">150</integer>
    <integer name="config_deepShortcutCloseStagger">20</integer>

<!-- Accessibility actions -->
    <item type="id" name="action_remove" />
+2 −1
Original line number Diff line number Diff line
@@ -80,8 +80,9 @@
    <style name="Icon.DeepShortcut">
        <item name="android:gravity">start|center_vertical</item>
        <item name="android:elevation">@dimen/deep_shortcuts_elevation</item>
        <item name="android:paddingStart">@dimen/deep_shortcut_padding_start</item>
        <item name="android:paddingStart">@dimen/bg_pill_height</item>
        <item name="android:paddingEnd">@dimen/deep_shortcut_padding_end</item>
        <item name="android:drawableEnd">@drawable/deep_shortcuts_drag_handle</item>
        <item name="android:drawablePadding">@dimen/deep_shortcut_drawable_padding</item>
        <item name="android:textColor">@color/quantum_panel_text_color</item>
        <item name="android:shadowRadius">0</item>
+13 −7
Original line number Diff line number Diff line
@@ -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;
            }
        }
Loading