Skip to content

Commit 60fce03

Browse files
author
Hyunyoung Song
committed
Merging from ub-launcher3-qt-future-dev @ build 6048032
Test: manual, presubmit on the source branch http://x20/teams/android-launcher/merge/ub-launcher3-qt-future-dev_6048032.html Change-Id: I74059dbc75a8530884f8b4f67917b83c75f32d14 Merged-In: Ieee38cc301364f96cf252b2387142b0aa1b75317
2 parents 793f5c5 + 491bb69 commit 60fce03

23 files changed

+819
-178
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (C) 2019 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.android.quickstep.util;
17+
18+
import com.android.launcher3.Launcher;
19+
20+
/** Empty class, only exists so that l3goWithQuickstepIconRecentsDebug compiles. */
21+
public class ShelfPeekAnim {
22+
public ShelfPeekAnim(Launcher launcher) {
23+
}
24+
25+
public enum ShelfAnimState {
26+
}
27+
28+
public boolean isPeeking() {
29+
return false;
30+
}
31+
}

quickstep/recents_ui_overrides/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java

+26-1
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,15 @@
2121
import static com.android.launcher3.LauncherState.HOTSEAT_ICONS;
2222
import static com.android.launcher3.LauncherState.NORMAL;
2323
import static com.android.launcher3.LauncherState.OVERVIEW;
24+
import static com.android.launcher3.LauncherStateManager.ANIM_ALL;
25+
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_ALL_APPS_FADE;
26+
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_HOTSEAT_SCALE;
27+
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_HOTSEAT_TRANSLATE;
28+
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_VERTICAL_PROGRESS;
2429
import static com.android.launcher3.anim.Interpolators.AGGRESSIVE_EASE;
30+
import static com.android.launcher3.anim.Interpolators.DEACCEL_3;
2531
import static com.android.launcher3.anim.Interpolators.LINEAR;
32+
import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_2;
2633
import static com.android.quickstep.TaskViewUtils.findTaskViewToLaunch;
2734
import static com.android.quickstep.TaskViewUtils.getRecentsWindowAnimator;
2835

@@ -40,6 +47,7 @@
4047
import com.android.launcher3.LauncherState.ScaleAndTranslation;
4148
import com.android.launcher3.allapps.AllAppsTransitionController;
4249
import com.android.launcher3.anim.AnimatorPlaybackController;
50+
import com.android.launcher3.anim.AnimatorSetBuilder;
4351
import com.android.launcher3.anim.Interpolators;
4452
import com.android.launcher3.anim.SpringAnimationBuilder;
4553
import com.android.quickstep.util.ClipAnimationHelper;
@@ -56,6 +64,9 @@ public final class LauncherAppTransitionManagerImpl extends QuickstepAppTransiti
5664
public static final int INDEX_SHELF_ANIM = 0;
5765
public static final int INDEX_RECENTS_FADE_ANIM = 1;
5866
public static final int INDEX_RECENTS_TRANSLATE_X_ANIM = 2;
67+
public static final int INDEX_PAUSE_TO_OVERVIEW_ANIM = 3;
68+
69+
public static final long ATOMIC_DURATION_FROM_PAUSED_TO_OVERVIEW = 300;
5970

