branch message list item XML

This separate the layouts for the message list item so that we can
change the phone and tablet independently.

The visuals weren't really updated except for easy to win padding
reductions.

Change-Id: I92ed6e1bf275551abd77fd788b5c7ac22f639843
This commit is contained in:
Ben Komalo 2011-06-20 14:41:22 -07:00
parent 99401ebea7
commit e16d6d7f95
7 changed files with 299 additions and 20 deletions

View File

@ -0,0 +1,92 @@
<?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.
-->
<!-- This layout is used as a template to create a custom message item view
in narrow mode. To be able to get the correct measurements, every source field should
be populated with data here. E.g:
- Text View should set text to a random long string (android:text="@string/long_string")
- Image View should set source to a specific asset -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<ImageView
android:id="@+id/checkmark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="16dip"
android:layout_marginRight="16dip"
android:src="@drawable/btn_check_on_normal_holo_light" />
<LinearLayout
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:layout_gravity="center_vertical">
<TextView
android:id="@+id/senders"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/long_string"
android:textSize="@dimen/senders_font_size"
android:lines="1" />
<TextView
android:id="@+id/subject"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/long_string"
android:textSize="@dimen/subject_font_size"
android:lines="2" />
</LinearLayout>
<LinearLayout
android:layout_width="80dip"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="right">
<View
android:id="@+id/color_chip"
android:layout_width="@dimen/message_list_item_color_tip_width"
android:layout_height="@dimen/message_list_item_color_tip_height"
android:layout_marginRight="16dip" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageView
android:id="@+id/paperclip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_attachment_holo_light" />
<TextView
android:id="@+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dip"
android:layout_marginRight="16dip"
android:text="@string/long_string"
android:lines="1" />
</LinearLayout>
<ImageView
android:id="@+id/star"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dip"
android:layout_marginRight="16dip"
android:src="@drawable/btn_star_off_normal_email_holo_light" />
</LinearLayout>
</LinearLayout>

View File

@ -0,0 +1,94 @@
<?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.
-->
<!-- This layout is used as a template to create custom view MessageListItem
in normal mode. To be able to get the correct measurements, every source field should
be populated with data here. E.g:
- Text View should set text to a random long string (android:text="@string/long_string")
- Image View should set source to a specific asset -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<ImageView
android:id="@+id/checkmark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="16dip"
android:layout_marginRight="16dip"
android:src="@drawable/btn_check_on_normal_holo_light" />
<LinearLayout
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:layout_gravity="center_vertical">
<TextView
android:id="@+id/senders"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/long_string"
android:textSize="@dimen/senders_font_size"
android:lines="1" />
<TextView
android:id="@+id/subject"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/long_string"
android:textSize="@dimen/subject_font_size"
android:lines="2" />
</LinearLayout>
<LinearLayout
android:layout_width="136dip"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="right">
<View
android:id="@+id/color_chip"
android:layout_width="@dimen/message_list_item_color_tip_width"
android:layout_height="@dimen/message_list_item_color_tip_height"
android:layout_marginRight="8dip"
android:paddingTop="2dip" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageView
android:id="@+id/paperclip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_attachment_holo_light" />
<TextView
android:id="@+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dip"
android:layout_marginRight="8dip"
android:text="@string/long_string"
android:lines="1" />
</LinearLayout>
<ImageView
android:id="@+id/star"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dip"
android:layout_marginRight="8dip"
android:src="@drawable/btn_star_off_normal_email_holo_light" />
</LinearLayout>
</LinearLayout>

View File

@ -0,0 +1,92 @@
<?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.
-->
<!-- This layout is used as a template to create custom message list item view
in wide mode. To be able to get the correct measurements, every source field should
be populated with data here. E.g:
- Text View should set text to a random long string (android:text="@string/long_string")
- Image View should set source to a specific asset -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<ImageView
android:id="@+id/checkmark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dip"
android:layout_marginRight="16dip"
android:layout_gravity="center_vertical"
android:src="@drawable/btn_check_on_normal_holo_light" />
<TextView
android:id="@+id/senders"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:layout_gravity="center_vertical"
android:text="@string/long_string"
android:textSize="@dimen/wide_senders_font_size"
android:lines="1" />
<TextView
android:id="@+id/subject"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="0.7"
android:layout_marginLeft="16dip"
android:layout_marginRight="16dip"
android:layout_gravity="center_vertical"
android:text="@string/long_string"
android:textSize="@dimen/subject_font_size"
android:lines="2" />
<RelativeLayout
android:layout_width="144dip"
android:layout_height="match_parent">
<View
android:id="@+id/color_chip"
android:layout_width="@dimen/message_list_item_color_tip_width"
android:layout_height="@dimen/message_list_item_color_tip_height"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:paddingTop="2dip" />
<ImageView
android:id="@+id/paperclip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:src="@drawable/ic_attachment_holo_light" />
<TextView
android:id="@+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:text="@string/long_string"
android:lines="1" />
</RelativeLayout>
<ImageView
android:id="@+id/star"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dip"
android:layout_marginRight="16dip"
android:layout_gravity="center_vertical"
android:src="@drawable/btn_star_off_normal_email_holo_light" />
</LinearLayout>

