Settings/Setup style cleanup.

This is not an attempt to cleanup the code that much - minimal amount of
work was done to reduce the copy/pasting that is rampant in this part of
the codebase.

This basically just does visual fixes to:
- not make the buttons illegibly tiny
- not make the buttons overlap
- make the padding consistent on phones

Bug: 5039509
Bug: 5011325
Change-Id: Id31dee84a54a5dce9644b6f37fb41ac2c2ce89b9
This commit is contained in:
Ben Komalo 2011-07-22 17:36:14 -07:00
parent 30183e536e
commit df4dfa570a
16 changed files with 203 additions and 150 deletions

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/settings_buttons_padding_top"
android:paddingBottom="@dimen/settings_buttons_padding_bottom"
>
<Button
android:id="@+id/cancel"
style="@style/accountSettingsButton"
android:layout_alignParentLeft="true"
android:layout_marginLeft="32dip"
android:text="@string/cancel_action" />
<Button
android:id="@+id/done"
style="@style/accountSettingsButton"
android:layout_alignParentRight="true"
android:layout_marginRight="32dip"
android:text="@string/done_action" />
</RelativeLayout>

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="@dimen/settings_buttons_padding_top"
android:paddingBottom="@dimen/settings_buttons_padding_bottom"
>
<Button
android:id="@+id/cancel"
style="@style/accountSettingsButton"
android:layout_width="0dip"
android:layout_weight="1"
android:text="@string/cancel_action" />
<Button
android:id="@+id/done"
style="@style/accountSettingsButton"
android:layout_width="0dip"
android:layout_weight="1"
android:text="@string/done_action" />
</LinearLayout>

View File

@ -47,24 +47,6 @@
android:layout_height="0dip"
android:layout_weight="1" />
<!-- Cancel & Done buttons -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="@dimen/settings_buttons_padding_top"
android:paddingBottom="@dimen/settings_buttons_padding_bottom"
>
<Button
android:id="@+id/cancel"
android:layout_alignParentLeft="true"
style="@style/accountSettingsButton"
android:text="@string/cancel_action" />
<Button
android:id="@+id/done"
android:layout_alignParentRight="true"
style="@style/accountSettingsButton"
android:text="@string/done_action" />
</RelativeLayout>
<include layout="@layout/account_settings_buttons" />
</LinearLayout>
</ScrollView>

View File

@ -47,24 +47,6 @@
android:layout_height="0dip"
android:layout_weight="1" />
<!-- Cancel & Done buttons -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="@dimen/settings_buttons_padding_top"
android:paddingBottom="@dimen/settings_buttons_padding_bottom"
>
<Button
android:id="@+id/cancel"
android:layout_alignParentLeft="true"
style="@style/accountSettingsButton"
android:text="@string/cancel_action" />
<Button
android:id="@+id/done"
android:layout_alignParentRight="true"
style="@style/accountSettingsButton"
android:text="@string/done_action" />
</RelativeLayout>
<include layout="@layout/account_settings_buttons" />
</LinearLayout>
</ScrollView>

View File

@ -47,24 +47,6 @@
android:layout_height="0dip"
android:layout_weight="1" />
<!-- Cancel & Done buttons -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="@dimen/settings_buttons_padding_top"
android:paddingBottom="@dimen/settings_buttons_padding_bottom"
>
<Button
android:id="@+id/cancel"
android:layout_alignParentLeft="true"
style="@style/accountSettingsButton"
android:text="@string/cancel_action" />
<Button
android:id="@+id/done"
android:layout_alignParentRight="true"
style="@style/accountSettingsButton"
android:text="@string/done_action" />
</RelativeLayout>
<include layout="@layout/account_settings_buttons" />
</LinearLayout>
</ScrollView>

View File

@ -20,6 +20,9 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="@dimen/setup_fragment_padding_top"
android:paddingLeft="@dimen/setup_fragment_padding_left"
android:paddingRight="@dimen/setup_fragment_padding_right"
>
<TextView
android:text="@string/account_setup_account_type_instructions"

View File

