summaryrefslogtreecommitdiffstats
path: root/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2019-07-12 12:02:24 -0700
committerWinson Chung <winsonc@google.com>2019-07-12 12:05:53 -0700
commit39cfa03d11f134b997da3e94bd5d44d4e32fa75a (patch)
tree9ee8bbc7fc6dfeda21768173200b2eb85f82cf32 /quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
parentddf64806e248147c9670c596d0a2c200b5d6f371 (diff)
downloadandroid_packages_apps_Trebuchet-39cfa03d11f134b997da3e94bd5d44d4e32fa75a.tar.gz
android_packages_apps_Trebuchet-39cfa03d11f134b997da3e94bd5d44d4e32fa75a.tar.bz2
android_packages_apps_Trebuchet-39cfa03d11f134b997da3e94bd5d44d4e32fa75a.zip
Update the home stack bounds with the transition end points
- When the user dismisses splitscreen while launcher is hidden and was previously minimized, getLocationOnScreen() will continue to return the old position until the first view root traversal after the window is shown. As a result, we will end up with home bounds for the minimized state and the wrong target bounds calculated Bug: 135952890 Test: Enter splitscreen, launcher another app, dismiss splitscreen and then swipe up Change-Id: Id19dfa664623b2b855db4209999508c76a9aacdc
Diffstat (limited to 'quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java')
-rw-r--r--quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java32
1 files changed, 21 insertions, 11 deletions
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
index ac7ba3fc3..d81bb31e6 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
@@ -381,12 +381,31 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
}
}
+ private Rect getStackBounds(DeviceProfile dp) {
+ if (mActivity != null) {
+ int loc[] = new int[2];
+ View rootView = mActivity.getRootView();
+ rootView.getLocationOnScreen(loc);
+ return new Rect(loc[0], loc[1], loc[0] + rootView.getWidth(),
+ loc[1] + rootView.getHeight());
+ } else {
+ return new Rect(0, 0, dp.widthPx, dp.heightPx);
+ }
+ }
+
private void initTransitionEndpoints(DeviceProfile dp) {
mDp = dp;
Rect tempRect = new Rect();
mTransitionDragLength = mActivityControlHelper.getSwipeUpDestinationAndLength(
dp, mContext, tempRect);
+ if (!dp.isMultiWindowMode) {
+ // When updating the target rect, also update the home bounds since the location on
+ // screen of the launcher window may be stale (position is not updated until first
+ // traversal after the window is resized). We only do this for non-multiwindow because
+ // we otherwise use the minimized home bounds provided by the system.
+ mClipAnimationHelper.updateHomeBounds(getStackBounds(dp));
+ }
mClipAnimationHelper.updateTargetRect(tempRect);
if (mMode == Mode.NO_BUTTON) {
// We can drag all the way to the top of the screen.
@@ -776,21 +795,12 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
.getOverviewWindowBounds(targetSet.minimizedHomeBounds, runningTaskTarget);
dp = dp.getMultiWindowProfile(mContext, new Point(
targetSet.minimizedHomeBounds.width(), targetSet.minimizedHomeBounds.height()));
- dp.updateInsets(targetSet.homeContentInsets);
} else {
- if (mActivity != null) {
- int loc[] = new int[2];
- View rootView = mActivity.getRootView();
- rootView.getLocationOnScreen(loc);
- overviewStackBounds = new Rect(loc[0], loc[1], loc[0] + rootView.getWidth(),
- loc[1] + rootView.getHeight());
- } else {
- overviewStackBounds = new Rect(0, 0, dp.widthPx, dp.heightPx);
- }
// If we are not in multi-window mode, home insets should be same as system insets.
dp = dp.copy(mContext);
- dp.updateInsets(targetSet.homeContentInsets);
+ overviewStackBounds = getStackBounds(dp);
}
+ dp.updateInsets(targetSet.homeContentInsets);
dp.updateIsSeascape(mContext.getSystemService(WindowManager.class));
if (runningTaskTarget != null) {