6071
public LauncherAppTransitionManagerImpl(Context context) {
6172
super(context);
@@ -144,7 +155,7 @@ protected Runnable composeViewContentAnimator(@NonNull AnimatorSet anim, float[]
144155

145156
@Override
146157
public int getStateElementAnimationsCount() {
147-
return 3;
158+
return 4;
148159
}
149160

150161
@Override
@@ -190,6 +201,20 @@ public Animator createStateElementAnimation(int index, float... values) {
190201
.setStiffness(250)
191202
.setValues(values)
192203
.build(mLauncher);
204+
case INDEX_PAUSE_TO_OVERVIEW_ANIM: {
205+
AnimatorSetBuilder builder = new AnimatorSetBuilder();
206+
builder.setInterpolator(ANIM_VERTICAL_PROGRESS, OVERSHOOT_1_2);
207+
builder.setInterpolator(ANIM_ALL_APPS_FADE, DEACCEL_3);
208+
if ((OVERVIEW.getVisibleElements(mLauncher) & HOTSEAT_ICONS) != 0) {
209+
builder.setInterpolator(ANIM_HOTSEAT_SCALE, OVERSHOOT_1_2);
210+
builder.setInterpolator(ANIM_HOTSEAT_TRANSLATE, OVERSHOOT_1_2);
211+
}
212+
LauncherStateManager stateManager = mLauncher.getStateManager();
213+
return stateManager.createAtomicAnimation(
214+
stateManager.getCurrentStableState(), OVERVIEW, builder,
215+
ANIM_ALL, ATOMIC_DURATION_FROM_PAUSED_TO_OVERVIEW);
216+
}
217+
193218
default:
194219
return super.createStateElementAnimation(index, values);
195220
}

quickstep/recents_ui_overrides/src/com/android/launcher3/appprediction/PredictionRowView.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ private void applyPredictionApps() {
276276
boolean predictionsEnabled = predictionCount > 0;
277277
if (predictionsEnabled != mPredictionsEnabled) {
278278
mPredictionsEnabled = predictionsEnabled;
279-
mLauncher.reapplyUi();
279+
mLauncher.reapplyUi(false /* cancelCurrentAnimation */);
280280
updateVisibility();
281281
}
282282
mParent.onHeightUpdated();

quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsUiFactory.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@
2828
import com.android.launcher3.Launcher;
2929
import com.android.launcher3.LauncherState;
3030
import com.android.launcher3.LauncherStateManager.StateHandler;
31-
import com.android.launcher3.Utilities;
3231
import com.android.launcher3.anim.AnimatorPlaybackController;
3332
import com.android.launcher3.config.FeatureFlags;
3433
import com.android.launcher3.graphics.RotationMode;
3534
import com.android.launcher3.uioverrides.touchcontrollers.FlingAndHoldTouchController;
3635
import com.android.launcher3.uioverrides.touchcontrollers.LandscapeEdgeSwipeController;
3736
import com.android.launcher3.uioverrides.touchcontrollers.NavBarToHomeTouchController;
37+
import com.android.launcher3.uioverrides.touchcontrollers.NoButtonQuickSwitchTouchController;
3838
import com.android.launcher3.uioverrides.touchcontrollers.OverviewToAllAppsTouchController;
3939
import com.android.launcher3.uioverrides.touchcontrollers.PortraitStatesTouchController;
40-
import com.android.launcher3.uioverrides.touchcontrollers.StatusBarTouchController;
4140
import com.android.launcher3.uioverrides.touchcontrollers.QuickSwitchTouchController;
41+
import com.android.launcher3.uioverrides.touchcontrollers.StatusBarTouchController;
4242
import com.android.launcher3.uioverrides.touchcontrollers.TaskViewTouchController;
4343
import com.android.launcher3.uioverrides.touchcontrollers.TransposedQuickSwitchTouchController;
4444
import com.android.launcher3.util.TouchController;
@@ -145,7 +145,7 @@ public static TouchController[] createTouchControllers(Launcher launcher) {
145145
ArrayList<TouchController> list = new ArrayList<>();
146146
list.add(launcher.getDragController());
147147
if (mode == NO_BUTTON) {
148-
list.add(new QuickSwitchTouchController(launcher));
148+
list.add(new NoButtonQuickSwitchTouchController(launcher));
149149
list.add(new NavBarToHomeTouchController(launcher));
150150
list.add(new FlingAndHoldTouchController(launcher));
151151
} else {

quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/OverviewState.java

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_FADE;
2323
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_SCALE;
2424
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_TRANSLATE_X;
25+
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_TRANSLATE_Y;
2526
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_FADE;
2627
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_SCALE;
2728
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_TRANSLATE;
@@ -205,6 +206,7 @@ public void prepareForAtomicAnimation(Launcher launcher, LauncherState fromState
205206
builder.setInterpolator(ANIM_WORKSPACE_FADE, OVERSHOOT_1_2);
206207
builder.setInterpolator(ANIM_OVERVIEW_SCALE, OVERSHOOT_1_2);
207208
builder.setInterpolator(ANIM_OVERVIEW_TRANSLATE_X, OVERSHOOT_1_7);
209+
builder.setInterpolator(ANIM_OVERVIEW_TRANSLATE_Y, OVERSHOOT_1_7);
208210
builder.setInterpolator(ANIM_OVERVIEW_FADE, OVERSHOOT_1_2);
209211
}
210212
}

quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/FlingAndHoldTouchController.java

+5-16
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,20 @@
1616

1717
package com.android.launcher3.uioverrides.touchcontrollers;
1818

19+
import static com.android.launcher3.LauncherAppTransitionManagerImpl.INDEX_PAUSE_TO_OVERVIEW_ANIM;
1920
import static com.android.launcher3.LauncherState.ALL_APPS;
20-
import static com.android.launcher3.LauncherState.HOTSEAT_ICONS;
2121
import static com.android.launcher3.LauncherState.NORMAL;
2222
import static com.android.launcher3.LauncherState.OVERVIEW;
2323
import static com.android.launcher3.LauncherState.OVERVIEW_PEEK;
24-
import static com.android.launcher3.LauncherStateManager.ANIM_ALL;
2524
import static com.android.launcher3.LauncherStateManager.ATOMIC_OVERVIEW_PEEK_COMPONENT;
2625
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_ALL_APPS_FADE;
2726
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_ALL_APPS_HEADER_FADE;
28-
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_HOTSEAT_SCALE;
29-
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_HOTSEAT_TRANSLATE;
30-
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_VERTICAL_PROGRESS;
3127
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_FADE;
3228
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_SCALE;
3329
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_TRANSLATE;
3430
import static com.android.launcher3.anim.Interpolators.ACCEL;
3531
import static com.android.launcher3.anim.Interpolators.DEACCEL;
3632
import static com.android.launcher3.anim.Interpolators.DEACCEL_3;
37-
import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_2;
3833
import static com.android.launcher3.util.VibratorWrapper.OVERVIEW_HAPTIC;
3934
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED;
4035

@@ -46,6 +41,7 @@
4641
import android.view.ViewConfiguration;
4742

4843
import com.android.launcher3.Launcher;
44+
import com.android.launcher3.LauncherAppTransitionManagerImpl;
4945
import com.android.launcher3.LauncherState;
5046
import com.android.launcher3.anim.AnimatorSetBuilder;
5147
import com.android.launcher3.anim.Interpolators;
@@ -79,7 +75,7 @@ public FlingAndHoldTouchController(Launcher l) {
7975

8076
@Override
8177
protected long getAtomicDuration() {
82-
return 300;
78+
return LauncherAppTransitionManagerImpl.ATOMIC_DURATION_FROM_PAUSED_TO_OVERVIEW;
8379
}
8480

8581
@Override
@@ -179,15 +175,8 @@ public void onDragEnd(float velocity) {
179175
mPeekAnim.cancel();
180176
}
181177

182-
AnimatorSetBuilder builder = new AnimatorSetBuilder();
183-
builder.setInterpolator(ANIM_VERTICAL_PROGRESS, OVERSHOOT_1_2);
184-
builder.setInterpolator(ANIM_ALL_APPS_FADE, DEACCEL_3);
185-
if ((OVERVIEW.getVisibleElements(mLauncher) & HOTSEAT_ICONS) != 0) {
186-
builder.setInterpolator(ANIM_HOTSEAT_SCALE, OVERSHOOT_1_2);
187-
builder.setInterpolator(ANIM_HOTSEAT_TRANSLATE, OVERSHOOT_1_2);
188-
}
189-
AnimatorSet overviewAnim = mLauncher.getStateManager().createAtomicAnimation(
190-
NORMAL, OVERVIEW, builder, ANIM_ALL, ATOMIC_DURATION);
178+
Animator overviewAnim = mLauncher.getAppTransitionManager().createStateElementAnimation(
179+
INDEX_PAUSE_TO_OVERVIEW_ANIM);
191180
overviewAnim.addListener(new AnimatorListenerAdapter() {
192181
@Override
193182
public void onAnimationEnd(Animator animation) {

0 commit comments

Comments
 (0)