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

Commit 490a8ab7 authored by Tony Wickham's avatar Tony Wickham
Browse files

Add all apps education bounce animation

- Update existing arrow bounce animation to repeat 3 times,
  and play it when swiping up from nav bar on first home
  screen as well as when tapping the arrow.

Bug: 151768994
Change-Id: Ib120764fdeab6cd932018b6fed8b1093dda20641
parent 5edf9e29
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -42,7 +42,6 @@ import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Hotseat;
import com.android.launcher3.LauncherState;
import com.android.launcher3.LauncherStateManager.StateListener;
import com.android.launcher3.R;
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.appprediction.PredictionUiStateManager;
import com.android.launcher3.appprediction.PredictionUiStateManager.Client;
@@ -172,7 +171,7 @@ public class LauncherRecentsView extends RecentsView<BaseQuickstepLauncher>
                mActivity.getAllAppsController(), ALL_APPS_PROGRESS, allAppsProgressOffscreen));

        ObjectAnimator dragHandleAnim = ObjectAnimator.ofInt(
                mActivity.findViewById(R.id.scrim_view), ScrimView.DRAG_HANDLE_ALPHA, 0);
                mActivity.getScrimView(), ScrimView.DRAG_HANDLE_ALPHA, 0);
        dragHandleAnim.setInterpolator(Interpolators.ACCEL_2);
        anim.play(dragHandleAnim);

+5 −1
Original line number Diff line number Diff line
@@ -1193,7 +1193,7 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
        // Setup the drag controller (drop targets have to be added in reverse order in priority)
        mDropTargetBar.setup(mDragController);

        mAllAppsController.setupViews(mAppsView);
        mAllAppsController.setupViews(mAppsView, mScrimView);
    }

    /**
@@ -1415,6 +1415,10 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
        return mDropTargetBar;
    }

    public ScrimView getScrimView() {
        return mScrimView;
    }

    public LauncherAppWidgetHost getAppWidgetHost() {
        return mAppWidgetHost;
    }
+1 −1
Original line number Diff line number Diff line
@@ -125,7 +125,7 @@ public class Workspace extends PagedView<WorkspacePageIndicator>

    private static final int ADJACENT_SCREEN_DROP_DURATION = 300;

    private static final int DEFAULT_PAGE = 0;
    public static final int DEFAULT_PAGE = 0;

    private LayoutTransition mLayoutTransition;
    @Thunk final WallpaperManager mWallpaperManager;
+2 −2
Original line number Diff line number Diff line
@@ -212,9 +212,9 @@ public class AllAppsTransitionController implements StateHandler, OnDeviceProfil
        return AnimationSuccessListener.forRunnable(this::onProgressAnimationEnd);
    }

    public void setupViews(AllAppsContainerView appsView) {
    public void setupViews(AllAppsContainerView appsView, ScrimView scrimView) {
        mAppsView = appsView;
        mScrimView = mLauncher.findViewById(R.id.scrim_view);
        mScrimView = scrimView;
    }

    /**
+8 −2
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ package com.android.launcher3.states;

import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.LauncherStateManager;
import com.android.launcher3.Workspace;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;

@@ -50,8 +51,13 @@ public class HintState extends LauncherState {

    @Override
    public void onStateTransitionEnd(Launcher launcher) {
        launcher.getStateManager().goToState(NORMAL);
        LauncherStateManager stateManager = launcher.getStateManager();
        Workspace workspace = launcher.getWorkspace();
        boolean willMoveScreens = workspace.getNextPage() != Workspace.DEFAULT_PAGE;
        stateManager.goToState(NORMAL, true, willMoveScreens ? null
                : launcher.getScrimView()::startDragHandleEducationAnim);
        if (willMoveScreens) {
            workspace.post(workspace::moveToDefaultScreen);
        }
    }
}
Loading