Adding support for hiding widgets from the widget tray and reconfiguring widgets

> Removing AppInfo target
> Switching between uninstall and setup based on the drag view

Bug: 63931362
Change-Id: Iccd6f965fa3d61992244a365efc242122292c0ca
This commit is contained in:
Sunny Goyal
2018-02-12 14:25:48 -08:00
parent f454ded32c
commit b29a5fa55c
19 changed files with 239 additions and 172 deletions

View File

@@ -1,6 +1,8 @@
package com.android.launcher3.model;
import static android.appwidget.AppWidgetProviderInfo.WIDGET_FEATURE_HIDE_FROM_PICKER;
import android.appwidget.AppWidgetProviderInfo;
import android.content.Context;
import android.content.pm.PackageManager;
@@ -153,6 +155,11 @@ public class WidgetsModel {
// add and update.
for (WidgetItem item : rawWidgetsShortcuts) {
if (item.widgetInfo != null) {
if ((item.widgetInfo.getWidgetFeatures() & WIDGET_FEATURE_HIDE_FROM_PICKER) != 0) {
// Widget is hidden from picker
continue;
}
// Ensure that all widgets we show can be added on a workspace of this size
int minSpanX = Math.min(item.widgetInfo.spanX, item.widgetInfo.minSpanX);
int minSpanY = Math.min(item.widgetInfo.spanY, item.widgetInfo.minSpanY);