Changing the format for device profile definition

Device profiles are defined such that the grid size is fixed
and only the icon and text sizes change. For every grid size option
there are multiple display configurations.

Bug: 118758696
Change-Id: I54aac9106c576324b02530913c447e849b4ae1da
This commit is contained in:
Sunny Goyal committed 2018-12-07 00:06:25 -08:00
1 parent dab230f63c
commit 415f173331
15 files changed
+397 -479

No files matched your search

@@ -44,7 +44,6 @@ import com.android.launcher3.LauncherSettings;
import com.android.launcher3.LauncherSettings.Favorites;
import com.android.launcher3.LauncherSettings.Settings;
import com.android.launcher3.LauncherSettings.WorkspaceScreens;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.Workspace;
import com.android.launcher3.compat.UserManagerCompat;
@@ -378,18 +377,13 @@ public class ImportDataTask {
return false;
}
private static int getMyHotseatLayoutId(Context context) {
return LauncherAppState.getIDP(context).numHotseatIcons <= 5
? R.xml.dw_phone_hotseat
: R.xml.dw_tablet_hotseat;
}
/**
* Extension of {@link DefaultLayoutParser} which only allows icons and shortcuts.
*/
private static class HotseatLayoutParser extends DefaultLayoutParser {
public HotseatLayoutParser(Context context, LayoutParserCallback callback) {
super(context, null, callback, context.getResources(), getMyHotseatLayoutId(context));
super(context, null, callback, context.getResources(),
LauncherAppState.getIDP(context).defaultLayoutId);
}
@Override
@@ -434,6 +428,12 @@ public class ImportDataTask {
// No need to add more items.
return 0;
}
if (!Integer.valueOf(Favorites.CONTAINER_HOTSEAT)
.equals(values.getAsInteger(Favorites.CONTAINER))) {
// Ignore items which are not for hotseat.
return 0;
}
Intent intent;
try {
intent = Intent.parseUri(values.getAsString(Favorites.INTENT), 0);