use of com.android.systemui.recents.RecentsActivityLaunchState in project android_frameworks_base by ResurrectionRemix.
the class TaskStackView method onBusEvent.
public final void onBusEvent(final MultiWindowStateChangedEvent event) {
if (event.inMultiWindow || !event.showDeferredAnimation) {
setTasks(event.stack, true);
} else {
// Reset the launch state before handling the multiwindow change
RecentsActivityLaunchState launchState = Recents.getConfiguration().getLaunchState();
launchState.reset();
// Defer until the next frame to ensure that we have received all the system insets, and
// initial layout updates
event.getAnimationTrigger().increment();
post(new Runnable() {
@Override
public void run() {
// Scroll the stack to the front to see the undocked task
mAnimationHelper.startNewStackScrollAnimation(event.stack, event.getAnimationTrigger());
event.getAnimationTrigger().decrement();
}
});
}
}
use of com.android.systemui.recents.RecentsActivityLaunchState in project android_frameworks_base by DirtyUnicorns.
the class RecentsTvImpl method startRecentsActivity.
protected void startRecentsActivity(ActivityManager.RunningTaskInfo runningTask, ActivityOptions opts, boolean fromHome, boolean fromThumbnail) {
// Update the configuration based on the launch options
RecentsConfiguration config = Recents.getConfiguration();
RecentsActivityLaunchState launchState = config.getLaunchState();
launchState.launchedFromHome = fromHome;
launchState.launchedFromApp = fromThumbnail;
launchState.launchedToTaskId = (runningTask != null) ? runningTask.id : -1;
launchState.launchedWithAltTab = mTriggeredFromAltTab;
Intent intent = new Intent();
intent.setClassName(RECENTS_PACKAGE, RECENTS_TV_ACTIVITY);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS | Intent.FLAG_ACTIVITY_TASK_ON_HOME);
if (opts != null) {
mContext.startActivityAsUser(intent, opts.toBundle(), UserHandle.CURRENT);
} else {
mContext.startActivityAsUser(intent, UserHandle.CURRENT);
}
EventBus.getDefault().send(new RecentsActivityStartingEvent());
}
use of com.android.systemui.recents.RecentsActivityLaunchState in project android_frameworks_base by DirtyUnicorns.
the class RecentsTvView method init.
/**
* Initialize the view.
*/
public void init(TaskStack stack) {
RecentsConfiguration config = Recents.getConfiguration();
RecentsActivityLaunchState launchState = config.getLaunchState();
mStack = stack;
mTaskStackHorizontalView.init(stack);
if (stack.getStackTaskCount() > 0) {
hideEmptyView();
} else {
showEmptyView();
}
// Layout with the new stack
requestLayout();
}
use of com.android.systemui.recents.RecentsActivityLaunchState in project android_frameworks_base by DirtyUnicorns.
the class TaskStackLayoutAlgorithm method getInitialFocusState.
/**
* Returns the default focus state.
*/
public int getInitialFocusState() {
RecentsActivityLaunchState launchState = Recents.getConfiguration().getLaunchState();
RecentsDebugFlags debugFlags = Recents.getDebugFlags();
if (debugFlags.isPagingEnabled() || launchState.launchedWithAltTab) {
return STATE_FOCUSED;
} else {
return STATE_UNFOCUSED;
}
}
use of com.android.systemui.recents.RecentsActivityLaunchState in project android_frameworks_base by DirtyUnicorns.
the class RecentsView method onReload.
/**
* Called from RecentsActivity when it is relaunched.
*/
public void onReload(boolean isResumingFromVisible, boolean isTaskStackEmpty) {
RecentsConfiguration config = Recents.getConfiguration();
RecentsActivityLaunchState launchState = config.getLaunchState();
if (mTaskStackView == null) {
isResumingFromVisible = false;
mTaskStackView = new TaskStackView(getContext());
mTaskStackView.setSystemInsets(mSystemInsets);
addView(mTaskStackView);
}
// Reset the state
mAwaitingFirstLayout = !isResumingFromVisible;
mLastTaskLaunchedWasFreeform = false;
// Update the stack
mTaskStackView.onReload(isResumingFromVisible);
if (isResumingFromVisible) {
// If we are already visible, then restore the background scrim
animateBackgroundScrim(1f, DEFAULT_UPDATE_SCRIM_DURATION);
} else {
// the tasks for the home animation.
if (launchState.launchedViaDockGesture || launchState.launchedFromApp || isTaskStackEmpty) {
mBackgroundScrim.setAlpha(255);
} else {
mBackgroundScrim.setAlpha(0);
}
}
}
Aggregations