summaryrefslogtreecommitdiffstats
path: root/go
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2019-06-18 16:34:37 -0700
committerSunny Goyal <sunnygoyal@google.com>2019-06-19 14:48:57 -0700
commit59c6901823180bdeb6c39187df45fd1adddeae2d (patch)
treec0f9ea91ab113f1ffa82bf840b0204cd9383025b /go
parent035770e42103a41fbbb8ad186e732908c0c0141c (diff)
downloadandroid_packages_apps_Trebuchet-59c6901823180bdeb6c39187df45fd1adddeae2d.tar.gz
android_packages_apps_Trebuchet-59c6901823180bdeb6c39187df45fd1adddeae2d.tar.bz2
android_packages_apps_Trebuchet-59c6901823180bdeb6c39187df45fd1adddeae2d.zip
Some improvements to home to overview transition for 0 button mode
- Peek in overview further, and with more overshoot - Fade out and scale down workspace faster while swiping up - Scale and translate workspace slower when letting go to enter overview (so it doesn't zoom out at warp speed) - Fade in all apps shelf sooner Bug: 132455160 Change-Id: Ieafad0ccf9bb587889bc35d536627661db10e358
Diffstat (limited to 'go')
-rw-r--r--go/quickstep/src/com/android/launcher3/uioverrides/RecentsUiFactory.java19
-rw-r--r--go/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java40
2 files changed, 40 insertions, 19 deletions
diff --git a/go/quickstep/src/com/android/launcher3/uioverrides/RecentsUiFactory.java b/go/quickstep/src/com/android/launcher3/uioverrides/RecentsUiFactory.java
index b5fefb46d..45822432f 100644
--- a/go/quickstep/src/com/android/launcher3/uioverrides/RecentsUiFactory.java
+++ b/go/quickstep/src/com/android/launcher3/uioverrides/RecentsUiFactory.java
@@ -16,11 +16,6 @@
package com.android.launcher3.uioverrides;
-import static android.view.View.VISIBLE;
-import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY;
-
-import android.view.View;
-
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherStateManager.StateHandler;
@@ -43,8 +38,6 @@ import java.util.ArrayList;
public abstract class RecentsUiFactory {
public static final boolean GO_LOW_RAM_RECENTS_ENABLED = true;
- // Scale recents takes before animating in
- private static final float RECENTS_PREPARE_SCALE = 1.33f;
public static TouchController[] createTouchControllers(Launcher launcher) {
ArrayList<TouchController> list = new ArrayList<>();
@@ -77,18 +70,6 @@ public abstract class RecentsUiFactory {
}
/**
- * Prepare the recents view to animate in.
- *
- * @param launcher the launcher activity
- */
- public static void prepareToShowOverview(Launcher launcher) {
- View overview = launcher.getOverviewPanel();
- if (overview.getVisibility() != VISIBLE) {
- SCALE_PROPERTY.set(overview, RECENTS_PREPARE_SCALE);
- }
- }
-
- /**
* Clean-up logic that occurs when recents is no longer in use/visible.
*
* @param launcher the launcher activity
diff --git a/go/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java b/go/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java
index 1b24fc856..d0cfcf97a 100644
--- a/go/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java
+++ b/go/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java
@@ -16,15 +16,31 @@
package com.android.launcher3.uioverrides.states;
+import static android.view.View.VISIBLE;
+
import static com.android.launcher3.LauncherAnimUtils.OVERVIEW_TRANSITION_MS;
+import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY;
+import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_FADE;
+import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_SCALE;
+import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_TRANSLATE_X;
+import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_FADE;
+import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_SCALE;
+import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_TRANSLATE;
+import static com.android.launcher3.anim.Interpolators.ACCEL;
import static com.android.launcher3.anim.Interpolators.DEACCEL_2;
+import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_2;
+import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_7;
import static com.android.launcher3.states.RotationHelper.REQUEST_ROTATE;
+import android.view.View;
+
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.R;
+import com.android.launcher3.anim.AnimatorSetBuilder;
import com.android.launcher3.userevent.nano.LauncherLogProto;
+import com.android.quickstep.SysUINavigationMode;
import com.android.quickstep.views.IconRecentsView;
/**
@@ -32,6 +48,9 @@ import com.android.quickstep.views.IconRecentsView;
*/
public class OverviewState extends LauncherState {
+ // Scale recents takes before animating in
+ private static final float RECENTS_PREPARE_SCALE = 1.33f;
+
private static final int STATE_FLAGS = FLAG_WORKSPACE_ICONS_CAN_BE_DRAGGED
| FLAG_DISABLE_RESTORE | FLAG_OVERVIEW_UI | FLAG_DISABLE_ACCESSIBILITY;
@@ -103,6 +122,27 @@ public class OverviewState extends LauncherState {
return dp.allAppsCellHeightPx - dp.allAppsIconTextSizePx;
}
+ @Override
+ public void prepareForAtomicAnimation(Launcher launcher, LauncherState fromState,
+ AnimatorSetBuilder builder) {
+ if (fromState == NORMAL && this == OVERVIEW) {
+ if (SysUINavigationMode.getMode(launcher) == SysUINavigationMode.Mode.NO_BUTTON) {
+ builder.setInterpolator(ANIM_WORKSPACE_SCALE, ACCEL);
+ builder.setInterpolator(ANIM_WORKSPACE_TRANSLATE, ACCEL);
+ } else {
+ builder.setInterpolator(ANIM_WORKSPACE_SCALE, OVERSHOOT_1_2);
+ }
+ builder.setInterpolator(ANIM_WORKSPACE_FADE, OVERSHOOT_1_2);
+ builder.setInterpolator(ANIM_OVERVIEW_SCALE, OVERSHOOT_1_2);
+ builder.setInterpolator(ANIM_OVERVIEW_TRANSLATE_X, OVERSHOOT_1_7);
+ builder.setInterpolator(ANIM_OVERVIEW_FADE, OVERSHOOT_1_2);
+
+ View overview = launcher.getOverviewPanel();
+ if (overview.getVisibility() != VISIBLE) {
+ SCALE_PROPERTY.set(overview, RECENTS_PREPARE_SCALE);
+ }
+ }
+ }
public static OverviewState newBackgroundState(int id) {
return new OverviewState(id);