c4ad03b9ef
Split LauncherAppTransitionManagerImpl common functionality into a base quickstep app transition class and subclass for recents-specific implementation. In addition, override the app transition manager to the appropriate manager depending on the build. Bug: 114136250 Test: Manual test NexusLauncher, Launcher3GoWithQuickstep Test: Build Launcher3GoIconRecents Change-Id: Iab1b5ae0c75af276879d5e12df95f62a514bf571
66 lines
2.2 KiB
Java
66 lines
2.2 KiB
Java
package com.android.launcher3;
|
|
|
|
import static com.android.launcher3.anim.Interpolators.AGGRESSIVE_EASE;
|
|
import static com.android.launcher3.anim.Interpolators.LINEAR;
|
|
import static com.android.quickstep.views.IconRecentsView.CONTENT_ALPHA;
|
|
|
|
import android.animation.AnimatorSet;
|
|
import android.animation.ObjectAnimator;
|
|
import android.app.ActivityOptions;
|
|
import android.content.Context;
|
|
import android.view.View;
|
|
|
|
import com.android.quickstep.views.IconRecentsView;
|
|
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
|
|
|
|
/**
|
|
* A {@link QuickstepAppTransitionManagerImpl} with recents-specific app transitions based off
|
|
* {@link com.android.quickstep.views.IconRecentsView}.
|
|
*/
|
|
public final class GoLauncherAppTransitionManagerImpl extends QuickstepAppTransitionManagerImpl {
|
|
|
|
public GoLauncherAppTransitionManagerImpl(Context context) {
|
|
super(context);
|
|
}
|
|
|
|
@Override
|
|
protected boolean isLaunchingFromRecents(View v, RemoteAnimationTargetCompat[] targets) {
|
|
return mLauncher.getStateManager().getState().overviewUi;
|
|
}
|
|
|
|
@Override
|
|
protected boolean isQuickSwitchInProgress() {
|
|
// Go does not support quick scrub.
|
|
return false;
|
|
}
|
|
|
|
@Override
|
|
protected ActivityOptions getQuickSwitchActivityOptions() {
|
|
// Go does not support quick scrub.
|
|
return null;
|
|
}
|
|
|
|
@Override
|
|
protected void composeRecentsLaunchAnimator(AnimatorSet anim, View v,
|
|
RemoteAnimationTargetCompat[] targets, boolean launcherClosing) {
|
|
//TODO: Implement this based off IconRecentsView
|
|
}
|
|
|
|
@Override
|
|
protected Runnable composeViewContentAnimator(AnimatorSet anim, float[] alphas, float[] trans) {
|
|
IconRecentsView overview = mLauncher.getOverviewPanel();
|
|
ObjectAnimator alpha = ObjectAnimator.ofFloat(overview,
|
|
CONTENT_ALPHA, alphas);
|
|
alpha.setDuration(CONTENT_ALPHA_DURATION);
|
|
alpha.setInterpolator(LINEAR);
|
|
anim.play(alpha);
|
|
|
|
ObjectAnimator transY = ObjectAnimator.ofFloat(overview, View.TRANSLATION_Y, trans);
|
|
transY.setInterpolator(AGGRESSIVE_EASE);
|
|
transY.setDuration(CONTENT_TRANSLATION_DURATION);
|
|
anim.play(transY);
|
|
|
|
return mLauncher.getStateManager()::reapplyState;
|
|
}
|
|
}
|