summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java31
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/views/ViewPool.java12
4 files changed, 25 insertions, 22 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java
index a73f3234ed44..8f952beb5038 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java
@@ -154,7 +154,7 @@ public class RecentsConfiguration {
int swInset = getInsetToSmallestWidth(windowBounds.right - windowBounds.left);
int top = searchBarBounds.isEmpty() ? topInset : 0;
taskStackBounds.set(windowBounds.left + swInset, searchBarBounds.bottom + top,
- windowBounds.right - swInset, windowBounds.bottom);
+ windowBounds.right - swInset - rightInset, windowBounds.bottom);
}
}
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 51091c38eec0..b3bd6edc84dd 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java
@@ -201,7 +201,7 @@ public class TaskStackLayoutAlgorithm {
taskStackBounds.right - widthPadding,
taskStackBounds.bottom);
// Anchor the task rect to the top-center of the non-freeform stack rect
- int size = Math.min(mStackRect.width(), mStackRect.height() - mStackBottomOffset);
+ int size = mStackRect.width();
mTaskRect.set(mStackRect.left, mStackRect.top,
mStackRect.left + size, mStackRect.top + size);
mCurrentStackRect = ssp.hasFreeformWorkspaceSupport() ? mFreeformStackRect : mStackRect;
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 a57ac9dd570f..7250d6abaede 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
@@ -114,6 +114,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
HashMap<Task, TaskView> mTmpTaskViewMap = new HashMap<>();
ArrayList<TaskView> mTaskViews = new ArrayList<>();
List<TaskView> mImmutableTaskViews = new ArrayList<>();
+ List<TaskView> mTmpTaskViews = new ArrayList<>();
LayoutInflater mInflater;
boolean mLayersDisabled;
boolean mTouchExplorationEnabled;
@@ -279,14 +280,9 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
}
// Mark each task view for relayout
- if (mViewPool != null) {
- Iterator<TaskView> iter = mViewPool.poolViewIterator();
- if (iter != null) {
- while (iter.hasNext()) {
- TaskView tv = iter.next();
- tv.reset();
- }
- }
+ List<TaskView> poolViews = mViewPool.getViews();
+ for (TaskView tv : poolViews) {
+ tv.reset();
}
// Reset the stack state
@@ -862,10 +858,12 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
}
// Measure each of the TaskViews
- List<TaskView> taskViews = getTaskViews();
- int taskViewCount = taskViews.size();
+ mTmpTaskViews.clear();
+ mTmpTaskViews.addAll(getTaskViews());
+ mTmpTaskViews.addAll(mViewPool.getViews());
+ int taskViewCount = mTmpTaskViews.size();
for (int i = 0; i < taskViewCount; i++) {
- TaskView tv = taskViews.get(i);
+ TaskView tv = mTmpTaskViews.get(i);
if (tv.getBackground() != null) {
tv.getBackground().getPadding(mTmpRect);
} else {
@@ -891,10 +889,12 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
// Layout each of the TaskViews
- List<TaskView> taskViews = getTaskViews();
- int taskViewCount = taskViews.size();
+ mTmpTaskViews.clear();
+ mTmpTaskViews.addAll(getTaskViews());
+ mTmpTaskViews.addAll(mViewPool.getViews());
+ int taskViewCount = mTmpTaskViews.size();
for (int i = 0; i < taskViewCount; i++) {
- TaskView tv = taskViews.get(i);
+ TaskView tv = mTmpTaskViews.get(i);
if (tv.getBackground() != null) {
tv.getBackground().getPadding(mTmpRect);
} else {
@@ -911,6 +911,9 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
}
if (changed) {
+ if (mStackScroller.isScrollOutOfBounds()) {
+ mStackScroller.boundScroll();
+ }
requestSynchronizeStackViewsWithModel();
synchronizeStackViewsWithModel();
clipTaskViews(true /* forceUpdate */);
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/ViewPool.java b/packages/SystemUI/src/com/android/systemui/recents/views/ViewPool.java
index 12b91affce7d..31fbd3e15705 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/ViewPool.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/ViewPool.java
@@ -20,6 +20,7 @@ import android.content.Context;
import java.util.Iterator;
import java.util.LinkedList;
+import java.util.List;
/* A view pool to manage more views than we can visibly handle */
@@ -76,11 +77,10 @@ public class ViewPool<V, T> {
return v;
}
- /** Returns an iterator to the list of the views in the pool. */
- Iterator<V> poolViewIterator() {
- if (mPool != null) {
- return mPool.iterator();
- }
- return null;
+ /**
+ * Returns the list of views in the pool.
+ */
+ List<V> getViews() {
+ return mPool;
}
}