summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Adam Powell <adamp@google.com> 2011-05-20 12:59:43 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2011-05-20 12:59:43 -0700
commit73a31ec91c3e472503e9fbbfe82b8c3bbc5140ed (patch)
treea4cca32ddcf01bc265ff5d6e548138d919ca0ddd
parenta6f1104b9d829c636b60b9387e379f9667b5df09 (diff)
parent8abebcde3fd2317b25629263db6ad4637c8eeb34 (diff)
Merge "New opaque cab assets; search dialog tweaks." into honeycomb-mr2
-rw-r--r--core/java/android/app/SearchDialog.java23
-rw-r--r--core/res/res/drawable-hdpi/cab_background_dark.9.pngbin5015 -> 0 bytes
-rw-r--r--core/res/res/drawable-hdpi/cab_background_light.9.pngbin6044 -> 0 bytes
-rw-r--r--core/res/res/drawable-hdpi/cab_background_opaque_holo_dark.9.pngbin0 -> 3960 bytes
-rw-r--r--core/res/res/drawable-hdpi/cab_background_opaque_holo_light.9.pngbin0 -> 5092 bytes
-rw-r--r--core/res/res/drawable-mdpi/cab_background_dark.9.pngbin2876 -> 0 bytes
-rw-r--r--core/res/res/drawable-mdpi/cab_background_light.9.pngbin3428 -> 0 bytes
-rw-r--r--core/res/res/drawable-mdpi/cab_background_opaque_holo_dark.9.pngbin0 -> 2353 bytes
-rw-r--r--core/res/res/drawable-mdpi/cab_background_opaque_holo_light.9.pngbin0 -> 3024 bytes
-rw-r--r--core/res/res/drawable-xhdpi/cab_background_opaque_holo_dark.9.pngbin0 -> 5320 bytes
-rw-r--r--core/res/res/drawable-xhdpi/cab_background_opaque_holo_light.9.pngbin0 -> 6962 bytes
-rw-r--r--core/res/res/layout/search_bar.xml2
-rw-r--r--core/res/res/values/arrays.xml5
-rwxr-xr-xcore/res/res/values/attrs.xml3
-rw-r--r--core/res/res/values/themes.xml24
15 files changed, 47 insertions, 10 deletions
diff --git a/core/java/android/app/SearchDialog.java b/core/java/android/app/SearchDialog.java
index db8d5e93cdcf..9cb57be92e2c 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 bc5db49b9a45..000000000000
--- a/core/res/res/drawable-hdpi/cab_background_dark.9.png
+++ /dev/null
Binary files 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 1f45bc98ef18..000000000000
--- a/core/res/res/drawable-hdpi/cab_background_light.9.png
+++ /dev/null
Binary files 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 000000000000..0f4c3c31e350
--- /dev/null
+++ b/core/res/res/drawable-hdpi/cab_background_opaque_holo_dark.9.png
Binary files 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 000000000000..fb9b8318ae07
--- /dev/null
+++ b/core/res/res/drawable-hdpi/cab_background_opaque_holo_light.9.png
Binary files 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 253b12ce8be4..000000000000
--- a/core/res/res/drawable-mdpi/cab_background_dark.9.png
+++ /dev/null
Binary files 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 aaccdfb5aec9..000000000000
--- a/core/res/res/drawable-mdpi/cab_background_light.9.png
+++ /dev/null
Binary files 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 000000000000..013319ce2dcc
--- /dev/null
+++ b/core/res/res/drawable-mdpi/cab_background_opaque_holo_dark.9.png
Binary files 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 000000000000..6d8861ab4e46
--- /dev/null
+++ b/core/res/res/drawable-mdpi/cab_background_opaque_holo_light.9.png
Binary files 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 000000000000..e2b604ba1dbc
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/cab_background_opaque_holo_dark.9.png
Binary files 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 000000000000..0c1aeaa2450b
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/cab_background_opaque_holo_light.9.png
Binary files differ
diff --git a/core/res/res/layout/search_bar.xml b/core/res/res/layout/search_bar.xml
index 9cf08eaf9699..7918a3fb39c1 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 9073531121b5..810c3b26423e 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 004b7555f53f..0d9190f819ea 100755
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -734,6 +734,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 b12774783287..2f434ec9d877 100644
--- a/core/res/res/values/themes.xml
+++ b/core/res/res/values/themes.xml
@@ -258,7 +258,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>
@@ -294,6 +294,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>
@@ -391,7 +393,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>
@@ -681,12 +683,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 -->
@@ -1020,6 +1034,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>
@@ -1303,6 +1319,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>