summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-08-27 20:48:11 (GMT)
committerSunny Goyal <sunnygoyal@google.com>2015-08-27 20:48:30 (GMT)
commit995685913955f33b05fdc0b473df901f2b0652c0 (patch)
treec7a0ef98476d25a58f988846059cdfe5dc24f27a
parent22aa3813f818e46a096fef6490db2a60f2617eb7 (diff)
downloadandroid_packages_apps_Trebuchet-995685913955f33b05fdc0b473df901f2b0652c0.zip
android_packages_apps_Trebuchet-995685913955f33b05fdc0b473df901f2b0652c0.tar.gz
android_packages_apps_Trebuchet-995685913955f33b05fdc0b473df901f2b0652c0.tar.bz2
Adding viewId for the QSB
Change-Id: I4ad6bc8c0d94e60a4d354dfc29f456ca561fc500
-rw-r--r--src/com/android/launcher3/Launcher.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 11f5258..c317da4 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -207,6 +207,8 @@ public class Launcher extends Activity
private static final String QSB_WIDGET_ID = "qsb_widget_id";
private static final String QSB_WIDGET_PROVIDER = "qsb_widget_provider";
+ // Item id to use for QSB widget.
+ private static final int QSB_ITEM_ID = -1;
public static final String USER_HAS_MIGRATED = "launcher.user_migrated_from_old_data";
@@ -674,7 +676,10 @@ public class Launcher extends Activity
public int getViewIdForItem(ItemInfo info) {
// This cast is safe given the > 2B range for int.
- int itemId = (int) info.id;
+ return getViewIdForItemId((int) info.id);
+ }
+
+ public int getViewIdForItemId(int itemId) {
if (mItemIdToViewId.containsKey(itemId)) {
return mItemIdToViewId.get(itemId);
}
@@ -3509,6 +3514,7 @@ public class Launcher extends Activity
mQsb = mAppWidgetHost.createView(this, widgetId, searchProvider);
mQsb.updateAppWidgetOptions(opts);
mQsb.setPadding(0, 0, 0, 0);
+ mQsb.setId(getViewIdForItemId(QSB_ITEM_ID));
mSearchDropTargetBar.addView(mQsb);
mSearchDropTargetBar.setQsbSearchBar(mQsb);
}