Send home intent after reaching 3P launcher on swipe up

Also keep the 3P launcher's alpha at 0 during the gesture, and
don't send the home intent if user touches during the transition.

Bug: 139682945
Change-Id: Ie758f0b337bb173b34f5585ec1915b7ea1145094
This commit is contained in:
Tony Wickham
2019-11-27 16:54:01 -06:00
parent 51a5bf15ab
commit 8a50a6d858
3 changed files with 58 additions and 20 deletions
@@ -430,20 +430,6 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
final float windowAlphaThreshold = isFloatingIconView ? 1f - SHAPE_PROGRESS_DURATION : 1f;
anim.addOnUpdateListener(new RectFSpringAnim.OnUpdateListener() {
// Alpha interpolates between [1, 0] between progress values [start, end]
final float start = 0f;
final float end = 0.85f;
private float getWindowAlpha(float progress) {
if (progress <= start) {
return 1f;
}
if (progress >= end) {
return 0f;
}
return Utilities.mapToRange(progress, start, end, 1, 0, ACCEL_1_5);
}
@Override
public void onUpdate(RectF currentRect, float progress) {
homeAnim.setPlayFraction(progress);
@@ -484,6 +470,24 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
return anim;
}
/**
* @param progress The progress of the animation to the home screen.
* @return The current alpha to set on the animating app window.
*/
protected float getWindowAlpha(float progress) {
// Alpha interpolates between [1, 0] between progress values [start, end]
final float start = 0f;
final float end = 0.85f;
if (progress <= start) {
return 1f;
}
if (progress >= end) {
return 0f;
}
return Utilities.mapToRange(progress, start, end, 1, 0, ACCEL_1_5);
}
public interface Factory {
BaseSwipeUpHandler newHandler(GestureState gestureState, long touchTimeMs,