summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher/Search.java
diff options
context:
space:
mode:
authorJeffrey Sharkey <>2009-03-31 18:25:03 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-31 18:25:03 -0700
commit7bd74a410b138830effb66c688d1d17d0066339c (patch)
treee97f7993d18fe0f8421f2b568e4e5f6e76f7edc8 /src/com/android/launcher/Search.java
parent3fca10b8cd35276879e8e7361b2b9ee72377ab94 (diff)
downloadandroid_packages_apps_Trebuchet-7bd74a410b138830effb66c688d1d17d0066339c.tar.gz
android_packages_apps_Trebuchet-7bd74a410b138830effb66c688d1d17d0066339c.tar.bz2
android_packages_apps_Trebuchet-7bd74a410b138830effb66c688d1d17d0066339c.zip
AI 143908: am: CL 143907 Make search widget drop-down wider.
Original author: jsharkey Merged from: //branches/cupcake/... Automated import of CL 143908
Diffstat (limited to 'src/com/android/launcher/Search.java')
-rw-r--r--src/com/android/launcher/Search.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/com/android/launcher/Search.java b/src/com/android/launcher/Search.java
index 97dcd980b..71ab7ef44 100644
--- a/src/com/android/launcher/Search.java
+++ b/src/com/android/launcher/Search.java
@@ -329,6 +329,33 @@ public class Search extends LinearLayout implements OnClickListener, OnKeyListen
}
/**
+ * Cache of popup padding value after read from {@link Resources}.
+ */
+ private static float mPaddingInset = -1;
+
+ /**
+ * When our size is changed, pass down adjusted width and offset values to
+ * correctly center the {@link AutoCompleteTextView} popup and include our
+ * padding.
+ */
+ @Override
+ protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
+ super.onLayout(changed, left, top, right, bottom);
+ if (changed) {
+ if (mPaddingInset == -1) {
+ mPaddingInset = getResources().getDimension(R.dimen.search_widget_inset);
+ }
+
+ // Fill entire width of widget, minus padding inset
+ float paddedWidth = getWidth() - (mPaddingInset * 2);
+ float paddedOffset = -(mSearchText.getLeft() - mPaddingInset);
+
+ mSearchText.setDropDownWidth((int) paddedWidth);
+ mSearchText.setDropDownHorizontalOffset((int) paddedOffset);
+ }
+ }
+
+ /**
* Read the searchable info from the search manager
*/
private void configureSearchableInfo() {