mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 08:56:55 +00:00
Add predictions row to taskbar all apps.
- We need to listen to DeviceProfile changes in case the number of columns changes in the grid. I made an interface/mixin separate from ActivityContext to avoid polutting the latter with too many things. I also applied this change to existing taskbar A-Z grid. - Added all apps visited count to onboarding preferences for only showing "All Apps" label in place of divider 20 times. Label is also tracked on taskbar side and should be kept in sync. Test: Manual Fix: 216843395 Bug: 174174514 Change-Id: I97aa91397c334123626caf18251f19e17c7104fb
This commit is contained in:
@@ -52,8 +52,6 @@ public class TaskbarModelCallbacks implements
|
||||
// Initialized in init.
|
||||
private TaskbarControllers mControllers;
|
||||
|
||||
private boolean mBindInProgress = false;
|
||||
|
||||
public TaskbarModelCallbacks(
|
||||
TaskbarActivityContext context, TaskbarView container) {
|
||||
mContext = context;
|
||||
@@ -66,14 +64,14 @@ public class TaskbarModelCallbacks implements
|
||||
|
||||
@Override
|
||||
public void startBinding() {
|
||||
mBindInProgress = true;
|
||||
mContext.setBindingItems(true);
|
||||
mHotseatItems.clear();
|
||||
mPredictedItems = Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishBindingItems(IntSet pagesBoundFirst) {
|
||||
mBindInProgress = false;
|
||||
mContext.setBindingItems(false);
|
||||
commitItemsToUI();
|
||||
}
|
||||
|
||||
@@ -159,11 +157,13 @@ public class TaskbarModelCallbacks implements
|
||||
if (item.containerId == Favorites.CONTAINER_HOTSEAT_PREDICTION) {
|
||||
mPredictedItems = item.items;
|
||||
commitItemsToUI();
|
||||
} else if (item.containerId == Favorites.CONTAINER_PREDICTION) {
|
||||
mControllers.taskbarAllAppsViewController.setPredictedApps(item.items);
|
||||
}
|
||||
}
|
||||
|
||||
private void commitItemsToUI() {
|
||||
if (mBindInProgress) {
|
||||
if (mContext.isBindingItems()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -212,6 +212,5 @@ public class TaskbarModelCallbacks implements
|
||||
pw.println(
|
||||
String.format("%s\tpredicted items count=%s", prefix, mPredictedItems.size()));
|
||||
}
|
||||
pw.println(String.format("%s\tmBindInProgress=%b", prefix, mBindInProgress));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user