FeatureFlag: quick scrub is now quick switch

- Scale down current task and translate it to the left
- Translate previous task in from the left
- This is a toggle; quick switch again returns to the first task

Currently this is implemented by repurposing onQuickScrub(progress) to update the positions
of the first two pages. This makes tracking velocity a bit difficult; if we want to go down
this path in the long run we should probably track velocity properly on MotionEvents.

Change-Id: I4445b5f08b6e88e71cbb5e30b1f1d45c5f1edc68
This commit is contained in:
Tony
2018-09-19 23:09:14 -04:00
parent f107c9ef6d
commit 50876bfac7
10 changed files with 221 additions and 27 deletions
@@ -87,7 +87,7 @@ public class TaskView extends FrameLayout implements PageCallbacks {
/**
* How much to scale down pages near the edge of the screen.
*/
private static final float EDGE_SCALE_DOWN_FACTOR = 0.03f;
public static final float EDGE_SCALE_DOWN_FACTOR = 0.03f;
public static final long SCALE_ICON_DURATION = 120;
private static final long DIM_ANIM_DURATION = 700;
@@ -142,6 +142,7 @@ public class TaskView extends FrameLayout implements PageCallbacks {
private IconView mIconView;
private float mCurveScale;
private float mZoomScale;
private boolean mIsFullscreen;
private Animator mIconAndDimAnimator;
private float mFocusTransitionProgress = 1;
@@ -509,4 +510,18 @@ public class TaskView extends FrameLayout implements PageCallbacks {
Log.w(tag, msg);
Toast.makeText(getContext(), R.string.activity_not_available, LENGTH_SHORT).show();
}
/**
* Hides the icon and shows insets when this TaskView is about to be shown fullscreen.
*/
public void setFullscreen(boolean isFullscreen) {
mIsFullscreen = isFullscreen;
mIconView.setVisibility(mIsFullscreen ? INVISIBLE : VISIBLE);
setClipChildren(!mIsFullscreen);
setClipToPadding(!mIsFullscreen);
}
public boolean isFullscreen() {
return mIsFullscreen;
}
}