@ -23,6 +23,9 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="@dimen/setup_fragment_padding_top"
android:paddingLeft="@dimen/setup_fragment_padding_left"
android:paddingRight="@dimen/setup_fragment_padding_right"
>
<!-- Frame on the left containing the (common) setup info -->
@ -42,20 +45,27 @@
</FrameLayout>
<!-- Buttons below -->
<Button
android:id="@+id/manual_setup"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/common"
android:layout_alignParentLeft="true"
android:layout_marginTop="16dip"
style="@style/accountSetupButton"
android:text="@string/account_setup_basics_manual_setup_action" />
<Button
android:id="@+id/next"
android:layout_below="@+id/common"
android:layout_alignParentRight="true"
android:layout_marginTop="16dip"
style="@style/accountSetupButton"
android:text="@string/next_action" />
android:orientation="horizontal"
android:paddingTop="@dimen/settings_buttons_padding_top"
android:paddingBottom="@dimen/settings_buttons_padding_bottom"
>
<Button
android:id="@+id/manual_setup"
style="@style/accountSetupButton"
android:layout_width="0dip"
android:layout_weight="1"
android:text="@string/account_setup_basics_manual_setup_action" />
<Button
android:id="@+id/next"
style="@style/accountSetupButton"
android:layout_width="0dip"
android:layout_weight="1"
android:text="@string/next_action" />
</LinearLayout>
</RelativeLayout>

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="@dimen/settings_buttons_padding_top"
android:paddingBottom="@dimen/settings_buttons_padding_bottom"
>
<Button
android:id="@+id/previous"
style="@style/accountSetupButton"
android:layout_width="0dip"
android:layout_weight="1"
android:text="@string/previous_action" />
<Button
android:id="@+id/next"
style="@style/accountSetupButton"
android:layout_width="0dip"
android:layout_weight="1"
android:text="@string/next_action" />
</LinearLayout>

View File

@ -20,34 +20,24 @@
android:layout_height="match_parent"
android:fillViewport="true">
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="@dimen/setup_fragment_padding_top"
android:paddingLeft="@dimen/setup_fragment_padding_left"
android:paddingRight="@dimen/setup_fragment_padding_right" >
<fragment
android:id="@+id/setup_fragment"
class="com.android.email.activity.setup.AccountSetupExchangeFragment"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="0dip"
android:layout_weight="1"
/>
<!-- Buttons below -->
<!-- TODO - quick placeholder - phone UX still TBD -->
<Button
android:id="@+id/previous"
android:layout_below="@+id/setup_fragment"
android:layout_alignParentLeft="true"
android:layout_marginTop="16dip"
style="@style/accountSetupButton"
android:text="@string/previous_action" />
<Button
android:id="@+id/next"
android:layout_below="@+id/setup_fragment"
android:layout_alignParentRight="true"
android:layout_marginTop="16dip"
style="@style/accountSetupButton"
android:text="@string/next_action" />
</RelativeLayout>
<include layout="@layout/account_setup_buttons" />
</LinearLayout>
</ScrollView>

View File

@ -20,34 +20,24 @@
android:layout_height="match_parent"
android:fillViewport="true" >
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="@dimen/setup_fragment_padding_top"
android:paddingLeft="@dimen/setup_fragment_padding_left"
android:paddingRight="@dimen/setup_fragment_padding_right" >
<fragment
android:id="@+id/setup_fragment"
class="com.android.email.activity.setup.AccountSetupIncomingFragment"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="0dip"
android:layout_weight="1"
/>
<!-- Buttons below -->
<!-- TODO - quick placeholder - phone UX still TBD -->
<Button
android:id="@+id/previous"
android:layout_below="@+id/setup_fragment"
android:layout_alignParentLeft="true"
android:layout_marginTop="16dip"
style="@style/accountSetupButton"
android:text="@string/previous_action" />
<Button
android:id="@+id/next"
android:layout_below="@+id/setup_fragment"
android:layout_alignParentRight="true"
android:layout_marginTop="16dip"
style="@style/accountSetupButton"
android:text="@string/next_action" />
</RelativeLayout>
<include layout="@layout/account_setup_buttons" />
</LinearLayout>
</ScrollView>

View File

@ -23,7 +23,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical" >
android:orientation="vertical"
android:paddingTop="@dimen/setup_fragment_padding_top"
android:paddingLeft="@dimen/setup_fragment_padding_left"
android:paddingRight="@dimen/setup_fragment_padding_right" >
<TextView
android:layout_height="wrap_content"
android:layout_width="match_parent"

View File

@ -24,7 +24,11 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical" >
android:orientation="vertical"
android:paddingTop="@dimen/setup_fragment_padding_top"
android:paddingLeft="@dimen/setup_fragment_padding_left"
android:paddingRight="@dimen/setup_fragment_padding_right" >
<TextView
android:text="@string/account_setup_options_mail_check_frequency_label"
android:layout_height="wrap_content"
@ -83,21 +87,13 @@
android:layout_width="match_parent"
android:text="@string/account_setup_options_sync_email_label" />
<!-- TODO - quick placeholder - phone UX still TBD -->
<CheckBox
android:id="@+id/account_background_attachments"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:text="@string/account_setup_options_background_attachments_label" />
<Button
android:id="@+id/previous"
android:layout_marginTop="16dip"
style="@style/accountSetupButton"
android:text="@string/previous_action" />
<Button
android:id="@+id/next"
android:layout_marginTop="16dip"
style="@style/accountSetupButton"
android:text="@string/next_action" />
<include layout="@layout/account_setup_buttons" />
</LinearLayout>
</ScrollView>

