Search in sources :

Example 6 with PendingRequestArgs

use of com.android.launcher3.util.PendingRequestArgs in project android_packages_apps_Launcher3 by crdroidandroid.

the class Launcher method restoreState.

/**
 * Restores the previous state, if it exists.
 *
 * @param savedState The previous state.
 */
private void restoreState(Bundle savedState) {
    if (savedState == null) {
        return;
    }
    int stateOrdinal = savedState.getInt(RUNTIME_STATE, NORMAL.ordinal);
    LauncherState[] stateValues = LauncherState.values();
    LauncherState state = stateValues[stateOrdinal];
    NonConfigInstance lastInstance = (NonConfigInstance) getLastNonConfigurationInstance();
    boolean forceRestore = lastInstance != null && (lastInstance.config.diff(mOldConfig) & CONFIG_UI_MODE) != 0;
    if (forceRestore || !state.shouldDisableRestore()) {
        mStateManager.goToState(state, false);
    }
    PendingRequestArgs requestArgs = savedState.getParcelable(RUNTIME_STATE_PENDING_REQUEST_ARGS);
    if (requestArgs != null) {
        setWaitingForResult(requestArgs);
    }
    mPendingActivityRequestCode = savedState.getInt(RUNTIME_STATE_PENDING_REQUEST_CODE);
    mPendingActivityResult = savedState.getParcelable(RUNTIME_STATE_PENDING_ACTIVITY_RESULT);
    SparseArray<Parcelable> widgetsState = savedState.getSparseParcelableArray(RUNTIME_STATE_WIDGET_PANEL);
    if (widgetsState != null) {
        WidgetsFullSheet.show(this, false).restoreHierarchyState(widgetsState);
    }
}
Also used : Parcelable(android.os.Parcelable) PendingRequestArgs(com.android.launcher3.util.PendingRequestArgs)

Aggregations

AppWidgetHostView (android.appwidget.AppWidgetHostView)4 PendingRequestArgs (com.android.launcher3.util.PendingRequestArgs)4 LauncherAppWidgetHostView (com.android.launcher3.widget.LauncherAppWidgetHostView)4 PendingAppWidgetHostView (com.android.launcher3.widget.PendingAppWidgetHostView)4 View (android.view.View)3 ImageView (android.widget.ImageView)3 AllAppsContainerView (com.android.launcher3.allapps.AllAppsContainerView)3 DragView (com.android.launcher3.dragndrop.DragView)3 QsbContainerView (com.android.launcher3.qsb.QsbContainerView)3 FloatingSurfaceView (com.android.launcher3.views.FloatingSurfaceView)3 OptionsPopupView (com.android.launcher3.views.OptionsPopupView)3 ScrimView (com.android.launcher3.views.ScrimView)3 Thunk (com.android.launcher3.util.Thunk)2 PendingIntent (android.app.PendingIntent)1 Intent (android.content.Intent)1 Parcelable (android.os.Parcelable)1 DragObject (com.android.launcher3.DropTarget.DragObject)1 FolderIcon (com.android.launcher3.folder.FolderIcon)1 FolderInfo (com.android.launcher3.model.data.FolderInfo)1 LauncherAppWidgetInfo (com.android.launcher3.model.data.LauncherAppWidgetInfo)1