diff options
Diffstat (limited to 'src/com/android/launcher3/LauncherAppWidgetInfo.java')
-rw-r--r-- | src/com/android/launcher3/LauncherAppWidgetInfo.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/com/android/launcher3/LauncherAppWidgetInfo.java b/src/com/android/launcher3/LauncherAppWidgetInfo.java index 6f23e56b3..051846c87 100644 --- a/src/com/android/launcher3/LauncherAppWidgetInfo.java +++ b/src/com/android/launcher3/LauncherAppWidgetInfo.java @@ -71,7 +71,7 @@ public class LauncherAppWidgetInfo extends ItemInfo { /** * Indicates that this is a locally defined widget and hence has no system allocated id. */ - static final int CUSTOM_WIDGET_ID = -100; + public static final int CUSTOM_WIDGET_ID = -100; /** * Identifier for this widget when talking with @@ -104,15 +104,15 @@ public class LauncherAppWidgetInfo extends ItemInfo { private boolean mHasNotifiedInitialWidgetSizeChanged; public LauncherAppWidgetInfo(int appWidgetId, ComponentName providerName) { - if (appWidgetId == CUSTOM_WIDGET_ID) { + this.appWidgetId = appWidgetId; + this.providerName = providerName; + + if (isCustomWidget()) { itemType = LauncherSettings.Favorites.ITEM_TYPE_CUSTOM_APPWIDGET; } else { itemType = LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET; } - this.appWidgetId = appWidgetId; - this.providerName = providerName; - // Since the widget isn't instantiated yet, we don't know these values. Set them to -1 // to indicate that they should be calculated based on the layout and minWidth/minHeight spanX = -1; @@ -128,7 +128,7 @@ public class LauncherAppWidgetInfo extends ItemInfo { } public boolean isCustomWidget() { - return appWidgetId == CUSTOM_WIDGET_ID; + return appWidgetId <= CUSTOM_WIDGET_ID; } @Override |