summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/views/TaskStackAnimationHelper.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java7
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/views/grid/TaskGridLayoutAlgorithm.java4
4 files changed, 16 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackAnimationHelper.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackAnimationHelper.java
index 493e6187c83e..34c0c64b3d13 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackAnimationHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackAnimationHelper.java
@@ -424,7 +424,7 @@ public class TaskStackAnimationHelper {
final ReferenceCountedTrigger postAnimationTrigger) {
TaskStackLayoutAlgorithm stackLayout = mStackView.getStackAlgorithm();
- int offscreenXOffset = mStackView.getMeasuredWidth() - stackLayout.mTaskRect.left;
+ int offscreenXOffset = mStackView.getMeasuredWidth() - stackLayout.getTaskRect().left;
int taskViewCount = taskViews.size();
for (int i = taskViewCount - 1; i >= 0; i--) {
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java
index ccc6518edc37..f46de5f53e54 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java
@@ -1320,6 +1320,13 @@ public class TaskStackLayoutAlgorithm {
mFrontOfStackTransform.visible = true;
}
+ /**
+ * Returns the proper task rectangle according to the current grid state.
+ */
+ public Rect getTaskRect() {
+ return mGridState.useGridLayout() ? mTaskGridLayoutAlgorithm.getTaskGridRect() : mTaskRect;
+ }
+
public void dump(String prefix, PrintWriter writer) {
String innerPrefix = prefix + " ";
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
index d9020be2de54..56ea1920e157 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
@@ -1268,8 +1268,8 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
if (tv.getBackground() != null) {
tv.getBackground().getPadding(padding);
}
- mTmpRect.set(mStableLayoutAlgorithm.mTaskRect);
- mTmpRect.union(mLayoutAlgorithm.mTaskRect);
+ mTmpRect.set(mStableLayoutAlgorithm.getTaskRect());
+ mTmpRect.union(mLayoutAlgorithm.getTaskRect());
tv.measure(
MeasureSpec.makeMeasureSpec(mTmpRect.width() + padding.left + padding.right,
MeasureSpec.EXACTLY),
@@ -1314,8 +1314,8 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
if (tv.getBackground() != null) {
tv.getBackground().getPadding(padding);
}
- mTmpRect.set(mStableLayoutAlgorithm.mTaskRect);
- mTmpRect.union(mLayoutAlgorithm.mTaskRect);
+ mTmpRect.set(mStableLayoutAlgorithm.getTaskRect());
+ mTmpRect.union(mLayoutAlgorithm.getTaskRect());
tv.cancelTransformAnimation();
tv.layout(mTmpRect.left - padding.left, mTmpRect.top - padding.top,
mTmpRect.right + padding.right, mTmpRect.bottom + padding.bottom);
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/grid/TaskGridLayoutAlgorithm.java b/packages/SystemUI/src/com/android/systemui/recents/views/grid/TaskGridLayoutAlgorithm.java
index 714b6fb0c859..be3af040c748 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/grid/TaskGridLayoutAlgorithm.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/grid/TaskGridLayoutAlgorithm.java
@@ -195,4 +195,8 @@ public class TaskGridLayoutAlgorithm {
buttonRect.bottom = buttonRect.top + mPaddingTopBottom;
return buttonRect;
}
+
+ public Rect getTaskGridRect() {
+ return mTaskGridRect;
+ }
}