Search in sources :

Example 56 with RecentsActivityLaunchState

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();
            }
        });
    }
}
Also used : RecentsActivityLaunchState(com.android.systemui.recents.RecentsActivityLaunchState)

Example 57 with RecentsActivityLaunchState

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());
}
Also used : RecentsActivityStartingEvent(com.android.systemui.recents.events.activity.RecentsActivityStartingEvent) RecentsActivityLaunchState(com.android.systemui.recents.RecentsActivityLaunchState) RecentsConfiguration(com.android.systemui.recents.RecentsConfiguration) Intent(android.content.Intent)

Example 58 with RecentsActivityLaunchState

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();
}
Also used : RecentsActivityLaunchState(com.android.systemui.recents.RecentsActivityLaunchState) RecentsConfiguration(com.android.systemui.recents.RecentsConfiguration)

Example 59 with RecentsActivityLaunchState

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;
    }
}
Also used : RecentsActivityLaunchState(com.android.systemui.recents.RecentsActivityLaunchState) RecentsDebugFlags(com.android.systemui.recents.RecentsDebugFlags)

Example 60 with RecentsActivityLaunchState

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);
        }
    }
}
Also used : RecentsActivityLaunchState(com.android.systemui.recents.RecentsActivityLaunchState) RecentsConfiguration(com.android.systemui.recents.RecentsConfiguration)

Aggregations

RecentsActivityLaunchState (com.android.systemui.recents.RecentsActivityLaunchState)75 RecentsConfiguration (com.android.systemui.recents.RecentsConfiguration)45 Task (com.android.systemui.recents.model.Task)30 SystemServicesProxy (com.android.systemui.recents.misc.SystemServicesProxy)15 TaskStack (com.android.systemui.recents.model.TaskStack)15 Resources (android.content.res.Resources)10 RecentsVisibilityChangedEvent (com.android.systemui.recents.events.component.RecentsVisibilityChangedEvent)10 ArrayList (java.util.ArrayList)10 Animator (android.animation.Animator)5 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)5 ValueAnimator (android.animation.ValueAnimator)5 ActivityOptions (android.app.ActivityOptions)5 Intent (android.content.Intent)5 Rect (android.graphics.Rect)5 View (android.view.View)5 RecentsDebugFlags (com.android.systemui.recents.RecentsDebugFlags)5 EnterRecentsWindowAnimationCompletedEvent (com.android.systemui.recents.events.activity.EnterRecentsWindowAnimationCompletedEvent)5 RecentsActivityStartingEvent (com.android.systemui.recents.events.activity.RecentsActivityStartingEvent)5 DeleteTaskDataEvent (com.android.systemui.recents.events.ui.DeleteTaskDataEvent)5 RecentsTaskLoadPlan (com.android.systemui.recents.model.RecentsTaskLoadPlan)5