summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-08-27 21:12:55 (GMT)
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-08-27 21:12:55 (GMT)
commit195a29834f866806a592bae42c8f16f71b6f64aa (patch)
tree63035dedd63b740cfeb590ff1e4d62e72da8bb1d
parent027d30007d6c4448f3d07ccfb880eb0f25178314 (diff)
parent995685913955f33b05fdc0b473df901f2b0652c0 (diff)
downloadandroid_packages_apps_Trebuchet-195a29834f866806a592bae42c8f16f71b6f64aa.zip
android_packages_apps_Trebuchet-195a29834f866806a592bae42c8f16f71b6f64aa.tar.gz
android_packages_apps_Trebuchet-195a29834f866806a592bae42c8f16f71b6f64aa.tar.bz2
Merge "Adding viewId for the QSB" into ub-launcher3-burnaby
-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);
}