diff options
| author | Adam Powell <adamp@google.com> | 2011-05-20 13:13:28 -0700 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2011-05-20 13:13:28 -0700 |
| commit | d0693bb603b3e79ee63421fa145380e926734cc7 (patch) | |
| tree | c67a0583434f2b7f1cf3733634c664c8cd38e79f | |
| parent | 24ff7fae02f5aac80c60f72b0e001c218565a316 (diff) | |
| parent | f2004180f828584fa8525081a248e8c0f2055327 (diff) | |
| download | frameworks_base-d0693bb603b3e79ee63421fa145380e926734cc7.zip frameworks_base-d0693bb603b3e79ee63421fa145380e926734cc7.tar.gz frameworks_base-d0693bb603b3e79ee63421fa145380e926734cc7.tar.bz2 | |
am f2004180: am f5abccef: am 73a31ec9: Merge "New opaque cab assets; search dialog tweaks." into honeycomb-mr2
* commit 'f2004180f828584fa8525081a248e8c0f2055327':
New opaque cab assets; search dialog tweaks.
15 files changed, 47 insertions, 10 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) { diff --git a/core/res/res/drawable-hdpi/cab_background_dark.9.png b/core/res/res/drawable-hdpi/cab_background_dark.9.png Binary files differdeleted file mode 100644 index bc5db49..0000000 --- a/core/res/res/drawable-hdpi/cab_background_dark.9.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/cab_background_light.9.png b/core/res/res/drawable-hdpi/cab_background_light.9.png Binary files differdeleted file mode 100644 index 1f45bc9..0000000 --- a/core/res/res/drawable-hdpi/cab_background_light.9.png +++ /dev/null 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 Binary files differnew file mode 100644 index 0000000..0f4c3c3 --- /dev/null +++ b/core/res/res/drawable-hdpi/cab_background_opaque_holo_dark.9.png 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 Binary files differnew file mode 100644 index 0000000..fb9b831 --- /dev/null +++ b/core/res/res/drawable-hdpi/cab_background_opaque_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/cab_background_dark.9.png b/core/res/res/drawable-mdpi/cab_background_dark.9.png Binary files differdeleted file mode 100644 index 253b12c..0000000 --- a/core/res/res/drawable-mdpi/cab_background_dark.9.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/cab_background_light.9.png b/core/res/res/drawable-mdpi/cab_background_light.9.png Binary files differdeleted file mode 100644 index aaccdfb..0000000 --- a/core/res/res/drawable-mdpi/cab_background_light.9.png +++ /dev/null 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 Binary files differnew file mode 100644 index 0000000..013319c --- /dev/null +++ b/core/res/res/drawable-mdpi/cab_background_opaque_holo_dark.9.png 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 Binary files differnew file mode 100644 index 0000000..6d8861a --- /dev/null +++ b/core/res/res/drawable-mdpi/cab_background_opaque_holo_light.9.png 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 Binary files differnew file mode 100644 index 0000000..e2b604b --- /dev/null +++ b/core/res/res/drawable-xhdpi/cab_background_opaque_holo_dark.9.png 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 Binary files differnew file mode 100644 index 0000000..0c1aeaa --- /dev/null +++ b/core/res/res/drawable-xhdpi/cab_background_opaque_holo_light.9.png diff --git a/core/res/res/layout/search_bar.xml b/core/res/res/layout/search_bar.xml index 9cf08ea..7918a3f 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"> <RelativeLayout diff --git a/core/res/res/values/arrays.xml b/core/res/res/values/arrays.xml index 9073531..810c3b2 100644 --- a/core/res/res/values/arrays.xml +++ b/core/res/res/values/arrays.xml @@ -233,7 +233,10 @@ <item>@drawable/btn_cab_done_focused_holo</item> <item>@drawable/btn_cab_done_holo</item> <item>@drawable/btn_cab_done_pressed_holo</item> - <item>@drawable/cab_background_light</item> + <item>@drawable/cab_background_holo_dark</item> + <item>@drawable/cab_background_holo_light</item> + <item>@drawable/cab_background_opaque_holo_dark</item> + <item>@drawable/cab_background_opaque_holo_light</item> <item>@drawable/cab_ic_close_focused_holo</item> <item>@drawable/cab_ic_close_holo</item> <item>@drawable/cab_ic_close_normal_holo</item> diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 2bb3e83..6c18089 100755 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -752,6 +752,9 @@ <!-- SearchView text field background for the right section --> <attr name="searchViewTextFieldRight" format="reference" /> + <!-- Theme to use for Search Dialogs --> + <attr name="searchDialogTheme" format="reference" /> + <!-- Specifies a drawable to use for the 'home as up' indicator. --> <attr name="homeAsUpIndicator" format="reference" /> diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml index cdfdd11..aa9ddff 100644 --- a/core/res/res/values/themes.xml +++ b/core/res/res/values/themes.xml @@ -262,7 +262,7 @@ <item name="actionDropDownStyle">@android:style/Widget.Spinner.DropDown</item> <item name="actionButtonStyle">@android:style/Widget.ActionButton</item> <item name="actionOverflowButtonStyle">@android:style/Widget.ActionButton.Overflow</item> - <item name="actionModeBackground">@android:drawable/cab_background_dark</item> + <item name="actionModeBackground">@android:drawable/cab_background_opaque_holo_dark</item> <item name="actionModeCloseDrawable">@android:drawable/ic_menu_close_clear_cancel</item> <item name="actionModeCutDrawable">@android:drawable/ic_menu_cut_holo_dark</item> <item name="actionModeCopyDrawable">@android:drawable/ic_menu_copy_holo_dark</item> @@ -298,6 +298,8 @@ <item name="searchViewEditQuery">@android:drawable/ic_commit</item> <item name="searchViewEditQueryBackground">?attr/selectableItemBackground</item> + <item name="searchDialogTheme">@style/Theme.SearchBar</item> + <!-- PreferenceFrameLayout attributes --> <item name="preferenceFrameLayoutStyle">@android:style/Widget.PreferenceFrameLayout</item> @@ -397,7 +399,7 @@ <item name="actionModeShareDrawable">@android:drawable/ic_menu_share_holo_light</item> <item name="actionModeFindDrawable">@android:drawable/ic_menu_find_holo_light</item> <item name="actionModeWebSearchDrawable">@android:drawable/ic_menu_search_holo_light</item> - <item name="actionModeBackground">@android:drawable/cab_background_light</item> + <item name="actionModeBackground">@android:drawable/cab_background_opaque_holo_light</item> <!-- SearchView attributes --> <item name="searchDropdownBackground">@android:drawable/search_dropdown_light</item> @@ -687,12 +689,24 @@ <!-- Theme for the search input bar. --> <style name="Theme.SearchBar" parent="Theme.Holo.Light.Panel"> <item name="windowContentOverlay">@null</item> + <item name="actionModeBackground">@android:drawable/cab_background_opaque_holo_light</item> </style> - + + <style name="Theme.Holo.SearchBar" parent="Theme.Holo.Panel"> + <item name="windowContentOverlay">@null</item> + <item name="actionModeBackground">@android:drawable/cab_background_opaque_holo_dark</item> + </style> + + <style name="Theme.Holo.Light.SearchBar" parent="Theme.Holo.Light.Panel"> + <item name="windowContentOverlay">@null</item> + <item name="actionModeBackground">@android:drawable/cab_background_opaque_holo_light</item> + </style> + <!-- Theme for the search input bar when doing global search. The only difference from non-global search is that we do not dim the background. --> <style name="Theme.GlobalSearchBar" parent="Theme.Panel"> <item name="windowContentOverlay">@null</item> + <item name="actionModeBackground">@android:drawable/cab_background_opaque_holo_light</item> </style> <!-- Menu Themes --> @@ -1028,6 +1042,8 @@ <!-- SearchView attributes --> <item name="searchDropdownBackground">@android:drawable/search_dropdown_dark</item> + <item name="searchDialogTheme">@style/Theme.Holo.SearchBar</item> + <!-- PreferenceFrameLayout attributes --> <item name="preferenceFrameLayoutStyle">@android:style/Widget.Holo.PreferenceFrameLayout</item> @@ -1313,6 +1329,8 @@ <!-- SearchView attributes --> <item name="searchDropdownBackground">@android:drawable/search_dropdown_light</item> + <item name="searchDialogTheme">@style/Theme.Holo.Light.SearchBar</item> + <!-- NumberPicker attributes and styles--> <item name="numberPickerUpButtonStyle">@style/Widget.Holo.Light.ImageButton.NumberPickerUpButton</item> <item name="numberPickerDownButtonStyle">@style/Widget.Holo.Light.ImageButton.NumberPickerDownButton</item> |