View File

@ -29,8 +29,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="16dip"
android:layout_marginRight="16dip"
android:layout_marginLeft="4dip"
android:layout_marginRight="4dip"
android:src="@drawable/btn_check_on_normal_holo_light" />
<LinearLayout
android:layout_width="0dip"
@ -76,8 +76,7 @@
android:id="@+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dip"
android:layout_marginRight="16dip"
android:layout_marginRight="8dip"
android:text="@string/long_string"
android:lines="1" />
</LinearLayout>
@ -85,8 +84,8 @@
android:id="@+id/star"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dip"
android:layout_marginRight="16dip"
android:layout_marginLeft="8dip"
android:layout_marginRight="8dip"
android:src="@drawable/btn_star_off_normal_email_holo_light" />
</LinearLayout>
</LinearLayout>

View File

@ -14,9 +14,8 @@
limitations under the License.
-->
<!-- This layout is used as a template to create custom view CanvasConversationHeaderView
in normal mode. To be able to get the correct measurements, every source field should
<!-- This layout is used as a template to create a custom message item view
in narrow mode. To be able to get the correct measurements, every source field should
be populated with data here. E.g:
- Text View should set text to a random long string (android:text="@string/long_string")
- Image View should set source to a specific asset -->
@ -30,8 +29,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="16dip"
android:layout_marginRight="16dip"
android:layout_marginLeft="4dip"
android:layout_marginRight="4dip"
android:src="@drawable/btn_check_on_normal_holo_light" />
<LinearLayout
android:layout_width="0dip"
@ -55,7 +54,7 @@
android:lines="2" />
</LinearLayout>
<LinearLayout
android:layout_width="136dip"
android:layout_width="80dip"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="right">
@ -63,8 +62,7 @@
android:id="@+id/color_chip"
android:layout_width="@dimen/message_list_item_color_tip_width"
android:layout_height="@dimen/message_list_item_color_tip_height"
android:layout_marginRight="8dip"
android:paddingTop="2dip" />
android:layout_marginRight="16dip" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -78,7 +76,6 @@
android:id="@+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dip"
android:layout_marginRight="8dip"
android:text="@string/long_string"
android:lines="1" />
@ -87,7 +84,7 @@
android:id="@+id/star"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dip"
android:layout_marginLeft="8dip"
android:layout_marginRight="8dip"
android:src="@drawable/btn_star_off_normal_email_holo_light" />
</LinearLayout>

View File

@ -32,4 +32,9 @@
<dimen name="setup_item_inset_left">16dip</dimen>
<dimen name="setup_item_inset_right">64dip</dimen>
<dimen name="message_list_item_height_wide">64dip</dimen>
<dimen name="message_list_item_height_narrow">80dip</dimen>
<dimen name="minimum_width_wide_mode">800dip</dimen>
<dimen name="minimum_width_normal_mode">550dip</dimen>
</resources>

View File

@ -19,8 +19,8 @@
<resources>
<dimen name="button_minWidth">100sp</dimen>
<dimen name="message_list_item_text_size">16dip</dimen>
<dimen name="message_list_item_height_wide">64dip</dimen>
<dimen name="message_list_item_height_narrow">80dip</dimen>
<dimen name="message_list_item_height_wide">72dip</dimen>
<dimen name="message_list_item_height_narrow">72dip</dimen>
<dimen name="message_list_item_color_tip_width">35dip</dimen>
<dimen name="message_list_item_color_tip_height">8dip</dimen>
@ -60,8 +60,8 @@
<dimen name="wide_senders_font_size">16sp</dimen>
<dimen name="subject_font_size">16sp</dimen>
<dimen name="date_font_size">14sp</dimen>
<dimen name="minimum_width_wide_mode">800dip</dimen>
<dimen name="minimum_width_normal_mode">550dip</dimen>
<dimen name="minimum_width_wide_mode">720dip</dimen>
<dimen name="minimum_width_normal_mode">280dip</dimen>
<!-- Username/password entry -->
<dimen name="setup_credentials_input_width">340dip</dimen>