Flatten recents (remove curve effect)
- Workspace card scales down to be same width as other cards, which
leaves a gap at the bottom due to difference in aspect ratio. This
can be changed in the future, but deferring for now.
- Workspace card no longer offsets when scrolling.
- Cards no longer scale and translate, but still have a bit of dimming
when on the edges, so the center card has the most focus.
A lot of code can be cleaned up. Added TODO's now, will cleanup in
followup CL
Bug: 70179222
Change-Id: I2332aab10e2549a455f773e053ed8b48677c3110
diff --git a/quickstep/res/values/dimens.xml b/quickstep/res/values/dimens.xml
index cf86176..83ca70a 100644
--- a/quickstep/res/values/dimens.xml
+++ b/quickstep/res/values/dimens.xml
@@ -33,7 +33,8 @@
<dimen name="quickstep_fling_threshold_velocity">500dp</dimen>
<dimen name="quickstep_fling_min_velocity">250dp</dimen>
- <dimen name="workspace_overview_offset_x">-24dp</dimen>
+ <!-- TODO: can remove -->
+ <dimen name="workspace_overview_offset_x">0dp</dimen>
<!-- Launcher app transition -->
<dimen name="content_trans_y">25dp</dimen>
diff --git a/quickstep/src/com/android/launcher3/uioverrides/OverviewState.java b/quickstep/src/com/android/launcher3/uioverrides/OverviewState.java
index 854fb4f..d95aabf 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/OverviewState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/OverviewState.java
@@ -98,9 +98,8 @@
Rect pageRect) {
Workspace ws = launcher.getWorkspace();
float childWidth = ws.getNormalChildWidth();
- float childHeight = ws.getNormalChildHeight();
- float scale = pageRect.height() / childHeight;
+ float scale = pageRect.width() / childWidth;
Rect insets = launcher.getDragLayer().getInsets();
float halfHeight = ws.getExpectedHeight() / 2;
diff --git a/quickstep/src/com/android/launcher3/uioverrides/WorkspaceCard.java b/quickstep/src/com/android/launcher3/uioverrides/WorkspaceCard.java
index 8533502..2e6f7b8 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/WorkspaceCard.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/WorkspaceCard.java
@@ -69,6 +69,7 @@
super.onLayout(changed, left, top, right, bottom);
// Initiate data
+ // TODO: can remove most of this as workspace card is no longer scrolling
mLinearInterpolationForPage2 = RecentsView.getScaledDownPageRect(
mLauncher.getDeviceProfile(), mLauncher, mTempRect);
@@ -98,11 +99,17 @@
}
public void setWorkspaceScrollingEnabled(boolean isEnabled) {
+ // TODO can remove
mIsWorkspaceScrollingEnabled = isEnabled;
}
@Override
public int onPageScroll(ScrollState scrollState) {
+ // TODO: can remove
+ if (true) {
+ return SCROLL_TYPE_WORKSPACE;
+ }
+
float factor = scrollState.linearInterpolation;
float translateX = scrollState.distanceFromScreenCenter;
if (mIsWorkspaceScrollingEnabled) {
diff --git a/quickstep/src/com/android/quickstep/RecentsView.java b/quickstep/src/com/android/quickstep/RecentsView.java
index 9ae41eb..575910c 100644
--- a/quickstep/src/com/android/quickstep/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/RecentsView.java
@@ -17,7 +17,6 @@
package com.android.quickstep;
import static com.android.launcher3.LauncherState.NORMAL;
-import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.quickstep.TaskView.CURVE_FACTOR;
import static com.android.quickstep.TaskView.CURVE_INTERPOLATOR;
@@ -52,7 +51,6 @@
import com.android.launcher3.PagedView;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
-import com.android.launcher3.uioverrides.OverviewState;
import com.android.launcher3.uioverrides.RecentsViewStateController;
import com.android.systemui.shared.recents.model.RecentsTaskLoadPlan;
import com.android.systemui.shared.recents.model.RecentsTaskLoader;
@@ -637,6 +635,7 @@
canvas.restoreToCount(saveCount);
}
+ // TODO: can remove
public interface PageCallbacks {
/**
diff --git a/quickstep/src/com/android/quickstep/TaskView.java b/quickstep/src/com/android/quickstep/TaskView.java
index b407f75..f1f63d9 100644
--- a/quickstep/src/com/android/quickstep/TaskView.java
+++ b/quickstep/src/com/android/quickstep/TaskView.java
@@ -47,17 +47,19 @@
*/
public class TaskView extends FrameLayout implements TaskCallbacks, PageCallbacks {
+ // TODO: can remove
/** Designates how "curvy" the carousel is from 0 to 1, where 0 is a straight line. */
- public static final float CURVE_FACTOR = 0.25f;
- /** A circular curve of x from 0 to 1, where 0 is the center of the screen and 1 is the edge. */
+ public static final float CURVE_FACTOR = 0;
+
+ /** A curve of x from 0 to 1, where 0 is the center of the screen and 1 is the edge. */
public static final TimeInterpolator CURVE_INTERPOLATOR
- = x -> (float) (1 - Math.sqrt(1 - Math.pow(x, 2)));
+ = x -> (float) -Math.cos(x * Math.PI) / 2f + .5f;
/**
* The alpha of a black scrim on a page in the carousel as it leaves the screen.
* In the resting position of the carousel, the adjacent pages have about half this scrim.
*/
- private static final float MAX_PAGE_SCRIM_ALPHA = 0.8f;
+ private static final float MAX_PAGE_SCRIM_ALPHA = 0.4f;
private static final long SCALE_ICON_DURATION = 120;