Fix search bar sizing.

On phones it was being pushed out beyond the width of the phone.
Make it so that it fits the whole width in phone portrait, and is fixed
size in landscape / tablets.

Change-Id: Ifc712002c4df38ceb4bd3577f0cbb48114b41115
This commit is contained in:
Ben Komalo 2011-06-21 20:39:24 -07:00
parent d17a85a2f2
commit 1116194d9f
6 changed files with 18 additions and 5 deletions

View File

@ -16,8 +16,7 @@
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/search_box_width"
android:layout_height="match_parent"
style="@style/SearchBar"
android:orientation="horizontal"
>
<SearchView

View File

@ -25,4 +25,9 @@
<dimen name="action_bar_account_name_max_width">100dip</dimen>
<dimen name="action_bar_mailbox_name_max_width">100dip</dimen>
<dimen name="action_bar_mailbox_name_left_margin">8dip</dimen>
<style name="SearchBar">
<item name="android:layout_width">360dip</item>
<item name="android:layout_height">match_parent</item>
</style>
</resources>

View File

@ -139,4 +139,9 @@
<item name="android:layout_toRightOf">@+id/main_content"</item>
<item name="android:layout_alignParentRight">true</item>
</style>
<style name="SearchBar">
<item name="android:layout_width">420dip</item>
<item name="android:layout_height">match_parent</item>
</style>
</resources>

View File

@ -65,6 +65,4 @@
<!-- Username/password entry -->
<dimen name="setup_credentials_input_width">340dip</dimen>
<dimen name="search_box_width">360dip</dimen>
</resources>

View File

@ -116,4 +116,10 @@
<item name="android:ellipsize">end</item>
<item name="android:gravity">center</item>
</style>
<style name="SearchBar">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
</style>
</resources>

View File

@ -161,7 +161,7 @@ public class ActionBarController {
final LayoutInflater inflater = LayoutInflater.from(mContext);
mActionBarCustomView = inflater.inflate(R.layout.action_bar_custom_view, null);
final ActionBar.LayoutParams customViewLayout = new ActionBar.LayoutParams(
ActionBar.LayoutParams.WRAP_CONTENT,
ActionBar.LayoutParams.MATCH_PARENT,
ActionBar.LayoutParams.MATCH_PARENT);
customViewLayout.setMargins(0 , 0, 0, 0);
mActionBar.setCustomView(mActionBarCustomView, customViewLayout);