Search in sources :

Example 6 with EnterRecentsWindowAnimationCompletedEvent

use of com.android.systemui.recents.events.activity.EnterRecentsWindowAnimationCompletedEvent in project android_frameworks_base by crdroidandroid.

the class RecentsTvActivity method onEnterAnimationComplete.

@Override
public void onEnterAnimationComplete() {
    super.onEnterAnimationComplete();
    if (mLaunchedFromHome) {
        mHomeRecentsEnterExitAnimationHolder.startEnterAnimation(mPipManager.isPipShown());
    }
    EventBus.getDefault().send(new EnterRecentsWindowAnimationCompletedEvent());
}
Also used : EnterRecentsWindowAnimationCompletedEvent(com.android.systemui.recents.events.activity.EnterRecentsWindowAnimationCompletedEvent)

Example 7 with EnterRecentsWindowAnimationCompletedEvent

use of com.android.systemui.recents.events.activity.EnterRecentsWindowAnimationCompletedEvent in project android_frameworks_base by AOSPA.

the class RecentsActivity method reloadStackView.

/**
     * Reloads the stack views upon launching Recents.
     */
private void reloadStackView() {
    // If the Recents component has preloaded a load plan, then use that to prevent
    // reconstructing the task stack
    RecentsTaskLoader loader = Recents.getTaskLoader();
    RecentsTaskLoadPlan loadPlan = RecentsImpl.consumeInstanceLoadPlan();
    if (loadPlan == null) {
        loadPlan = loader.createLoadPlan(this);
    }
    // Start loading tasks according to the load plan
    RecentsConfiguration config = Recents.getConfiguration();
    RecentsActivityLaunchState launchState = config.getLaunchState();
    if (!loadPlan.hasTasks()) {
        loader.preloadTasks(loadPlan, launchState.launchedToTaskId, !launchState.launchedFromHome);
    }
    RecentsTaskLoadPlan.Options loadOpts = new RecentsTaskLoadPlan.Options();
    loadOpts.runningTaskId = launchState.launchedToTaskId;
    loadOpts.numVisibleTasks = launchState.launchedNumVisibleTasks;
    loadOpts.numVisibleTaskThumbnails = launchState.launchedNumVisibleThumbnails;
    loader.loadTasks(this, loadPlan, loadOpts);
    TaskStack stack = loadPlan.getTaskStack();
    mRecentsView.onReload(mIsVisible, stack.getTaskCount() == 0);
    mRecentsView.updateStack(stack, true);
    // Update the nav bar scrim, but defer the animation until the enter-window event
    boolean animateNavBarScrim = !launchState.launchedViaDockGesture;
    mScrimViews.updateNavBarScrim(animateNavBarScrim, stack.getTaskCount() > 0, null);
    // If this is a new instance relaunched by AM, without going through the normal mechanisms,
    // then we have to manually trigger the enter animation state
    boolean wasLaunchedByAm = !launchState.launchedFromHome && !launchState.launchedFromApp;
    if (wasLaunchedByAm) {
        EventBus.getDefault().send(new EnterRecentsWindowAnimationCompletedEvent());
    }
    // Keep track of whether we launched from the nav bar button or via alt-tab
    if (launchState.launchedWithAltTab) {
        MetricsLogger.count(this, "overview_trigger_alttab", 1);
    } else {
        MetricsLogger.count(this, "overview_trigger_nav_btn", 1);
    }
    // Keep track of whether we launched from an app or from home
    if (launchState.launchedFromApp) {
        Task launchTarget = stack.getLaunchTarget();
        int launchTaskIndexInStack = launchTarget != null ? stack.indexOfStackTask(launchTarget) : 0;
        MetricsLogger.count(this, "overview_source_app", 1);
        // If from an app, track the stack index of the app in the stack (for affiliated tasks)
        MetricsLogger.histogram(this, "overview_source_app_index", launchTaskIndexInStack);
    } else {
        MetricsLogger.count(this, "overview_source_home", 1);
    }
    // Keep track of the total stack task count
    int taskCount = mRecentsView.getStack().getTaskCount();
    MetricsLogger.histogram(this, "overview_task_count", taskCount);
    // After we have resumed, set the visible state until the next onStop() call
    mIsVisible = true;
}
Also used : EnterRecentsWindowAnimationCompletedEvent(com.android.systemui.recents.events.activity.EnterRecentsWindowAnimationCompletedEvent) ActivityOptions(android.app.ActivityOptions) TaskStack(com.android.systemui.recents.model.TaskStack) Task(com.android.systemui.recents.model.Task) RecentsTaskLoadPlan(com.android.systemui.recents.model.RecentsTaskLoadPlan) RecentsTaskLoader(com.android.systemui.recents.model.RecentsTaskLoader)

Example 8 with EnterRecentsWindowAnimationCompletedEvent

use of com.android.systemui.recents.events.activity.EnterRecentsWindowAnimationCompletedEvent in project platform_frameworks_base by android.

the class RecentsActivity method reloadStackView.

