Merge "Adds CONTAINER_ALL_APPS to LauncherSettings.Favorites." into ub-launcher3-rvc-dev

This commit is contained in:
TreeHugger Robot 2020-05-07 00:02:55 +00:00 committed by Android (Google) Code Review
commit 98a88e00b4
3 changed files with 11 additions and 1 deletions

View File

@ -152,6 +152,7 @@ public class LauncherSettings {
public static final int CONTAINER_HOTSEAT = -101;
public static final int CONTAINER_PREDICTION = -102;
public static final int CONTAINER_HOTSEAT_PREDICTION = -103;
public static final int CONTAINER_ALL_APPS = -104;
public static final String containerToString(int container) {
switch (container) {

View File

@ -16,6 +16,8 @@
package com.android.launcher3.model.data;
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_ALL_APPS;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@ -74,7 +76,7 @@ public class AppInfo extends ItemInfoWithIcon {
public AppInfo(LauncherActivityInfo info, UserHandle user, boolean quietModeEnabled) {
this.componentName = info.getComponentName();
this.container = ItemInfo.NO_ID;
this.container = CONTAINER_ALL_APPS;
this.user = user;
intent = makeLaunchIntent(info);

View File

@ -16,6 +16,7 @@
package com.android.launcher3.model.data;
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_ALL_APPS;
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_DESKTOP;
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_HOTSEAT;
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_HOTSEAT_PREDICTION;
@ -36,6 +37,7 @@ import com.android.launcher3.LauncherSettings;
import com.android.launcher3.LauncherSettings.Favorites;
import com.android.launcher3.Workspace;
import com.android.launcher3.logger.LauncherAtom;
import com.android.launcher3.logger.LauncherAtom.AllAppsContainer;
import com.android.launcher3.logger.LauncherAtom.ContainerInfo;
import com.android.launcher3.util.ContentWriter;
@ -318,6 +320,11 @@ public class ItemInfo {
.setGridY(cellY)
.setPageIndex(screenId)));
break;
case CONTAINER_ALL_APPS:
itemBuilder.setContainerInfo(
ContainerInfo.newBuilder().setAllAppsContainer(
AllAppsContainer.getDefaultInstance()));
break;
}
}
return itemBuilder.build();