diff --git a/core/java/android/app/SearchDialog.java b/core/java/android/app/SearchDialog.java index db8d5e93cdcf6..9cb57be92e2c9 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) { diff --git a/core/res/res/drawable-hdpi/cab_background_dark.9.png b/core/res/res/drawable-hdpi/cab_background_dark.9.png deleted file mode 100644 index bc5db49b9a459..0000000000000 Binary files a/core/res/res/drawable-hdpi/cab_background_dark.9.png and /dev/null differ diff --git a/core/res/res/drawable-hdpi/cab_background_light.9.png b/core/res/res/drawable-hdpi/cab_background_light.9.png deleted file mode 100644 index 1f45bc98ef185..0000000000000 Binary files a/core/res/res/drawable-hdpi/cab_background_light.9.png and /dev/null differ diff --git a/core/res/res/drawable-hdpi/cab_background_opaque_holo_dark.9.png b/core/res/res/drawable-hdpi/cab_background_opaque_holo_dark.9.png new file mode 100644 index 0000000000000..0f4c3c31e350d Binary files /dev/null and b/core/res/res/drawable-hdpi/cab_background_opaque_holo_dark.9.png differ diff --git a/core/res/res/drawable-hdpi/cab_background_opaque_holo_light.9.png b/core/res/res/drawable-hdpi/cab_background_opaque_holo_light.9.png new file mode 100644 index 0000000000000..fb9b8318ae07e Binary files /dev/null and b/core/res/res/drawable-hdpi/cab_background_opaque_holo_light.9.png differ diff --git a/core/res/res/drawable-mdpi/cab_background_dark.9.png b/core/res/res/drawable-mdpi/cab_background_dark.9.png deleted file mode 100644 index 253b12ce8be40..0000000000000 Binary files a/core/res/res/drawable-mdpi/cab_background_dark.9.png and /dev/null differ diff --git a/core/res/res/drawable-mdpi/cab_background_light.9.png b/core/res/res/drawable-mdpi/cab_background_light.9.png deleted file mode 100644 index aaccdfb5aec9e..0000000000000 Binary files a/core/res/res/drawable-mdpi/cab_background_light.9.png and /dev/null differ diff --git a/core/res/res/drawable-mdpi/cab_background_opaque_holo_dark.9.png b/core/res/res/drawable-mdpi/cab_background_opaque_holo_dark.9.png new file mode 100644 index 0000000000000..013319ce2dcc7 Binary files /dev/null and b/core/res/res/drawable-mdpi/cab_background_opaque_holo_dark.9.png differ diff --git a/core/res/res/drawable-mdpi/cab_background_opaque_holo_light.9.png b/core/res/res/drawable-mdpi/cab_background_opaque_holo_light.9.png new file mode 100644 index 0000000000000..6d8861ab4e46b Binary files /dev/null and b/core/res/res/drawable-mdpi/cab_background_opaque_holo_light.9.png differ diff --git a/core/res/res/drawable-xhdpi/cab_background_opaque_holo_dark.9.png b/core/res/res/drawable-xhdpi/cab_background_opaque_holo_dark.9.png new file mode 100644 index 0000000000000..e2b604ba1dbcf Binary files /dev/null and b/core/res/res/drawable-xhdpi/cab_background_opaque_holo_dark.9.png differ diff --git a/core/res/res/drawable-xhdpi/cab_background_opaque_holo_light.9.png b/core/res/res/drawable-xhdpi/cab_background_opaque_holo_light.9.png new file mode 100644 index 0000000000000..0c1aeaa2450b8 Binary files /dev/null and b/core/res/res/drawable-xhdpi/cab_background_opaque_holo_light.9.png differ diff --git a/core/res/res/layout/search_bar.xml b/core/res/res/layout/search_bar.xml index 9cf08eaf96995..7918a3fb39c17 100644 --- a/core/res/res/layout/search_bar.xml +++ b/core/res/res/layout/search_bar.xml @@ -25,7 +25,7 @@ android:layout_height="wrap_content" android:orientation="horizontal" android:focusable="true" - android:background="@drawable/cab_background_light" + android:background="?android:attr/actionModeBackground" android:descendantFocusability="afterDescendants"> @drawable/btn_cab_done_focused_holo @drawable/btn_cab_done_holo @drawable/btn_cab_done_pressed_holo - @drawable/cab_background_light + @drawable/cab_background_holo_dark + @drawable/cab_background_holo_light + @drawable/cab_background_opaque_holo_dark + @drawable/cab_background_opaque_holo_light @drawable/cab_ic_close_focused_holo @drawable/cab_ic_close_holo @drawable/cab_ic_close_normal_holo diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 004b7555f53fd..0d9190f819ea3 100755 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -734,6 +734,9 @@ + + + diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml index b127747832871..2f434ec9d8777 100644 --- a/core/res/res/values/themes.xml +++ b/core/res/res/values/themes.xml @@ -258,7 +258,7 @@ @android:style/Widget.Spinner.DropDown @android:style/Widget.ActionButton @android:style/Widget.ActionButton.Overflow - @android:drawable/cab_background_dark + @android:drawable/cab_background_opaque_holo_dark @android:drawable/ic_menu_close_clear_cancel @android:drawable/ic_menu_cut_holo_dark @android:drawable/ic_menu_copy_holo_dark @@ -294,6 +294,8 @@ @android:drawable/ic_commit ?attr/selectableItemBackground + @style/Theme.SearchBar + @android:style/Widget.PreferenceFrameLayout @@ -391,7 +393,7 @@ @android:drawable/ic_menu_share_holo_light @android:drawable/ic_menu_find_holo_light @android:drawable/ic_menu_search_holo_light - @android:drawable/cab_background_light + @android:drawable/cab_background_opaque_holo_light @android:drawable/search_dropdown_light @@ -681,12 +683,24 @@ - + + + + + @@ -1020,6 +1034,8 @@ @android:drawable/search_dropdown_dark + @style/Theme.Holo.SearchBar + @android:style/Widget.Holo.PreferenceFrameLayout @@ -1303,6 +1319,8 @@ @android:drawable/search_dropdown_light + @style/Theme.Holo.Light.SearchBar + @style/Widget.Holo.Light.ImageButton.NumberPickerUpButton @style/Widget.Holo.Light.ImageButton.NumberPickerDownButton