Search in sources :

Example 1 with ConfigurationChangedEvent

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

the class RecentsActivity method onMultiWindowModeChanged.

@Override
public void onMultiWindowModeChanged(boolean isInMultiWindowMode) {
    super.onMultiWindowModeChanged(isInMultiWindowMode);
    // Reload the task stack completely
    RecentsConfiguration config = Recents.getConfiguration();
    RecentsActivityLaunchState launchState = config.getLaunchState();
    RecentsTaskLoader loader = Recents.getTaskLoader();
    RecentsTaskLoadPlan loadPlan = loader.createLoadPlan(this);
    loader.preloadTasks(loadPlan, -1, /* runningTaskId */
    false);
    RecentsTaskLoadPlan.Options loadOpts = new RecentsTaskLoadPlan.Options();
    loadOpts.numVisibleTasks = launchState.launchedNumVisibleTasks;
    loadOpts.numVisibleTaskThumbnails = launchState.launchedNumVisibleThumbnails;
    loader.loadTasks(this, loadPlan, loadOpts);
    TaskStack stack = loadPlan.getTaskStack();
    int numStackTasks = stack.getStackTaskCount();
    boolean showDeferredAnimation = numStackTasks > 0;
    EventBus.getDefault().send(new ConfigurationChangedEvent(true, /* fromMultiWindow */
    false, /* fromDeviceOrientationChange */
    false, /* fromDisplayDensityChange */
    numStackTasks > 0));
    EventBus.getDefault().send(new MultiWindowStateChangedEvent(isInMultiWindowMode, showDeferredAnimation, stack));
}
Also used : ActivityOptions(android.app.ActivityOptions) ConfigurationChangedEvent(com.android.systemui.recents.events.activity.ConfigurationChangedEvent) TaskStack(com.android.systemui.recents.model.TaskStack) RecentsTaskLoadPlan(com.android.systemui.recents.model.RecentsTaskLoadPlan) RecentsTaskLoader(com.android.systemui.recents.model.RecentsTaskLoader) MultiWindowStateChangedEvent(com.android.systemui.recents.events.activity.MultiWindowStateChangedEvent)

Example 2 with ConfigurationChangedEvent

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

the class RecentsActivity method onMultiWindowModeChanged.

@Override
public void onMultiWindowModeChanged(boolean isInMultiWindowMode) {
    super.onMultiWindowModeChanged(isInMultiWindowMode);
    // Reload the task stack completely
    RecentsConfiguration config = Recents.getConfiguration();
    RecentsActivityLaunchState launchState = config.getLaunchState();
    RecentsTaskLoader loader = Recents.getTaskLoader();
    RecentsTaskLoadPlan loadPlan = loader.createLoadPlan(this);
    loader.preloadTasks(loadPlan, -1, /* runningTaskId */
    false);
    RecentsTaskLoadPlan.Options loadOpts = new RecentsTaskLoadPlan.Options();
    loadOpts.numVisibleTasks = launchState.launchedNumVisibleTasks;
    loadOpts.numVisibleTaskThumbnails = launchState.launchedNumVisibleThumbnails;
    loader.loadTasks(this, loadPlan, loadOpts);
    TaskStack stack = loadPlan.getTaskStack();
    int numStackTasks = stack.getStackTaskCount();
    boolean showDeferredAnimation = numStackTasks > 0;
    EventBus.getDefault().send(new ConfigurationChangedEvent(true, /* fromMultiWindow */
    false, /* fromDeviceOrientationChange */
    false, /* fromDisplayDensityChange */
    numStackTasks > 0));
    EventBus.getDefault().send(new MultiWindowStateChangedEvent(isInMultiWindowMode, showDeferredAnimation, stack));
}
Also used : ActivityOptions(android.app.ActivityOptions) ConfigurationChangedEvent(com.android.systemui.recents.events.activity.ConfigurationChangedEvent) TaskStack(com.android.systemui.recents.model.TaskStack) RecentsTaskLoadPlan(com.android.systemui.recents.model.RecentsTaskLoadPlan) RecentsTaskLoader(com.android.systemui.recents.model.RecentsTaskLoader) MultiWindowStateChangedEvent(com.android.systemui.recents.events.activity.MultiWindowStateChangedEvent)

