use of com.android.systemui.recents.events.activity.LaunchTaskEvent in project platform_frameworks_base by android.
the class RecentsView method launchPreviousTask.
/** Launches the task that recents was launched from if possible */
public boolean launchPreviousTask() {
if (mTaskStackView != null) {
TaskStack stack = mTaskStackView.getStack();
Task task = stack.getLaunchTarget();
if (task != null) {
TaskView taskView = mTaskStackView.getChildViewForTask(task);
EventBus.getDefault().send(new LaunchTaskEvent(taskView, task, null, INVALID_STACK_ID, false));
return true;
}
}
return false;
}
use of com.android.systemui.recents.events.activity.LaunchTaskEvent in project android_frameworks_base by AOSPA.
the class RecentsView method launchFocusedTask.
/** Launches the focused task from the first stack if possible */
public boolean launchFocusedTask(int logEvent) {
if (mTaskStackView != null) {
Task task = mTaskStackView.getFocusedTask();
if (task != null) {
TaskView taskView = mTaskStackView.getChildViewForTask(task);
EventBus.getDefault().send(new LaunchTaskEvent(taskView, task, null, INVALID_STACK_ID, false));
if (logEvent != 0) {
MetricsLogger.action(getContext(), logEvent, task.key.getComponent().toString());
}
return true;
}
}
return false;
}
use of com.android.systemui.recents.events.activity.LaunchTaskEvent in project android_frameworks_base by AOSPA.
the class TaskView method onClick.
/**** View.OnClickListener Implementation ****/
@Override
public void onClick(final View v) {
if (mIsDisabledInSafeMode) {
Context context = getContext();
String msg = context.getString(R.string.recents_launch_disabled_message, mTask.title);
if (mDisabledAppToast != null) {
mDisabledAppToast.cancel();
}
mDisabledAppToast = Toast.makeText(context, msg, Toast.LENGTH_SHORT);
mDisabledAppToast.show();
return;
}
boolean screenPinningRequested = false;
if (v == mActionButtonView) {
// Reset the translation of the action button before we animate it out
mActionButtonView.setTranslationZ(0f);
screenPinningRequested = true;
}
EventBus.getDefault().send(new LaunchTaskEvent(this, mTask, null, INVALID_STACK_ID, screenPinningRequested));
MetricsLogger.action(v.getContext(), MetricsEvent.ACTION_OVERVIEW_SELECT, mTask.key.getComponent().toString());
}
use of com.android.systemui.recents.events.activity.LaunchTaskEvent in project android_frameworks_base by ResurrectionRemix.
the class RecentsView method launchTask.
/** Launches a given task. */
public boolean launchTask(Task task, Rect taskBounds, int destinationStack) {
if (mTaskStackView != null) {
// Iterate the stack views and try and find the given task.
List<TaskView> taskViews = mTaskStackView.getTaskViews();
int taskViewCount = taskViews.size();
for (int j = 0; j < taskViewCount; j++) {
TaskView tv = taskViews.get(j);
if (tv.getTask() == task) {
EventBus.getDefault().send(new LaunchTaskEvent(tv, task, taskBounds, destinationStack, false));
return true;
}
}
}
return false;
}
use of com.android.systemui.recents.events.activity.LaunchTaskEvent in project android_frameworks_base by ResurrectionRemix.
the class RecentsView method launchFocusedTask.
/** Launches the focused task from the first stack if possible */
public boolean launchFocusedTask(int logEvent) {
if (mTaskStackView != null) {
Task task = mTaskStackView.getFocusedTask();
if (task != null) {
TaskView taskView = mTaskStackView.getChildViewForTask(task);
EventBus.getDefault().send(new LaunchTaskEvent(taskView, task, null, INVALID_STACK_ID, false));
if (logEvent != 0) {
MetricsLogger.action(getContext(), logEvent, task.key.getComponent().toString());
}
return true;
}
}
return false;
}
Aggregations