/**
     * Reloads the stack views upon launching Recents.
     */
private void reloadStackView() {
    // If the Recents component has preloaded a load plan, then use that to prevent
    // reconstructing the task stack
    RecentsTaskLoader loader = Recents.getTaskLoader();
    RecentsTaskLoadPlan loadPlan = RecentsImpl.consumeInstanceLoadPlan();
    if (loadPlan == null) {
        loadPlan = loader.createLoadPlan(this);
    }
    // Start loading tasks according to the load plan
    RecentsConfiguration config = Recents.getConfiguration();
    RecentsActivityLaunchState launchState = config.getLaunchState();
    if (!loadPlan.hasTasks()) {
        loader.preloadTasks(loadPlan, launchState.launchedToTaskId, !launchState.launchedFromHome && !launchState.launchedViaDockGesture);
    }
    RecentsTaskLoadPlan.Options loadOpts = new RecentsTaskLoadPlan.Options();
    loadOpts.runningTaskId = launchState.launchedToTaskId;
    loadOpts.numVisibleTasks = launchState.launchedNumVisibleTasks;
    loadOpts.numVisibleTaskThumbnails = launchState.launchedNumVisibleThumbnails;
    loader.loadTasks(this, loadPlan, loadOpts);
    TaskStack stack = loadPlan.getTaskStack();
    mRecentsView.onReload(mIsVisible, stack.getTaskCount() == 0);
    mRecentsView.updateStack(stack, true);
    // Update the nav bar scrim, but defer the animation until the enter-window event
    boolean animateNavBarScrim = !launchState.launchedViaDockGesture;
    mScrimViews.updateNavBarScrim(animateNavBarScrim, stack.getTaskCount() > 0, null);
    // If this is a new instance relaunched by AM, without going through the normal mechanisms,
    // then we have to manually trigger the enter animation state
    boolean wasLaunchedByAm = !launchState.launchedFromHome && !launchState.launchedFromApp;
    if (wasLaunchedByAm) {
        EventBus.getDefault().send(new EnterRecentsWindowAnimationCompletedEvent());
    }
    // Keep track of whether we launched from the nav bar button or via alt-tab
    if (launchState.launchedWithAltTab) {
        MetricsLogger.count(this, "overview_trigger_alttab", 1);
    } else {
        MetricsLogger.count(this, "overview_trigger_nav_btn", 1);
    }
    // Keep track of whether we launched from an app or from home
    if (launchState.launchedFromApp) {
        Task launchTarget = stack.getLaunchTarget();
        int launchTaskIndexInStack = launchTarget != null ? stack.indexOfStackTask(launchTarget) : 0;
        MetricsLogger.count(this, "overview_source_app", 1);
        // If from an app, track the stack index of the app in the stack (for affiliated tasks)
        MetricsLogger.histogram(this, "overview_source_app_index", launchTaskIndexInStack);
    } else {
        MetricsLogger.count(this, "overview_source_home", 1);
    }
    // Keep track of the total stack task count
    int taskCount = mRecentsView.getStack().getTaskCount();
    MetricsLogger.histogram(this, "overview_task_count", taskCount);
    // After we have resumed, set the visible state until the next onStop() call
    mIsVisible = true;
}
Also used : EnterRecentsWindowAnimationCompletedEvent(com.android.systemui.recents.events.activity.EnterRecentsWindowAnimationCompletedEvent) ActivityOptions(android.app.ActivityOptions) TaskStack(com.android.systemui.recents.model.TaskStack) Task(com.android.systemui.recents.model.Task) RecentsTaskLoadPlan(com.android.systemui.recents.model.RecentsTaskLoadPlan) RecentsTaskLoader(com.android.systemui.recents.model.RecentsTaskLoader)

Example 9 with EnterRecentsWindowAnimationCompletedEvent

use of com.android.systemui.recents.events.activity.EnterRecentsWindowAnimationCompletedEvent in project android_frameworks_base by AOSPA.

the class RecentsTvActivity method onEnterAnimationComplete.

@Override
public void onEnterAnimationComplete() {
    super.onEnterAnimationComplete();
    if (mLaunchedFromHome) {
        mHomeRecentsEnterExitAnimationHolder.startEnterAnimation(mPipManager.isPipShown());
    }
    EventBus.getDefault().send(new EnterRecentsWindowAnimationCompletedEvent());
}
Also used : EnterRecentsWindowAnimationCompletedEvent(com.android.systemui.recents.events.activity.EnterRecentsWindowAnimationCompletedEvent)

Example 10 with EnterRecentsWindowAnimationCompletedEvent

use of com.android.systemui.recents.events.activity.EnterRecentsWindowAnimationCompletedEvent in project android_frameworks_base by DirtyUnicorns.

the class RecentsActivity method reloadStackView.

/**
     * Reloads the stack views upon launching Recents.
     */
