am 73a31ec9
: Merge "New opaque cab assets; search dialog tweaks." into honeycomb-mr2
* commit '73a31ec91c3e472503e9fbbfe82b8c3bbc5140ed': New opaque cab assets; search dialog tweaks.
@ -29,12 +29,13 @@ import android.content.res.Configuration;
|
|||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.SystemClock;
|
|
||||||
import android.speech.RecognizerIntent;
|
import android.speech.RecognizerIntent;
|
||||||
import android.text.InputType;
|
import android.text.InputType;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.util.TypedValue;
|
||||||
|
import android.view.ActionMode;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
@ -50,9 +51,6 @@ import android.widget.LinearLayout;
|
|||||||
import android.widget.SearchView;
|
import android.widget.SearchView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import java.util.WeakHashMap;
|
|
||||||
import java.util.concurrent.atomic.AtomicLong;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Search dialog. This is controlled by the
|
* Search dialog. This is controlled by the
|
||||||
* SearchManager and runs in the current foreground process.
|
* 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.
|
* Constructor - fires it up and makes it look like the search UI.
|
||||||
*
|
*
|
||||||
* @param context Application Context we can use for system acess
|
* @param context Application Context we can use for system acess
|
||||||
*/
|
*/
|
||||||
public SearchDialog(Context context, SearchManager searchManager) {
|
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
|
// Save voice intent for later queries/launching
|
||||||
mVoiceWebSearchIntent = new Intent(RecognizerIntent.ACTION_WEB_SEARCH);
|
mVoiceWebSearchIntent = new Intent(RecognizerIntent.ACTION_WEB_SEARCH);
|
||||||
@ -642,6 +647,14 @@ public class SearchDialog extends Dialog {
|
|||||||
}
|
}
|
||||||
return super.dispatchKeyEventPreIme(event);
|
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) {
|
private boolean isEmpty(AutoCompleteTextView actv) {
|
||||||
|
Before Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 5.9 KiB |
BIN
core/res/res/drawable-hdpi/cab_background_opaque_holo_dark.9.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 3.3 KiB |
BIN
core/res/res/drawable-mdpi/cab_background_opaque_holo_dark.9.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 6.8 KiB |
@ -25,7 +25,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:background="@drawable/cab_background_light"
|
android:background="?android:attr/actionModeBackground"
|
||||||
android:descendantFocusability="afterDescendants">
|
android:descendantFocusability="afterDescendants">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
|
@ -233,7 +233,10 @@
|
|||||||
<item>@drawable/btn_cab_done_focused_holo</item>
|
<item>@drawable/btn_cab_done_focused_holo</item>
|
||||||
<item>@drawable/btn_cab_done_holo</item>
|
<item>@drawable/btn_cab_done_holo</item>
|
||||||
<item>@drawable/btn_cab_done_pressed_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_focused_holo</item>
|
||||||
<item>@drawable/cab_ic_close_holo</item>
|
<item>@drawable/cab_ic_close_holo</item>
|
||||||
<item>@drawable/cab_ic_close_normal_holo</item>
|
<item>@drawable/cab_ic_close_normal_holo</item>
|
||||||
|
@ -734,6 +734,9 @@
|
|||||||
<!-- SearchView text field background for the right section -->
|
<!-- SearchView text field background for the right section -->
|
||||||
<attr name="searchViewTextFieldRight" format="reference" />
|
<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. -->
|
<!-- Specifies a drawable to use for the 'home as up' indicator. -->
|
||||||
<attr name="homeAsUpIndicator" format="reference" />
|
<attr name="homeAsUpIndicator" format="reference" />
|
||||||
|
|
||||||
|
@ -258,7 +258,7 @@
|
|||||||
<item name="actionDropDownStyle">@android:style/Widget.Spinner.DropDown</item>
|
<item name="actionDropDownStyle">@android:style/Widget.Spinner.DropDown</item>
|
||||||
<item name="actionButtonStyle">@android:style/Widget.ActionButton</item>
|
<item name="actionButtonStyle">@android:style/Widget.ActionButton</item>
|
||||||
<item name="actionOverflowButtonStyle">@android:style/Widget.ActionButton.Overflow</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="actionModeCloseDrawable">@android:drawable/ic_menu_close_clear_cancel</item>
|
||||||
<item name="actionModeCutDrawable">@android:drawable/ic_menu_cut_holo_dark</item>
|
<item name="actionModeCutDrawable">@android:drawable/ic_menu_cut_holo_dark</item>
|
||||||
<item name="actionModeCopyDrawable">@android:drawable/ic_menu_copy_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="searchViewEditQuery">@android:drawable/ic_commit</item>
|
||||||
<item name="searchViewEditQueryBackground">?attr/selectableItemBackground</item>
|
<item name="searchViewEditQueryBackground">?attr/selectableItemBackground</item>
|
||||||
|
|
||||||
|
<item name="searchDialogTheme">@style/Theme.SearchBar</item>
|
||||||
|
|
||||||
<!-- PreferenceFrameLayout attributes -->
|
<!-- PreferenceFrameLayout attributes -->
|
||||||
<item name="preferenceFrameLayoutStyle">@android:style/Widget.PreferenceFrameLayout</item>
|
<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="actionModeShareDrawable">@android:drawable/ic_menu_share_holo_light</item>
|
||||||
<item name="actionModeFindDrawable">@android:drawable/ic_menu_find_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="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 -->
|
<!-- SearchView attributes -->
|
||||||
<item name="searchDropdownBackground">@android:drawable/search_dropdown_light</item>
|
<item name="searchDropdownBackground">@android:drawable/search_dropdown_light</item>
|
||||||
@ -681,12 +683,24 @@
|
|||||||
<!-- Theme for the search input bar. -->
|
<!-- Theme for the search input bar. -->
|
||||||
<style name="Theme.SearchBar" parent="Theme.Holo.Light.Panel">
|
<style name="Theme.SearchBar" parent="Theme.Holo.Light.Panel">
|
||||||
<item name="windowContentOverlay">@null</item>
|
<item name="windowContentOverlay">@null</item>
|
||||||
|
<item name="actionModeBackground">@android:drawable/cab_background_opaque_holo_light</item>
|
||||||
</style>
|
</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
|
<!-- 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. -->
|
difference from non-global search is that we do not dim the background. -->
|
||||||
<style name="Theme.GlobalSearchBar" parent="Theme.Panel">
|
<style name="Theme.GlobalSearchBar" parent="Theme.Panel">
|
||||||
<item name="windowContentOverlay">@null</item>
|
<item name="windowContentOverlay">@null</item>
|
||||||
|
<item name="actionModeBackground">@android:drawable/cab_background_opaque_holo_light</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<!-- Menu Themes -->
|
<!-- Menu Themes -->
|
||||||
@ -1020,6 +1034,8 @@
|
|||||||
<!-- SearchView attributes -->
|
<!-- SearchView attributes -->
|
||||||
<item name="searchDropdownBackground">@android:drawable/search_dropdown_dark</item>
|
<item name="searchDropdownBackground">@android:drawable/search_dropdown_dark</item>
|
||||||
|
|
||||||
|
<item name="searchDialogTheme">@style/Theme.Holo.SearchBar</item>
|
||||||
|
|
||||||
<!-- PreferenceFrameLayout attributes -->
|
<!-- PreferenceFrameLayout attributes -->
|
||||||
<item name="preferenceFrameLayoutStyle">@android:style/Widget.Holo.PreferenceFrameLayout</item>
|
<item name="preferenceFrameLayoutStyle">@android:style/Widget.Holo.PreferenceFrameLayout</item>
|
||||||
|
|
||||||
@ -1303,6 +1319,8 @@
|
|||||||
<!-- SearchView attributes -->
|
<!-- SearchView attributes -->
|
||||||
<item name="searchDropdownBackground">@android:drawable/search_dropdown_light</item>
|
<item name="searchDropdownBackground">@android:drawable/search_dropdown_light</item>
|
||||||
|
|
||||||
|
<item name="searchDialogTheme">@style/Theme.Holo.Light.SearchBar</item>
|
||||||
|
|
||||||
<!-- NumberPicker attributes and styles-->
|
<!-- NumberPicker attributes and styles-->
|
||||||
<item name="numberPickerUpButtonStyle">@style/Widget.Holo.Light.ImageButton.NumberPickerUpButton</item>
|
<item name="numberPickerUpButtonStyle">@style/Widget.Holo.Light.ImageButton.NumberPickerUpButton</item>
|
||||||
<item name="numberPickerDownButtonStyle">@style/Widget.Holo.Light.ImageButton.NumberPickerDownButton</item>
|
<item name="numberPickerDownButtonStyle">@style/Widget.Holo.Light.ImageButton.NumberPickerDownButton</item>
|
||||||
|