Example 3 with ConfigurationChangedEvent

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

the class RecentsActivity method onMultiWindowModeChanged.

@Override
public void onMultiWindowModeChanged(boolean isInMultiWindowMode) {
    super.onMultiWindowModeChanged(isInMultiWindowMode);
    // Reload the task stack completely
    RecentsConfiguration config = Recents.getConfiguration();
    RecentsActivityLaunchState launchState = config.getLaunchState();
    RecentsTaskLoader loader = Recents.getTaskLoader();
    RecentsTaskLoadPlan loadPlan = loader.createLoadPlan(this);
    loader.preloadTasks(loadPlan, -1, /* runningTaskId */
    false);
    RecentsTaskLoadPlan.Options loadOpts = new RecentsTaskLoadPlan.Options();
    loadOpts.numVisibleTasks = launchState.launchedNumVisibleTasks;
    loadOpts.numVisibleTaskThumbnails = launchState.launchedNumVisibleThumbnails;
    loader.loadTasks(this, loadPlan, loadOpts);
    TaskStack stack = loadPlan.getTaskStack();
    int numStackTasks = stack.getStackTaskCount();
    boolean showDeferredAnimation = numStackTasks > 0;
    EventBus.getDefault().send(new ConfigurationChangedEvent(true, /* fromMultiWindow */
    false, /* fromDeviceOrientationChange */
    false, /* fromDisplayDensityChange */
    numStackTasks > 0));
    EventBus.getDefault().send(new MultiWindowStateChangedEvent(isInMultiWindowMode, showDeferredAnimation, stack));
}
Also used : ActivityOptions(android.app.ActivityOptions) ConfigurationChangedEvent(com.android.systemui.recents.events.activity.ConfigurationChangedEvent) TaskStack(com.android.systemui.recents.model.TaskStack) RecentsTaskLoadPlan(com.android.systemui.recents.model.RecentsTaskLoadPlan) RecentsTaskLoader(com.android.systemui.recents.model.RecentsTaskLoader) MultiWindowStateChangedEvent(com.android.systemui.recents.events.activity.MultiWindowStateChangedEvent)

Example 4 with ConfigurationChangedEvent

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

the class RecentsActivity method onConfigurationChanged.

@Override
public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);
    // Notify of the config change
    Configuration newDeviceConfiguration = Utilities.getAppConfiguration(this);
    int numStackTasks = mRecentsView.getStack().getStackTaskCount();
    EventBus.getDefault().send(new ConfigurationChangedEvent(false, /* fromMultiWindow */
    mLastDeviceOrientation != newDeviceConfiguration.orientation, mLastDisplayDensity != newDeviceConfiguration.densityDpi, numStackTasks > 0));
    mLastDeviceOrientation = newDeviceConfiguration.orientation;
    mLastDisplayDensity = newDeviceConfiguration.densityDpi;
}
Also used : ConfigurationChangedEvent(com.android.systemui.recents.events.activity.ConfigurationChangedEvent) Configuration(android.content.res.Configuration)

Example 5 with ConfigurationChangedEvent

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

the class RecentsActivity method onConfigurationChanged.

@Override
public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);
    // Notify of the config change
    Configuration newDeviceConfiguration = Utilities.getAppConfiguration(this);
    int numStackTasks = mRecentsView.getStack().getStackTaskCount();
    EventBus.getDefault().send(new ConfigurationChangedEvent(false, /* fromMultiWindow */
    mLastDeviceOrientation != newDeviceConfiguration.orientation, mLastDisplayDensity != newDeviceConfiguration.densityDpi, numStackTasks > 0));
    mLastDeviceOrientation = newDeviceConfiguration.orientation;
    mLastDisplayDensity = newDeviceConfiguration.densityDpi;
}
Also used : ConfigurationChangedEvent(com.android.systemui.recents.events.activity.ConfigurationChangedEvent) Configuration(android.content.res.Configuration)

Aggregations

ConfigurationChangedEvent (com.android.systemui.recents.events.activity.ConfigurationChangedEvent)10 ActivityOptions (android.app.ActivityOptions)5 Configuration (android.content.res.Configuration)5 MultiWindowStateChangedEvent (com.android.systemui.recents.events.activity.MultiWindowStateChangedEvent)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