Merge "Fix search styling."

This commit is contained in:
Ben Komalo 2011-08-09 18:07:00 -07:00 committed by Android (Google) Code Review
commit 2468b54db5
6 changed files with 15 additions and 34 deletions

View File

@ -22,8 +22,7 @@
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="0dip"
android:layout_height="0dip"
style="@style/action_bar_custom_view"
>
<include
android:id="@+id/account_spinner_container"

View File

@ -14,16 +14,11 @@
limitations under the License.
-->
<FrameLayout
<SearchView
xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/SearchBar"
android:orientation="horizontal"
>
<SearchView
android:id="@+id/search_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:iconifiedByDefault="false"
android:iconifiedByDefault="true"
/>
</FrameLayout>

View File

@ -16,7 +16,8 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/action_bar_spinner"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
>
<RelativeLayout

View File

@ -116,16 +116,11 @@
<item name="android:layout_alignParentRight">true</item>
</style>
<style name="SearchBar">
<style name="action_bar_custom_view">
<item name="android:layout_width">420dip</item>
<item name="android:layout_height">match_parent</item>
</style>
<style name="action_bar_spinner">
<item name="android:layout_width">350dip</item>
<item name="android:layout_height">match_parent</item>
</style>
<style name="action_bar_spinner_primary_text">
<item name="android:includeFontPadding">false</item>
<item name="android:textSize">18sp</item>

View File

@ -127,7 +127,7 @@
<item name="android:singleLine">true</item>
</style>
<style name="SearchBar">
<style name="action_bar_custom_view">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
</style>
@ -170,11 +170,6 @@
<item name="android:ellipsize">end</item>
</style>
<style name="action_bar_spinner">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
</style>
<style name="action_bar_spinner_primary_text">
<item name="android:textSize">16sp</item>
<item name="android:textColor">@color/text_primary_color</item>

View File

@ -206,13 +206,8 @@ public class ActionBarController {
mActionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_CUSTOM);
// Prepare the custom view
final LayoutInflater inflater = LayoutInflater.from(mContext);
mActionBarCustomView = (ViewGroup) inflater.inflate(R.layout.action_bar_custom_view, null);
final ActionBar.LayoutParams customViewLayout = new ActionBar.LayoutParams(
ActionBar.LayoutParams.WRAP_CONTENT,
ActionBar.LayoutParams.MATCH_PARENT);
customViewLayout.setMargins(0, 0, 0, 0);
mActionBar.setCustomView(mActionBarCustomView, customViewLayout);
mActionBar.setCustomView(R.layout.action_bar_custom_view);
mActionBarCustomView = (ViewGroup) mActionBar.getCustomView();
// Account spinner
mAccountSpinnerContainer =
@ -244,6 +239,7 @@ public class ActionBarController {
mSearchView = UiUtilities.getView(mSearchContainer, R.id.search_view);
mSearchView.setSubmitButtonEnabled(false);
mSearchView.setOnQueryTextListener(mOnQueryText);
mSearchView.onActionViewExpanded();
mActionBarCustomView.addView(mSearchContainer);
}
}