mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
Merge "Quickstep onboarding backward compatibility for devices release with Android N & O." into ub-launcher3-edmonton
This commit is contained in:
committed by
Android (Google) Code Review
commit
9b83fe225d
@@ -16,7 +16,6 @@
|
||||
package com.android.launcher3.uioverrides;
|
||||
|
||||
import static com.android.launcher3.LauncherAnimUtils.ALL_APPS_TRANSITION_MS;
|
||||
import static com.android.launcher3.allapps.DiscoveryBounce.SHELF_BOUNCE_SEEN;
|
||||
import static com.android.launcher3.anim.Interpolators.DEACCEL_2;
|
||||
|
||||
import android.view.View;
|
||||
@@ -47,10 +46,6 @@ public class AllAppsState extends LauncherState {
|
||||
|
||||
@Override
|
||||
public void onStateEnabled(Launcher launcher) {
|
||||
if (!launcher.getSharedPrefs().getBoolean(SHELF_BOUNCE_SEEN, false)) {
|
||||
launcher.getSharedPrefs().edit().putBoolean(SHELF_BOUNCE_SEEN, true).apply();
|
||||
}
|
||||
|
||||
AbstractFloatingView.closeAllOpenViews(launcher);
|
||||
dispatchWindowStateChanged(launcher);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
package com.android.launcher3.uioverrides;
|
||||
|
||||
import static com.android.launcher3.LauncherAnimUtils.OVERVIEW_TRANSITION_MS;
|
||||
import static com.android.launcher3.allapps.DiscoveryBounce.HOME_BOUNCE_SEEN;
|
||||
import static com.android.launcher3.anim.Interpolators.DEACCEL_2;
|
||||
import static com.android.launcher3.states.RotationHelper.REQUEST_ROTATE;
|
||||
|
||||
@@ -59,10 +58,6 @@ public class OverviewState extends LauncherState {
|
||||
|
||||
@Override
|
||||
public void onStateEnabled(Launcher launcher) {
|
||||
if (!launcher.getSharedPrefs().getBoolean(HOME_BOUNCE_SEEN, false)) {
|
||||
launcher.getSharedPrefs().edit().putBoolean(HOME_BOUNCE_SEEN, true).apply();
|
||||
}
|
||||
|
||||
RecentsView rv = launcher.getOverviewPanel();
|
||||
rv.setOverviewStateEnabled(true);
|
||||
AbstractFloatingView.closeAllOpenViews(launcher);
|
||||
|
||||
@@ -21,6 +21,8 @@ import static com.android.launcher3.AbstractFloatingView.TYPE_HIDE_BACK_BUTTON;
|
||||
import static com.android.launcher3.LauncherState.ALL_APPS;
|
||||
import static com.android.launcher3.LauncherState.NORMAL;
|
||||
import static com.android.launcher3.LauncherState.OVERVIEW;
|
||||
import static com.android.launcher3.allapps.DiscoveryBounce.HOME_BOUNCE_SEEN;
|
||||
import static com.android.launcher3.allapps.DiscoveryBounce.SHELF_BOUNCE_SEEN;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
@@ -28,6 +30,7 @@ import com.android.launcher3.AbstractFloatingView;
|
||||
import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.Launcher;
|
||||
import com.android.launcher3.LauncherState;
|
||||
import com.android.launcher3.LauncherStateManager;
|
||||
import com.android.launcher3.LauncherStateManager.StateHandler;
|
||||
import com.android.launcher3.anim.AnimatorPlaybackController;
|
||||
import com.android.launcher3.util.TouchController;
|
||||
@@ -89,6 +92,55 @@ public class UiFactory {
|
||||
recents.reset();
|
||||
}
|
||||
|
||||
public static void onCreate(Launcher launcher) {
|
||||
if (!launcher.getSharedPrefs().getBoolean(HOME_BOUNCE_SEEN, false)) {
|
||||
launcher.getStateManager().addStateListener(new LauncherStateManager.StateListener() {
|
||||
@Override
|
||||
public void onStateSetImmediately(LauncherState state) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStateTransitionStart(LauncherState toState) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStateTransitionComplete(LauncherState finalState) {
|
||||
boolean swipeUpEnabled = OverviewInteractionState.getInstance(launcher)
|
||||
.isSwipeUpGestureEnabled();
|
||||
LauncherState prevState = launcher.getStateManager().getLastState();
|
||||
|
||||
if (((swipeUpEnabled && finalState == OVERVIEW) || (!swipeUpEnabled
|
||||
&& finalState == ALL_APPS && prevState == NORMAL))) {
|
||||
launcher.getSharedPrefs().edit().putBoolean(HOME_BOUNCE_SEEN, true).apply();
|
||||
launcher.getStateManager().removeStateListener(this);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (!launcher.getSharedPrefs().getBoolean(SHELF_BOUNCE_SEEN, false)) {
|
||||
launcher.getStateManager().addStateListener(new LauncherStateManager.StateListener() {
|
||||
@Override
|
||||
public void onStateSetImmediately(LauncherState state) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStateTransitionStart(LauncherState toState) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStateTransitionComplete(LauncherState finalState) {
|
||||
LauncherState prevState = launcher.getStateManager().getLastState();
|
||||
|
||||
if (finalState == ALL_APPS && prevState == OVERVIEW) {
|
||||
launcher.getSharedPrefs().edit().putBoolean(SHELF_BOUNCE_SEEN, true).apply();
|
||||
launcher.getStateManager().removeStateListener(this);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public static void onStart(Context context) {
|
||||
RecentsModel model = RecentsModel.getInstance(context);
|
||||
if (model != null) {
|
||||
|
||||
Reference in New Issue
Block a user