Merge "Add GroupedTaskView to recents view only if needed" into sc-v2-dev
This commit is contained in:
commit
5025ecb8b6
|
@ -1278,7 +1278,8 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
|||
while (getTaskViewCount() > requiredTaskViewCount) {
|
||||
removeView(getChildAt(getChildCount() - 1));
|
||||
}
|
||||
while (requiredGroupTaskViews > 0) {
|
||||
int groupedTaskViewCount = getGroupedTaskViewCount();
|
||||
while (requiredGroupTaskViews > groupedTaskViewCount) {
|
||||
// Add to front of list
|
||||
addView(getTaskViewFromPool(true), 0);
|
||||
requiredGroupTaskViews--;
|
||||
|
@ -1405,6 +1406,16 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
|||
return taskViewCount;
|
||||
}
|
||||
|
||||
public int getGroupedTaskViewCount() {
|
||||
int groupViewCount = 0;
|
||||
for (int i = 0; i < getChildCount(); i++) {
|
||||
if (getChildAt(i) instanceof GroupedTaskView) {
|
||||
groupViewCount++;
|
||||
}
|
||||
}
|
||||
return groupViewCount;
|
||||
}
|
||||
|
||||
protected void onTaskStackUpdated() {
|
||||
// Lazily update the empty message only when the task stack is reapplied
|
||||
updateEmptyMessage();
|
||||
|
|
Loading…
Reference in New Issue