public class TaskStack extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TaskStack.DockState
The various possible dock states when dragging and dropping a task.
|
static interface |
TaskStack.TaskStackCallbacks
Task stack callbacks
|
Constructor and Description |
---|
TaskStack() |
Modifier and Type | Method and Description |
---|---|
void |
addGroup(TaskGrouping group)
Adds a group to the set
|
ArrayList<Task> |
computeAllTasksList()
Computes a set of all the active and historical tasks.
|
ArraySet<ComponentName> |
computeComponentsRemoved(String packageName,
int userId)
Computes the components of tasks in this stack that have been removed as a result of a change
in the specified package.
|
void |
dump(String prefix,
PrintWriter writer) |
Task |
findTaskWithId(int taskId)
Finds the task with the specified task id.
|
int |
getFreeformTaskCount()
Returns the number of freeform tasks.
|
ArrayList<Task> |
getFreeformTasks()
Returns the set of "freeform" tasks in the stack.
|
TaskGrouping |
getGroupWithAffiliation(int affiliation)
Returns the group with the specified affiliation.
|
Task |
getLaunchTarget()
Returns the task in stack tasks which is the launch target.
|
Task |
getStackFrontMostTask(boolean includeFreeformTasks)
Gets the front-most task in the stack.
|
int |
getStackTaskCount()
Returns the number of stack tasks.
|
ArrayList<Task> |
getStackTasks()
Returns the set of "active" (non-historical) tasks in the stack that have been used recently.
|
int |
getTaskCount()
Returns the number of stack and freeform tasks.
|
ArrayList<Task.TaskKey> |
getTaskKeys()
Gets the task keys
|
int |
indexOfStackTask(Task t)
Returns the index of this task in this current task stack
|
void |
moveTaskToStack(Task task,
int newStackId)
Moves the given task to either the front of the freeform workspace or the stack.
|
void |
removeAllTasks()
Removes all tasks from the stack.
|
void |
removeGroup(TaskGrouping group) |
void |
removeTask(Task t,
AnimationProps animation,
boolean fromDockGesture)
Removes a task from the stack, with an additional hint to the callbacks on
how they should update themselves.
|
void |
setCallbacks(TaskStack.TaskStackCallbacks cb)
Sets the callbacks for this task stack.
|
void |
setTasks(Context context,
List<Task> tasks,
boolean notifyStackChanges)
Sets a few tasks in one go, without calling any callbacks.
|
String |
toString()
Returns a string representation of the object.
|
public void setCallbacks(TaskStack.TaskStackCallbacks cb)
public void moveTaskToStack(Task task, int newStackId)
public void removeTask(Task t, AnimationProps animation, boolean fromDockGesture)
public void removeAllTasks()
public void setTasks(Context context, List<Task> tasks, boolean notifyStackChanges)
tasks
- the new set of tasks to replace the current set.notifyStackChanges
- whether or not to callback on specific changes to the list of tasks.public Task getStackFrontMostTask(boolean includeFreeformTasks)
public ArrayList<Task.TaskKey> getTaskKeys()
public ArrayList<Task> getStackTasks()
public ArrayList<Task> getFreeformTasks()
public ArrayList<Task> computeAllTasksList()
public int getTaskCount()
public int getStackTaskCount()
public int getFreeformTaskCount()
public Task getLaunchTarget()
public int indexOfStackTask(Task t)
public Task findTaskWithId(int taskId)
public void addGroup(TaskGrouping group)
public void removeGroup(TaskGrouping group)
public TaskGrouping getGroupWithAffiliation(int affiliation)
public ArraySet<ComponentName> computeComponentsRemoved(String packageName, int userId)
public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
public void dump(String prefix, PrintWriter writer)