summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/app/SearchDialog.java23
1 files changed, 18 insertions, 5 deletions
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) {