From 8abebcde3fd2317b25629263db6ad4637c8eeb34 Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Thu, 19 May 2011 18:46:47 -0700 Subject: New opaque cab assets; search dialog tweaks. * New opaque assets (now actually opaque!) * SearchDialog determines theme to use from parent context * SearchDialog now disallows action modes Change-Id: If05fe64d7cc4460678d78412275ee988ddb47e9e --- core/java/android/app/SearchDialog.java | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'core/java/android/app/SearchDialog.java') diff --git a/core/java/android/app/SearchDialog.java b/core/java/android/app/SearchDialog.java index db8d5e9..9cb57be 100644 --- a/core/java/android/app/SearchDialog.java +++ b/core/java/android/app/SearchDialog.java @@ -29,12 +29,13 @@ import android.content.res.Configuration; import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Bundle; -import android.os.SystemClock; import android.speech.RecognizerIntent; import android.text.InputType; import android.text.TextUtils; import android.util.AttributeSet; import android.util.Log; +import android.util.TypedValue; +import android.view.ActionMode; import android.view.Gravity; import android.view.KeyEvent; import android.view.MotionEvent; @@ -50,9 +51,6 @@ import android.widget.LinearLayout; import android.widget.SearchView; import android.widget.TextView; -import java.util.WeakHashMap; -import java.util.concurrent.atomic.AtomicLong; - /** * Search dialog. This is controlled by the * SearchManager and runs in the current foreground process. @@ -110,13 +108,20 @@ public class SearchDialog extends Dialog { } }; + static int resolveDialogTheme(Context context) { + TypedValue outValue = new TypedValue(); + context.getTheme().resolveAttribute(com.android.internal.R.attr.searchDialogTheme, + outValue, true); + return outValue.resourceId; + } + /** * Constructor - fires it up and makes it look like the search UI. * * @param context Application Context we can use for system acess */ public SearchDialog(Context context, SearchManager searchManager) { - super(context, com.android.internal.R.style.Theme_SearchBar); + super(context, resolveDialogTheme(context)); // Save voice intent for later queries/launching mVoiceWebSearchIntent = new Intent(RecognizerIntent.ACTION_WEB_SEARCH); @@ -642,6 +647,14 @@ public class SearchDialog extends Dialog { } return super.dispatchKeyEventPreIme(event); } + + /** + * Don't allow action modes in a SearchBar, it looks silly. + */ + @Override + public ActionMode startActionModeForChild(View child, ActionMode.Callback callback) { + return null; + } } private boolean isEmpty(AutoCompleteTextView actv) { -- cgit v1.1