summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java10
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/RecentsActivityLaunchState.java13
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java11
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/tv/RecentsTvActivity.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/stackdivider/DividerHandleView.java5
-rw-r--r--packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java15
7 files changed, 45 insertions, 23 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
index 3f482c82011a..3b49d3785384 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
@@ -205,7 +205,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
? stack.indexOfStackTask(launchTarget)
: 0;
boolean hasNavBarScrim = (taskCount > 0) && !config.hasTransposedNavBar;
- boolean animateNavBarScrim = true;
+ boolean animateNavBarScrim = !launchState.launchedWhileDocking;
mScrimViews.prepareEnterRecentsAnimation(hasNavBarScrim, animateNavBarScrim);
// Keep track of whether we launched from the nav bar button or via alt-tab
@@ -460,13 +460,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
// wait on the system to send a signal that was never queued.
RecentsConfiguration config = Recents.getConfiguration();
RecentsActivityLaunchState launchState = config.getLaunchState();
- launchState.launchedFromHome = false;
- launchState.launchedFromSearchHome = false;
- launchState.launchedFromAppWithThumbnail = false;
- launchState.launchedToTaskId = -1;
- launchState.launchedWithAltTab = false;
- launchState.launchedHasConfigurationChanged = false;
- launchState.launchedViaDragGesture = false;
+ launchState.reset();
MetricsLogger.hidden(this, MetricsEvent.OVERVIEW_ACTIVITY);
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivityLaunchState.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivityLaunchState.java
index 177e8417f3fb..f7ebd945f761 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivityLaunchState.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivityLaunchState.java
@@ -34,10 +34,22 @@ public class RecentsActivityLaunchState {
public boolean launchedReuseTaskStackViews;
public boolean launchedHasConfigurationChanged;
public boolean launchedViaDragGesture;
+ public boolean launchedWhileDocking;
public int launchedToTaskId;
public int launchedNumVisibleTasks;
public int launchedNumVisibleThumbnails;
+ public void reset() {
+ launchedFromHome = false;
+ launchedFromSearchHome = false;
+ launchedFromAppWithThumbnail = false;
+ launchedToTaskId = -1;
+ launchedWithAltTab = false;
+ launchedHasConfigurationChanged = false;
+ launchedViaDragGesture = false;
+ launchedWhileDocking = false;
+ }
+
/** Called when the configuration has changed, and we want to reset any configuration specific
* members. */
public void updateOnConfigurationChange() {
@@ -46,6 +58,7 @@ public class RecentsActivityLaunchState {
// Set this flag to indicate that the configuration has changed since Recents last launched
launchedHasConfigurationChanged = true;
launchedViaDragGesture = false;
+ launchedWhileDocking = false;
}
/**
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java
index dd7b7c1b89e6..5890b5f959d3 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java
@@ -161,6 +161,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
boolean mCanReuseTaskStackViews = true;
boolean mDraggingInRecents;
boolean mReloadTasks;
+ boolean mLaunchedWhileDocking;
// Task launching
Rect mSearchBarBounds = new Rect();
@@ -270,10 +271,10 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
}
public void showRecents(boolean triggeredFromAltTab, boolean draggingInRecents,
- boolean animate, boolean reloadTasks) {
+ boolean animate, boolean launchedWhileDockingTask) {
mTriggeredFromAltTab = triggeredFromAltTab;
mDraggingInRecents = draggingInRecents;
- mReloadTasks = reloadTasks;
+ mLaunchedWhileDocking = launchedWhileDockingTask;
if (mFastAltTabTrigger.hasTriggered()) {
// We are calling this from the doze trigger, so just fall through to show Recents
mFastAltTabTrigger.resetTrigger();
@@ -338,6 +339,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
}
mDraggingInRecents = false;
+ mLaunchedWhileDocking = false;
mTriggeredFromAltTab = false;
try {
@@ -865,11 +867,11 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
// In the case where alt-tab is triggered, we never get a preloadRecents() call, so we
// should always preload the tasks now. If we are dragging in recents, reload them as
// the stacks might have changed.
- if (mReloadTasks || mTriggeredFromAltTab ||sInstanceLoadPlan == null) {
+ if (mLaunchedWhileDocking || mTriggeredFromAltTab ||sInstanceLoadPlan == null) {
// Create a new load plan if preloadRecents() was never triggered
sInstanceLoadPlan = loader.createLoadPlan(mContext);
}
- if (mReloadTasks || mTriggeredFromAltTab || !sInstanceLoadPlan.hasTasks()) {
+ if (mLaunchedWhileDocking || mTriggeredFromAltTab || !sInstanceLoadPlan.hasTasks()) {
loader.preloadTasks(sInstanceLoadPlan, topTask.id, isTopTaskHome);
}
TaskStack stack = sInstanceLoadPlan.getTaskStack();
@@ -957,6 +959,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
launchState.launchedNumVisibleThumbnails = vr.numVisibleThumbnails;
launchState.launchedHasConfigurationChanged = false;
launchState.launchedViaDragGesture = mDraggingInRecents;
+ launchState.launchedWhileDocking = mLaunchedWhileDocking;
Intent intent = new Intent();
intent.setClassName(RECENTS_PACKAGE, mRecentsIntentActivityName);
diff --git a/packages/SystemUI/src/com/android/systemui/recents/tv/RecentsTvActivity.java b/packages/SystemUI/src/com/android/systemui/recents/tv/RecentsTvActivity.java
index fb86214b04d5..42ebfa95c662 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/tv/RecentsTvActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/tv/RecentsTvActivity.java
@@ -287,13 +287,7 @@ public class RecentsTvActivity extends Activity implements OnPreDrawListener {
// wait on the system to send a signal that was never queued.
RecentsConfiguration config = Recents.getConfiguration();
RecentsActivityLaunchState launchState = config.getLaunchState();
- launchState.launchedFromHome = false;
- launchState.launchedFromSearchHome = false;
- launchState.launchedFromAppWithThumbnail = false;
- launchState.launchedToTaskId = -1;
- launchState.launchedWithAltTab = false;
- launchState.launchedHasConfigurationChanged = false;
- launchState.launchedViaDragGesture = false;
+ launchState.reset();
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
index 5e113b997bce..d4624f58f09c 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
@@ -185,7 +185,8 @@ public class RecentsView extends FrameLayout {
// If we are already occluded by the app, then just set the default background scrim now.
// Otherwise, defer until the enter animation completes to animate the scrim with the
// tasks for the home animation.
- if (launchState.launchedFromAppWithThumbnail || mStack.getTaskCount() == 0) {
+ if (launchState.launchedWhileDocking || launchState.launchedFromAppWithThumbnail
+ || mStack.getTaskCount() == 0) {
mBackgroundScrim.setAlpha((int) (DEFAULT_SCRIM_ALPHA * 255));
} else {
mBackgroundScrim.setAlpha(0);
@@ -645,7 +646,8 @@ public class RecentsView extends FrameLayout {
public final void onBusEvent(EnterRecentsWindowAnimationCompletedEvent event) {
RecentsActivityLaunchState launchState = Recents.getConfiguration().getLaunchState();
- if (!launchState.launchedFromAppWithThumbnail && mStack.getTaskCount() > 0) {
+ if (!launchState.launchedWhileDocking && !launchState.launchedFromAppWithThumbnail
+ && mStack.getTaskCount() > 0) {
animateBackgroundScrim(DEFAULT_SCRIM_ALPHA,
TaskStackAnimationHelper.ENTER_FROM_HOME_TRANSLATION_DURATION);
}
diff --git a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerHandleView.java b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerHandleView.java
index 12e271397fba..36cfac8dd092 100644
--- a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerHandleView.java
+++ b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerHandleView.java
@@ -73,6 +73,7 @@ public class DividerHandleView extends ImageButton {
private int mCurrentWidth;
private int mCurrentHeight;
private AnimatorSet mAnimator;
+ private boolean mTouching;
public DividerHandleView(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
@@ -86,6 +87,9 @@ public class DividerHandleView extends ImageButton {
}
public void setTouching(boolean touching, boolean animate) {
+ if (touching == mTouching) {
+ return;
+ }
if (mAnimator != null) {
mAnimator.cancel();
mAnimator = null;
@@ -103,6 +107,7 @@ public class DividerHandleView extends ImageButton {
animateToTarget(touching ? mCircleDiameter : mWidth,
touching ? mCircleDiameter : mHeight, touching);
}
+ mTouching = touching;
}
private void animateToTarget(int targetWidth, int targetHeight, boolean touching) {
diff --git a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java
index 83c22b110433..1bdf5a1e698d 100644
--- a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java
+++ b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java
@@ -100,6 +100,7 @@ public class DividerView extends FrameLayout implements OnTouchListener,
private final int[] mTempInt2 = new int[2];
private boolean mMoving;
private int mTouchSlop;
+ private boolean mBackgroundLifted;
private int mDividerInsets;
private int mDisplayWidth;
@@ -210,8 +211,8 @@ public class DividerView extends FrameLayout implements OnTouchListener,
mDockSide = mWindowManagerProxy.getDockSide();
initializeSnapAlgorithm();
mWindowManagerProxy.setResizing(true);
- mWindowManager.setSlippery(false);
if (touching) {
+ mWindowManager.setSlippery(false);
liftBackground();
}
return mDockSide != WindowManager.DOCKED_INVALID;
@@ -389,6 +390,9 @@ public class DividerView extends FrameLayout implements OnTouchListener,
}
private void liftBackground() {
+ if (mBackgroundLifted) {
+ return;
+ }
if (isHorizontalDivision()) {
mBackground.animate().scaleY(1.4f);
} else {
@@ -407,9 +411,13 @@ public class DividerView extends FrameLayout implements OnTouchListener,
.setDuration(TOUCH_ANIMATION_DURATION)
.translationZ(mTouchElevation)
.start();
+ mBackgroundLifted = true;
}
private void releaseBackground() {
+ if (!mBackgroundLifted) {
+ return;
+ }
mBackground.animate()
.setInterpolator(Interpolators.FAST_OUT_SLOW_IN)
.setDuration(TOUCH_RELEASE_ANIMATION_DURATION)
@@ -422,6 +430,7 @@ public class DividerView extends FrameLayout implements OnTouchListener,
.setDuration(TOUCH_RELEASE_ANIMATION_DURATION)
.translationZ(0)
.start();
+ mBackgroundLifted = false;
}
@Override
@@ -485,7 +494,9 @@ public class DividerView extends FrameLayout implements OnTouchListener,
}
// Make sure shadows are updated
- mBackground.invalidate();
+ if (mBackground.getZ() > 0f) {
+ mBackground.invalidate();
+ }
mLastResizeRect.set(mDockedRect);
if (taskPosition != TASK_POSITION_SAME) {