use of com.android.systemui.recents.events.activity.HideRecentsEvent in project android_frameworks_base by AOSPA.
the class RecentsImpl method hideRecents.
public void hideRecents(boolean triggeredFromAltTab, boolean triggeredFromHomeKey) {
if (triggeredFromAltTab && mFastAltTabTrigger.isDozing()) {
// The user has released alt-tab before the trigger has run, so just show the next
// task immediately
showNextTask();
// Cancel the fast alt-tab trigger
mFastAltTabTrigger.stopDozing();
return;
}
// Defer to the activity to handle hiding recents, if it handles it, then it must still
// be visible
EventBus.getDefault().post(new HideRecentsEvent(triggeredFromAltTab, triggeredFromHomeKey));
}
use of com.android.systemui.recents.events.activity.HideRecentsEvent in project android_frameworks_base by crdroidandroid.
the class TaskStackViewTouchHandler method maybeHideRecentsFromBackgroundTap.
/** Hides recents if the up event at (x, y) is a tap on the background area. */
void maybeHideRecentsFromBackgroundTap(int x, int y) {
// Ignore the up event if it's too far from its start position. The user might have been
// trying to scroll or swipe.
int dx = Math.abs(mDownX - x);
int dy = Math.abs(mDownY - y);
if (dx > mScrollTouchSlop || dy > mScrollTouchSlop) {
return;
}
// Shift the tap position toward the center of the task stack and check to see if it would
// have hit a view. The user might have tried to tap on a task and missed slightly.
int shiftedX = x;
if (x > (mSv.getRight() - mSv.getLeft()) / 2) {
shiftedX -= mWindowTouchSlop;
} else {
shiftedX += mWindowTouchSlop;
}
if (findViewAtPoint(shiftedX, y) != null) {
return;
}
// Disallow tapping above and below the stack to dismiss recents
if (x > mSv.mLayoutAlgorithm.mStackRect.left && x < mSv.mLayoutAlgorithm.mStackRect.right) {
return;
}
// If tapping on the freeform workspace background, just launch the first freeform task
SystemServicesProxy ssp = Recents.getSystemServices();
if (ssp.hasFreeformWorkspaceSupport()) {
Rect freeformRect = mSv.mLayoutAlgorithm.mFreeformRect;
if (freeformRect.top <= y && y <= freeformRect.bottom) {
if (mSv.launchFreeformTasks()) {
// TODO: Animate Recents away as we launch the freeform tasks
return;
}
}
}
// The user intentionally tapped on the background, which is like a tap on the "desktop".
// Hide recents and transition to the launcher.
EventBus.getDefault().send(new HideRecentsEvent(false, true));
}
use of com.android.systemui.recents.events.activity.HideRecentsEvent in project android_frameworks_base by crdroidandroid.
the class RecentsImpl method hideRecents.
public void hideRecents(boolean triggeredFromAltTab, boolean triggeredFromHomeKey) {
if (triggeredFromAltTab && mFastAltTabTrigger.isDozing()) {
// The user has released alt-tab before the trigger has run, so just show the next
// task immediately
showNextTask();
// Cancel the fast alt-tab trigger
mFastAltTabTrigger.stopDozing();
return;
}
// Defer to the activity to handle hiding recents, if it handles it, then it must still
// be visible
EventBus.getDefault().post(new HideRecentsEvent(triggeredFromAltTab, triggeredFromHomeKey));
}
use of com.android.systemui.recents.events.activity.HideRecentsEvent in project android_frameworks_base by AOSPA.
the class TaskStackView method onBusEvent.
public final void onBusEvent(LaunchNextTaskRequestEvent event) {
if (mAwaitingFirstLayout) {
mLaunchNextAfterFirstMeasure = true;
return;
}
final Task launchTask = mStack.getNextLaunchTarget();
if (launchTask != null) {
launchTask(launchTask);
MetricsLogger.action(getContext(), MetricsEvent.OVERVIEW_LAUNCH_PREVIOUS_TASK, launchTask.key.getComponent().toString());
} else if (mStack.getTaskCount() == 0) {
// If there are no tasks, then just hide recents back to home.
EventBus.getDefault().send(new HideRecentsEvent(false, true));
}
}
use of com.android.systemui.recents.events.activity.HideRecentsEvent in project android_frameworks_base by crdroidandroid.
the class TaskStackView method onBusEvent.
public final void onBusEvent(LaunchNextTaskRequestEvent event) {
if (mAwaitingFirstLayout) {
mLaunchNextAfterFirstMeasure = true;
return;
}
final Task launchTask = mStack.getNextLaunchTarget();
if (launchTask != null) {
launchTask(launchTask);
MetricsLogger.action(getContext(), MetricsEvent.OVERVIEW_LAUNCH_PREVIOUS_TASK, launchTask.key.getComponent().toString());
} else if (mStack.getTaskCount() == 0) {
// If there are no tasks, then just hide recents back to home.
EventBus.getDefault().send(new HideRecentsEvent(false, true));
}
}
Aggregations