Ensuring that Recents view is always loaded when going to Overview state
Change-Id: If2337a0be66f4ca68dd54954b7368f38d70a40d4
diff --git a/src/com/android/launcher3/LauncherState.java b/src/com/android/launcher3/LauncherState.java
index 670f579..472a5a9 100644
--- a/src/com/android/launcher3/LauncherState.java
+++ b/src/com/android/launcher3/LauncherState.java
@@ -27,6 +27,7 @@
import com.android.launcher3.uioverrides.AllAppsState;
import com.android.launcher3.states.SpringLoadedState;
import com.android.launcher3.uioverrides.OverviewState;
+import com.android.launcher3.uioverrides.UiFactory;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
import java.util.Arrays;
@@ -54,6 +55,9 @@
private static final LauncherState[] sAllStates = new LauncherState[4];
+ /**
+ * TODO: Create a separate class for NORMAL state.
+ */
public static final LauncherState NORMAL = new LauncherState(0, ContainerType.WORKSPACE,
0, FLAG_DISABLE_RESTORE | FLAG_WORKSPACE_ICONS_CAN_BE_DRAGGED);
@@ -175,6 +179,15 @@
return NORMAL;
}
+ /**
+ * Called when the start transition ends and the user settles on this particular state.
+ */
+ public void onStateTransitionEnd(Launcher launcher) {
+ if (this == NORMAL) {
+ UiFactory.resetOverview(launcher);
+ }
+ }
+
protected static void dispatchWindowStateChanged(Launcher launcher) {
launcher.getWindow().getDecorView().sendAccessibilityEvent(TYPE_WINDOW_STATE_CHANGED);
}