Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f0e3a68 authored by Winson's avatar Winson Committed by Winson Chung
Browse files

Hiding the docked task from the stack.

Bug: 25665312

Change-Id: I1e0deb8c3b02604ce4f21d367430d50da9d3b86b
parent 1ad32cac
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -341,6 +341,13 @@ public class SystemServicesProxy {
        return stackId == HOME_STACK_ID;
    }

    /**
     * Returns whether the given stack id is the docked stack id.
     */
    public static boolean isDockedStack(int stackId) {
        return stackId == DOCKED_STACK_ID;
    }

    /**
     * Returns whether the given stack id is the freeform workspace stack id.
     */
+16 −7
Original line number Diff line number Diff line
@@ -74,18 +74,17 @@ class FilteredTaskList {
        if (!prevFilteredTasks.equals(mFilteredTasks)) {
            return true;
        } else {
            // If the tasks are exactly the same pre/post filter, then just reset it
            mFilter = null;
            return false;
        }
    }

    /** Resets this FilteredTaskList. */
    /**
     * Resets the task list, but does not remove the filter.
     */
    void reset() {
        mTasks.clear();
        mFilteredTasks.clear();
        mTaskIndices.clear();
        mFilter = null;
    }

    /** Removes the task filter and returns the previous touch state */
@@ -294,8 +293,18 @@ public class TaskStack {
    FilteredTaskList mTaskList = new FilteredTaskList();
    TaskStackCallbacks mCb;

    ArrayList<TaskGrouping> mGroups = new ArrayList<TaskGrouping>();
    HashMap<Integer, TaskGrouping> mAffinitiesGroups = new HashMap<Integer, TaskGrouping>();
    ArrayList<TaskGrouping> mGroups = new ArrayList<>();
    HashMap<Integer, TaskGrouping> mAffinitiesGroups = new HashMap<>();

    public TaskStack() {
        // Ensure that we only show non-docked tasks
        mTaskList.setFilter(new TaskFilter() {
            @Override
            public boolean acceptTask(Task t, int index) {
                return !SystemServicesProxy.isDockedStack(t.key.stackId);
            }
        });
    }

    /** Sets the callbacks for this task stack. */
    public void setCallbacks(TaskStackCallbacks cb) {
@@ -399,7 +408,7 @@ public class TaskStack {

    /** Gets the task keys */
    public ArrayList<Task.TaskKey> getTaskKeys() {
        ArrayList<Task.TaskKey> taskKeys = new ArrayList<Task.TaskKey>();
        ArrayList<Task.TaskKey> taskKeys = new ArrayList<>();
        ArrayList<Task> tasks = mTaskList.getTasks();
        int taskCount = tasks.size();
        for (int i = 0; i < taskCount; i++) {