am 73a31ec9: Merge "New opaque cab assets; search dialog tweaks." into honeycomb-mr2

* commit '73a31ec91c3e472503e9fbbfe82b8c3bbc5140ed':
  New opaque cab assets; search dialog tweaks.
This commit is contained in:
Adam Powell
2011-05-20 13:04:11 -07:00
committed by Android Git Automerger
15 changed files with 47 additions and 10 deletions

View File

@ -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) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@ -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

View File

@ -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>

View File

@ -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" />

View File

@ -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>