mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-18 10:18:20 +00:00
Add flags to stash taskbar for app pinning and empty hotseat
Test: pin an app from overview, watch taskbar stash automatically until unpinning Test: turn off suggestions for hotseat, remove all items and watch taskbar stash automatically when opening an app Fixes: 190192993 Fixes: 193937948 Change-Id: Ia7260c60a820af1a48c9e4a400a52753baf34d41
This commit is contained in:
@@ -45,6 +45,9 @@ public class TaskbarModelCallbacks implements
|
||||
private final TaskbarActivityContext mContext;
|
||||
private final TaskbarView mContainer;
|
||||
|
||||
// Initialized in init.
|
||||
private TaskbarControllers mControllers;
|
||||
|
||||
private boolean mBindInProgress = false;
|
||||
|
||||
public TaskbarModelCallbacks(
|
||||
@@ -53,6 +56,10 @@ public class TaskbarModelCallbacks implements
|
||||
mContainer = container;
|
||||
}
|
||||
|
||||
public void init(TaskbarControllers controllers) {
|
||||
mControllers = controllers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startBinding() {
|
||||
mBindInProgress = true;
|
||||
@@ -161,6 +168,7 @@ public class TaskbarModelCallbacks implements
|
||||
int predictionSize = mPredictedItems.size();
|
||||
int predictionNextIndex = 0;
|
||||
|
||||
boolean isHotseatEmpty = true;
|
||||
for (int i = 0; i < hotseatItemInfos.length; i++) {
|
||||
hotseatItemInfos[i] = mHotseatItems.get(i);
|
||||
if (hotseatItemInfos[i] == null && predictionNextIndex < predictionSize) {
|
||||
@@ -168,7 +176,14 @@ public class TaskbarModelCallbacks implements
|
||||
hotseatItemInfos[i].screenId = i;
|
||||
predictionNextIndex++;
|
||||
}
|
||||
if (hotseatItemInfos[i] != null) {
|
||||
isHotseatEmpty = false;
|
||||
}
|
||||
}
|
||||
mContainer.updateHotseatItems(hotseatItemInfos);
|
||||
|
||||
mControllers.taskbarStashController.updateStateForFlag(
|
||||
TaskbarStashController.FLAG_STASHED_IN_APP_EMPTY, isHotseatEmpty);
|
||||
mControllers.taskbarStashController.applyState();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user