View File

@ -20,34 +20,25 @@
android:layout_height="match_parent"
android:fillViewport="true" >
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="@dimen/setup_fragment_padding_top"
android:paddingLeft="@dimen/setup_fragment_padding_left"
android:paddingRight="@dimen/setup_fragment_padding_right" >
<fragment
android:id="@+id/setup_fragment"
class="com.android.email.activity.setup.AccountSetupOutgoingFragment"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="0dip"
android:layout_weight="1"
/>
<!-- Buttons below -->
<!-- TODO - quick placeholder - phone UX still TBD -->
<Button
android:id="@+id/previous"
android:layout_below="@+id/setup_fragment"
android:layout_alignParentLeft="true"
android:layout_marginTop="16dip"
style="@style/accountSetupButton"
android:text="@string/previous_action" />
<Button
android:id="@+id/next"
android:layout_below="@+id/setup_fragment"
android:layout_alignParentRight="true"
android:layout_marginTop="16dip"
style="@style/accountSetupButton"
android:text="@string/next_action" />
</RelativeLayout>
<include layout="@layout/account_setup_buttons"
android:layout_below="@+id/setup_fragment" />
</LinearLayout>
</ScrollView>

View File

@ -28,6 +28,17 @@
<!-- distance of any button above the bottom of the screen -->
<dimen name="setup_buttons_padding_bottom">48dip</dimen>
<!-- Account settings fragments -->
<dimen name="settings_fragment_padding_top">32dip</dimen>
<dimen name="settings_fragment_padding_left">32dip</dimen>
<dimen name="settings_fragment_padding_right">32dip</dimen>
<!-- On tablets, we don't need additional padding in setup mode since the
base settings fragments that are reused already have padding. -->
<dimen name="setup_fragment_padding_top">0dip</dimen>
<dimen name="setup_fragment_padding_left">0dip</dimen>
<dimen name="setup_fragment_padding_right">0dip</dimen>
<!-- In setup screens, the inset for all items below the headline+hairline -->
<dimen name="setup_item_inset_left">16dip</dimen>
<dimen name="setup_item_inset_right">64dip</dimen>

View File

@ -39,11 +39,15 @@
<dimen name="message_compose_header_button_area_width">120dip</dimen>
<!-- Account settings fragments -->
<!-- In containers for settings fragments, the padding to use for all items
(this matches PreferenceActivity hairline) -->
<dimen name="settings_fragment_padding_top">32dip</dimen>
<dimen name="settings_fragment_padding_left">32dip</dimen>
<dimen name="settings_fragment_padding_right">32dip</dimen>
<dimen name="settings_fragment_padding_left">0dip</dimen>
<dimen name="settings_fragment_padding_right">0dip</dimen>
<!-- On the phone, we need padding on the setup fragments but not in
settings mode. Ugh. -->
<dimen name="setup_fragment_padding_top">16dip</dimen>
<dimen name="setup_fragment_padding_left">16dip</dimen>
<dimen name="setup_fragment_padding_right">16dip</dimen>
<!-- inset distance for settings buttons -->
<dimen name="settings_buttons_padding_top">48dip</dimen>

View File

@ -55,15 +55,16 @@
<style name="accountSetupButton">
<item name="android:layout_width">160sp</item>
<item name="android:layout_height">40sp</item>
<item name="android:textAppearance">?android:attr/textColorPrimary</item>
<item name="android:textColor">?android:attr/textColorPrimary</item>
<item name="android:textAppearance">?android:attr/textAppearanceSmall</item>
</style>
<!-- Cancel/Done buttons on the account settings (server settings) fragments -->
<!-- TODO these are estimates for the phone UX - final sizes TBD -->
<style name="accountSettingsButton">
<item name="android:layout_width">160sp</item>
<item name="android:layout_height">40sp</item>
<item name="android:textAppearance">?android:attr/textColorPrimary</item>
<item name="android:textColor">?android:attr/textColorPrimary</item>
<item name="android:textAppearance">?android:attr/textAppearanceSmall</item>
</style>
<!-- EditText style without the "tray" -->