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;
}
Aggregations