private void reloadStackView() {
    // If the Recents component has preloaded a load plan, then use that to prevent
    // reconstructing the task stack
    RecentsTaskLoader loader = Recents.getTaskLoader();
    RecentsTaskLoadPlan loadPlan = RecentsImpl.consumeInstanceLoadPlan();
    if (loadPlan == null) {
        loadPlan = loader.createLoadPlan(this);
    }
    // Start loading tasks according to the load plan
    RecentsConfiguration config = Recents.getConfiguration();
    RecentsActivityLaunchState launchState = config.getLaunchState();
    if (!loadPlan.hasTasks()) {
        loader.preloadTasks(loadPlan, launchState.launchedToTaskId, !launchState.launchedFromHome && !isInMultiWindowMode());
    }
    RecentsTaskLoadPlan.Options loadOpts = new RecentsTaskLoadPlan.Options();
    loadOpts.runningTaskId = launchState.launchedToTaskId;
    loadOpts.numVisibleTasks = launchState.launchedNumVisibleTasks;
    loadOpts.numVisibleTaskThumbnails = launchState.launchedNumVisibleThumbnails;
    loader.loadTasks(this, loadPlan, loadOpts);
    TaskStack stack = loadPlan.getTaskStack();
    mRecentsView.onReload(mIsVisible, stack.getTaskCount() == 0);
    mRecentsView.updateStack(stack, true);
    // Update the nav bar scrim, but defer the animation until the enter-window event
    boolean animateNavBarScrim = !launchState.launchedViaDockGesture;
    mScrimViews.updateNavBarScrim(animateNavBarScrim, stack.getTaskCount() > 0, null);
    mRecentsView.startFABanimation();
    // If this is a new instance relaunched by AM, without going through the normal mechanisms,
    // then we have to manually trigger the enter animation state
    boolean wasLaunchedByAm = !launchState.launchedFromHome && !launchState.launchedFromApp;
    if (wasLaunchedByAm) {
        EventBus.getDefault().send(new EnterRecentsWindowAnimationCompletedEvent());
    }
    // Keep track of whether we launched from the nav bar button or via alt-tab
    if (launchState.launchedWithAltTab) {
        MetricsLogger.count(this, "overview_trigger_alttab", 1);
    } else {
        MetricsLogger.count(this, "overview_trigger_nav_btn", 1);
    }
    // Keep track of whether we launched from an app or from home
    if (launchState.launchedFromApp) {
        Task launchTarget = stack.getLaunchTarget();
        int launchTaskIndexInStack = launchTarget != null ? stack.indexOfStackTask(launchTarget) : 0;
        MetricsLogger.count(this, "overview_source_app", 1);
        // If from an app, track the stack index of the app in the stack (for affiliated tasks)
        MetricsLogger.histogram(this, "overview_source_app_index", launchTaskIndexInStack);
    } else {
        MetricsLogger.count(this, "overview_source_home", 1);
    }
    // Keep track of the total stack task count
    int taskCount = mRecentsView.getStack().getTaskCount();
    MetricsLogger.histogram(this, "overview_task_count", taskCount);
    setImmersiveRecents();
    // After we have resumed, set the visible state until the next onStop() call
    mIsVisible = true;
}
Also used : EnterRecentsWindowAnimationCompletedEvent(com.android.systemui.recents.events.activity.EnterRecentsWindowAnimationCompletedEvent) ActivityOptions(android.app.ActivityOptions) TaskStack(com.android.systemui.recents.model.TaskStack) Task(com.android.systemui.recents.model.Task) RecentsTaskLoadPlan(com.android.systemui.recents.model.RecentsTaskLoadPlan) RecentsTaskLoader(com.android.systemui.recents.model.RecentsTaskLoader)

Aggregations

EnterRecentsWindowAnimationCompletedEvent (com.android.systemui.recents.events.activity.EnterRecentsWindowAnimationCompletedEvent)15 Task (com.android.systemui.recents.model.Task)10 ActivityOptions (android.app.ActivityOptions)5 View (android.view.View)5 RecentsActivityLaunchState (com.android.systemui.recents.RecentsActivityLaunchState)5 RecentsConfiguration (com.android.systemui.recents.RecentsConfiguration)5 RecentsVisibilityChangedEvent (com.android.systemui.recents.events.component.RecentsVisibilityChangedEvent)5 DeleteTaskDataEvent (com.android.systemui.recents.events.ui.DeleteTaskDataEvent)5 SystemServicesProxy (com.android.systemui.recents.misc.SystemServicesProxy)5 RecentsTaskLoadPlan (com.android.systemui.recents.model.RecentsTaskLoadPlan)5 RecentsTaskLoader (com.android.systemui.recents.model.RecentsTaskLoader)5 TaskStack (com.android.systemui.recents.model.TaskStack)5 RecentsTvView (com.android.systemui.recents.tv.views.RecentsTvView)5 TaskCardView (com.android.systemui.recents.tv.views.TaskCardView)5 TaskStackHorizontalGridView (com.android.systemui.recents.tv.views.TaskStackHorizontalGridView)5 AsyncTask (android.os.AsyncTask)2