Search in sources :

Example 1 with STATE_HANDLER_INVISIBILITY_FLAGS

use of com.android.launcher3.BaseActivity.STATE_HANDLER_INVISIBILITY_FLAGS in project android_packages_apps_Launcher3 by crdroidandroid.

the class AbsSwipeUpHandler method onActivityInit.

protected boolean onActivityInit(Boolean alreadyOnHome) {
    if (mStateCallback.hasStates(STATE_HANDLER_INVALIDATED)) {
        return false;
    }
    T createdActivity = mActivityInterface.getCreatedActivity();
    if (createdActivity != null) {
        initTransitionEndpoints(createdActivity.getDeviceProfile());
    }
    final T activity = mActivityInterface.getCreatedActivity();
    if (mActivity == activity) {
        return true;
    }
    if (mActivity != null) {
        if (mStateCallback.hasStates(STATE_GESTURE_COMPLETED)) {
            // If the activity has restarted between setting the page scroll settling callback
            // and actually receiving the callback, just mark the gesture completed
            mGestureState.setState(STATE_RECENTS_SCROLLING_FINISHED);
            return true;
        }
        // The launcher may have been recreated as a result of device rotation.
        int oldState = mStateCallback.getState() & ~LAUNCHER_UI_STATES;
        initStateCallbacks();
        mStateCallback.setState(oldState);
    }
    mWasLauncherAlreadyVisible = alreadyOnHome;
    mActivity = activity;
    // up, or until we transition home and the home animation is composed
    if (alreadyOnHome) {
        mActivity.clearForceInvisibleFlag(STATE_HANDLER_INVISIBILITY_FLAGS);
    } else {
        mActivity.addForceInvisibleFlag(STATE_HANDLER_INVISIBILITY_FLAGS);
    }
    mRecentsView = activity.getOverviewPanel();
    mRecentsView.setOnPageTransitionEndCallback(null);
    mStateCallback.setState(STATE_LAUNCHER_PRESENT);
    if (alreadyOnHome) {
        onLauncherStart();
    } else {
        activity.runOnceOnStart(this::onLauncherStart);
    }
    // Set up a entire animation lifecycle callback to notify the current recents view when
    // the animation is canceled
    mGestureState.runOnceAtState(STATE_RECENTS_ANIMATION_CANCELED, () -> {
        ThumbnailData snapshot = mGestureState.consumeRecentsAnimationCanceledSnapshot();
        if (snapshot != null) {
            mRecentsView.switchToScreenshot(snapshot, () -> {
                if (mRecentsAnimationController != null) {
                    mRecentsAnimationController.cleanupScreenshot();
                }
            });
            mRecentsView.onRecentsAnimationComplete();
        }
    });
    setupRecentsViewUi();
    linkRecentsViewScroll();
    return true;
}
Also used : LAUNCHER_QUICKSWITCH_RIGHT(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_QUICKSWITCH_RIGHT) STATE_END_TARGET_SET(com.android.quickstep.GestureState.STATE_END_TARGET_SET) LAUNCHER_QUICKSWITCH_LEFT(com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_QUICKSWITCH_LEFT) LENGTH_SHORT(android.widget.Toast.LENGTH_SHORT) ThumbnailData(com.android.systemui.shared.recents.model.ThumbnailData)

Aggregations

LENGTH_SHORT (android.widget.Toast.LENGTH_SHORT)1 LAUNCHER_QUICKSWITCH_LEFT (com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_QUICKSWITCH_LEFT)1 LAUNCHER_QUICKSWITCH_RIGHT (com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_QUICKSWITCH_RIGHT)1 STATE_END_TARGET_SET (com.android.quickstep.GestureState.STATE_END_TARGET_SET)1 ThumbnailData (com.android.systemui.shared.recents.model.ThumbnailData)1