All apps pull up work

b/28917826
b/29469966
b/29542376

- Move state transition to when the finger is lifted and not when
the view settles.
- Refactor the vertical pull detector to use bit operation to define
which direction scroll to allow.
- Fixed many issues regarding screen rotation
- Fixes issue where slowly sliding the all apps goes into overview mode
- Fixes issue where quick slide up leads to animation starting from middle

Change-Id: I2384a0fcc5550e17359a044ef506bcc66507da5f
This commit is contained in:
Hyunyoung Song
2016-06-21 16:37:13 -07:00
parent 314d53fbaf
commit eac1dac239
5 changed files with 247 additions and 171 deletions

View File

@@ -30,6 +30,7 @@ import android.view.accessibility.AccessibilityManager;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.animation.DecelerateInterpolator;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.dragndrop.DragLayer;
import com.android.launcher3.util.Thunk;
@@ -43,6 +44,7 @@ class AlphaUpdateListener extends AnimatorListenerAdapter implements ValueAnimat
private View mView;
private boolean mAccessibilityEnabled;
private boolean mCanceled = false;
public AlphaUpdateListener(View v, boolean accessibilityEnabled) {
mView = v;
@@ -66,8 +68,14 @@ class AlphaUpdateListener extends AnimatorListenerAdapter implements ValueAnimat
}
}
@Override
public void onAnimationCancel(Animator animation) {
mCanceled = true;
}
@Override
public void onAnimationEnd(Animator arg0) {
if (mCanceled) return;
updateVisibility(mView, mAccessibilityEnabled);
}
@@ -322,8 +330,10 @@ public class WorkspaceStateTransitionAnimation {
boolean isCurrentPage = (i == toPage);
float initialAlpha = cl.getShortcutsAndWidgets().getAlpha();
float finalAlpha;
if (states.stateIsNormalHidden || states.stateIsOverviewHidden) {
if (states.stateIsOverviewHidden) {
finalAlpha = 0f;
} else if(states.stateIsNormalHidden) {
finalAlpha = FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP ? 1 : 0;
} else if (states.stateIsNormal && mWorkspaceFadeInAdjacentScreens) {
finalAlpha = (i == toPage || i < customPageCount) ? 1f : 0f;
} else {
@@ -447,10 +457,16 @@ public class WorkspaceStateTransitionAnimation {
mStateAnimator.play(hotseatAlpha);
mStateAnimator.play(pageIndicatorAlpha);
mStateAnimator.addListener(new AnimatorListenerAdapter() {
boolean canceled = false;
@Override
public void onAnimationCancel(Animator animation) {
canceled = true;
}
@Override
public void onAnimationEnd(Animator animation) {
mStateAnimator = null;
if (canceled) return;
if (accessibilityEnabled && overviewPanel.getVisibility() == View.VISIBLE) {
overviewPanel.getChildAt(0).performAccessibilityAction(
AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS, null);