Merge "Fix some issues with taskbar" into sc-dev
This commit is contained in:
commit
e263a44567
|
@ -57,6 +57,7 @@ public class TaskbarHotseatController {
|
||||||
|
|
||||||
protected void init() {
|
protected void init() {
|
||||||
mLauncher.getDragController().addDragListener(mDragListener);
|
mLauncher.getDragController().addDragListener(mDragListener);
|
||||||
|
onHotseatUpdated();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void cleanup() {
|
protected void cleanup() {
|
||||||
|
|
|
@ -50,6 +50,8 @@ public class TaskbarRecentsController {
|
||||||
// The current background requests to load the task icons
|
// The current background requests to load the task icons
|
||||||
private CancellableTask[] mIconLoadRequests = new CancellableTask[mNumRecentIcons];
|
private CancellableTask[] mIconLoadRequests = new CancellableTask[mNumRecentIcons];
|
||||||
|
|
||||||
|
private boolean mIsAlive;
|
||||||
|
|
||||||
public TaskbarRecentsController(BaseQuickstepLauncher launcher,
|
public TaskbarRecentsController(BaseQuickstepLauncher launcher,
|
||||||
TaskbarController.TaskbarRecentsControllerCallbacks taskbarCallbacks) {
|
TaskbarController.TaskbarRecentsControllerCallbacks taskbarCallbacks) {
|
||||||
mLauncher = launcher;
|
mLauncher = launcher;
|
||||||
|
@ -58,11 +60,13 @@ public class TaskbarRecentsController {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void init() {
|
protected void init() {
|
||||||
|
mIsAlive = true;
|
||||||
TaskStackChangeListeners.getInstance().registerTaskStackListener(mTaskStackChangeListener);
|
TaskStackChangeListeners.getInstance().registerTaskStackListener(mTaskStackChangeListener);
|
||||||
reloadRecentTasksIfNeeded();
|
reloadRecentTasksIfNeeded();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void cleanup() {
|
protected void cleanup() {
|
||||||
|
mIsAlive = false;
|
||||||
TaskStackChangeListeners.getInstance().unregisterTaskStackListener(
|
TaskStackChangeListeners.getInstance().unregisterTaskStackListener(
|
||||||
mTaskStackChangeListener);
|
mTaskStackChangeListener);
|
||||||
cancelAllPendingIconLoadTasks();
|
cancelAllPendingIconLoadTasks();
|
||||||
|
@ -84,8 +88,10 @@ public class TaskbarRecentsController {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onRecentTasksChanged(ArrayList<Task> tasks) {
|
private void onRecentTasksChanged(ArrayList<Task> tasks) {
|
||||||
|
if (mIsAlive) {
|
||||||
mTaskbarCallbacks.updateRecentItems(tasks);
|
mTaskbarCallbacks.updateRecentItems(tasks);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For each Task, loads its icon from the cache in the background, then calls
|
* For each Task, loads its icon from the cache in the background, then calls
|
||||||
|
|
Loading…
Reference in New Issue