summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-08-27 22:30:25 (GMT)
committerSunny Goyal <sunnygoyal@google.com>2015-08-27 22:32:05 (GMT)
commitebfae6e266590d04702441ed630704c5eb4ccaaa (patch)
tree16a5dfe809d71202f9ea4f6c8499de0612af0584
parent195a29834f866806a592bae42c8f16f71b6f64aa (diff)
downloadandroid_packages_apps_Trebuchet-ebfae6e266590d04702441ed630704c5eb4ccaaa.zip
android_packages_apps_Trebuchet-ebfae6e266590d04702441ed630704c5eb4ccaaa.tar.gz
android_packages_apps_Trebuchet-ebfae6e266590d04702441ed630704c5eb4ccaaa.tar.bz2
Revert "Adding viewId for the QSB"
Using QSB widget id from xml This reverts commit 995685913955f33b05fdc0b473df901f2b0652c0. Change-Id: I33c48cf074f2dc1cf509c2d9f1f19b40b91f6a22
-rw-r--r--res/values/config.xml3
-rw-r--r--src/com/android/launcher3/Launcher.java9
2 files changed, 5 insertions, 7 deletions
diff --git a/res/values/config.xml b/res/values/config.xml
index b2ba7a9..93c6d14 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -78,6 +78,9 @@
get build information. Can be empty. -->
<string name="build_info_class" translatable="false"></string>
+ <!-- View ID to use for QSB widget -->
+ <item type="id" name="qsb_widget" />
+
<!-- Accessibility actions -->
<item type="id" name="action_remove" />
<item type="id" name="action_uninstall" />
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index c317da4..1f843cb 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -207,8 +207,6 @@ 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";
@@ -676,10 +674,7 @@ public class Launcher extends Activity
public int getViewIdForItem(ItemInfo info) {
// This cast is safe given the > 2B range for int.
- return getViewIdForItemId((int) info.id);
- }
-
- public int getViewIdForItemId(int itemId) {
+ int itemId = (int) info.id;
if (mItemIdToViewId.containsKey(itemId)) {
return mItemIdToViewId.get(itemId);
}
@@ -3512,9 +3507,9 @@ public class Launcher extends Activity
mAppWidgetHost.setQsbWidgetId(widgetId);
if (widgetId != -1) {
mQsb = mAppWidgetHost.createView(this, widgetId, searchProvider);
+ mQsb.setId(R.id.qsb_widget);
mQsb.updateAppWidgetOptions(opts);
mQsb.setPadding(0, 0, 0, 0);
- mQsb.setId(getViewIdForItemId(QSB_ITEM_ID));
mSearchDropTargetBar.addView(mQsb);
mSearchDropTargetBar.setQsbSearchBar(mQsb);
}