use of com.android.launcher3.LauncherState in project android_packages_apps_Launcher3 by crdroidandroid.
the class QuickstepLauncher method onStateOrResumeChanging.
/**
* Recents logic that triggers when launcher state changes or launcher activity stops/resumes.
*/
private void onStateOrResumeChanging(boolean inTransition) {
LauncherState state = getStateManager().getState();
boolean started = ((getActivityFlags() & ACTIVITY_STATE_STARTED)) != 0;
if (started) {
DeviceProfile profile = getDeviceProfile();
boolean willUserBeActive = (getActivityFlags() & ACTIVITY_STATE_USER_WILL_BE_ACTIVE) != 0;
boolean visible = (state == NORMAL || state == OVERVIEW) && (willUserBeActive || isUserActive()) && !profile.isVerticalBarLayout() && profile.isPhone && !profile.isLandscape;
UiThreadHelper.runAsyncCommand(this, SET_SHELF_HEIGHT, visible ? 1 : 0, profile.hotseatBarSizePx);
}
if (state == NORMAL && !inTransition) {
((RecentsView) getOverviewPanel()).setSwipeDownShouldLaunchApp(false);
}
}
use of com.android.launcher3.LauncherState in project android_packages_apps_Launcher3 by crdroidandroid.
the class AbstractStateChangeTouchController method getSwipeDirection.
private int getSwipeDirection() {
LauncherState fromState = mLauncher.getStateManager().getState();
int swipeDirection = 0;
if (getTargetState(fromState, true) != fromState) {
swipeDirection |= SingleAxisSwipeDetector.DIRECTION_POSITIVE;
}
if (getTargetState(fromState, false) != fromState) {
swipeDirection |= SingleAxisSwipeDetector.DIRECTION_NEGATIVE;
}
return swipeDirection;
}
use of com.android.launcher3.LauncherState in project android_packages_apps_Launcher3 by crdroidandroid.
the class StaggeredWorkspaceAnim method addDepthAnimationForState.
private void addDepthAnimationForState(Launcher launcher, LauncherState state, long duration) {
if (!(launcher instanceof BaseQuickstepLauncher)) {
return;
}
PendingAnimation builder = new PendingAnimation(duration);
DepthController depthController = ((BaseQuickstepLauncher) launcher).getDepthController();
depthController.setStateWithAnimation(state, new StateAnimationConfig(), builder);
mAnimators.play(builder.buildAnim());
}
use of com.android.launcher3.LauncherState in project android_packages_apps_Launcher3 by crdroidandroid.
the class LauncherRecentsView method setOverviewStateEnabled.
@Override
public void setOverviewStateEnabled(boolean enabled) {
super.setOverviewStateEnabled(enabled);
if (enabled) {
LauncherState state = mActivity.getStateManager().getState();
boolean hasClearAllButton = (state.getVisibleElements(mActivity) & CLEAR_ALL_BUTTON) != 0;
setDisallowScrollToClearAll(!hasClearAllButton);
}
}
use of com.android.launcher3.LauncherState in project android_packages_apps_Launcher3 by crdroidandroid.
the class AbstractStateChangeTouchController method reinitCurrentAnimation.
private boolean reinitCurrentAnimation(boolean reachedToState, boolean isDragTowardPositive) {
LauncherState newFromState = mFromState == null ? mLauncher.getStateManager().getState() : reachedToState ? mToState : mFromState;
LauncherState newToState = getTargetState(newFromState, isDragTowardPositive);
onReinitToState(newToState);
if (newFromState == mFromState && newToState == mToState || (newFromState == newToState)) {
return false;
}
mFromState = newFromState;
mToState = newToState;
mStartProgress = 0;
if (mCurrentAnimation != null) {
mCurrentAnimation.getTarget().removeListener(mClearStateOnCancelListener);
}
mProgressMultiplier = initCurrentAnimation();
mCurrentAnimation.dispatchOnStart();
return true;
}
Aggregations