use of com.android.systemui.recents.events.activity.LaunchTaskEvent in project android_frameworks_base by AOSPA.
the class RecentsView method launchPreviousTask.
/** Launches the task that recents was launched from if possible */
public boolean launchPreviousTask() {
if (mTaskStackView != null) {
Task task = getStack().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 crdroidandroid.
the class RecentsView method launchPreviousTask.
/** Launches the task that recents was launched from if possible */
public boolean launchPreviousTask() {
if (mTaskStackView != null) {
Task task = getStack().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 crdroidandroid.
the class TaskView method screenPinning.
void screenPinning() {
boolean screenPinningRequested = false;
mActionButtonView.setTranslationZ(0f);
screenPinningRequested = true;
EventBus.getDefault().send(new LaunchTaskEvent(this, mTask, null, INVALID_STACK_ID, screenPinningRequested));
}
use of com.android.systemui.recents.events.activity.LaunchTaskEvent in project android_frameworks_base by crdroidandroid.
the class TaskViewHeader method onClick.
@Override
public void onClick(View v) {
if (v == mIconView) {
// In accessibility, a single click on the focused app info button will show it
EventBus.getDefault().send(new ShowApplicationInfoEvent(mTask));
} else if (v == mDismissButton) {
TaskView tv = Utilities.findParent(this, TaskView.class);
tv.dismissTask();
// Keep track of deletions by the dismiss button
MetricsLogger.histogram(getContext(), "overview_task_dismissed_source", Constants.Metrics.DismissSourceHeaderButton);
} else if (v == mPinButton) {
TaskView tv = Utilities.findParent(this, TaskView.class);
tv.screenPinning();
} else if (v == mMoveTaskButton) {
TaskView tv = Utilities.findParent(this, TaskView.class);
EventBus.getDefault().send(new LaunchTaskEvent(tv, mTask, null, mMoveTaskTargetStackId, false));
} else if (v == mAppInfoView) {
EventBus.getDefault().send(new ShowApplicationInfoEvent(mTask));
} else if (v == mAppIconView) {
hideAppOverlay(false);
} else if (v == mLockTaskButton) {
if (mTask.isLockedTask) {
mLockTaskHelper.removeTask(mTask.packageName);
} else {
mLockTaskHelper.addTask(mTask.packageName);
}
mTask.isLockedTask = !mTask.isLockedTask;
updateLockTaskDrawable();
EventBus.getDefault().send(new LockTaskStateChangedEvent(true));
}
}
use of com.android.systemui.recents.events.activity.LaunchTaskEvent in project android_frameworks_base by AOSPA.
the class TaskStackView method launchTask.
private void launchTask(Task task) {
// Stop all animations
cancelAllTaskViewAnimations();
float curScroll = mStackScroller.getStackScroll();
float targetScroll = mLayoutAlgorithm.getStackScrollForTaskAtInitialOffset(task);
float absScrollDiff = Math.abs(targetScroll - curScroll);
if (getChildViewForTask(task) == null || absScrollDiff > 0.35f) {
int duration = (int) (LAUNCH_NEXT_SCROLL_BASE_DURATION + absScrollDiff * LAUNCH_NEXT_SCROLL_INCR_DURATION);
mStackScroller.animateScroll(targetScroll, duration, new Runnable() {
@Override
public void run() {
EventBus.getDefault().send(new LaunchTaskEvent(getChildViewForTask(task), task, null, INVALID_STACK_ID, false));
}
});
} else {
EventBus.getDefault().send(new LaunchTaskEvent(getChildViewForTask(task), task, null, INVALID_STACK_ID, false));
}
}
Aggregations