Pixel perfect: message compose
Layout & action bar icons. Now I think it's close enough. Bug 3138037 Change-Id: I0802f34ac23980e0faf8a0daffc016a012816d81
This commit is contained in:
parent
5faff6c76a
commit
7523930d39
|
@ -15,150 +15,214 @@
|
|||
-->
|
||||
|
||||
<!-- xlarge -->
|
||||
<!-- STOPSHIP Finish it -->
|
||||
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:background="#ff8080ff"
|
||||
>
|
||||
<ScrollView
|
||||
android:layout_width="@dimen/message_compose_paper_width"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:paddingTop="16dip"
|
||||
android:paddingBottom="16dip"
|
||||
android:paddingLeft="32dip"
|
||||
android:paddingRight="32dip"
|
||||
android:background="#ffffffff"
|
||||
>
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="16dip"
|
||||
android:paddingBottom="16dip"
|
||||
android:paddingLeft="16dip"
|
||||
android:paddingRight="16dip"
|
||||
>
|
||||
<!-- header: from/to/cc/bcc/subject + buttons -->
|
||||
<!-- from: -->
|
||||
<!-- headers + buttons -->
|
||||
<LinearLayout
|
||||
style="@style/message_compose_header_field_container_no_tray"
|
||||
>
|
||||
<TextView
|
||||
style="@style/message_compose_header_field_label"
|
||||
android:text="@string/message_compose_from_label"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/from"
|
||||
style="@style/message_compose_header_field_value"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- to: -->
|
||||
<LinearLayout
|
||||
style="@style/message_compose_header_field_container"
|
||||
>
|
||||
<TextView
|
||||
style="@style/message_compose_header_field_label"
|
||||
android:text="@string/message_compose_to_label"
|
||||
/>
|
||||
<com.android.email.activity.AddressTextView
|
||||
android:id="@+id/to"
|
||||
style="@style/message_compose_header_field_value"
|
||||
android:inputType="textEmailAddress|textMultiLine"
|
||||
android:imeOptions="actionNext"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/cc_bcc_container"
|
||||
android:orientation="vertical"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
<!-- headers: from/to/cc/bcc/subject -->
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
>
|
||||
<!-- from: -->
|
||||
<LinearLayout
|
||||
style="@style/message_compose_header_field_container_no_tray"
|
||||
>
|
||||
<TextView
|
||||
style="@style/message_compose_header_field_label"
|
||||
android:text="@string/message_compose_from_label"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/from"
|
||||
style="@style/message_compose_header_field_value"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- to: -->
|
||||
<LinearLayout
|
||||
style="@style/message_compose_header_field_container"
|
||||
>
|
||||
<TextView
|
||||
style="@style/message_compose_header_field_label"
|
||||
android:text="@string/message_compose_to_label"
|
||||
/>
|
||||
<com.android.email.activity.AddressTextView
|
||||
android:id="@+id/to"
|
||||
style="@style/message_compose_header_field_value"
|
||||
android:inputType="textEmailAddress"
|
||||
android:imeOptions="actionNext"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/cc_bcc_container"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
>
|
||||
<!-- cc: -->
|
||||
<LinearLayout
|
||||
style="@style/message_compose_header_field_container"
|
||||
>
|
||||
<TextView
|
||||
style="@style/message_compose_header_field_label"
|
||||
android:text="@string/message_compose_cc_label"
|
||||
/>
|
||||
<com.android.email.activity.AddressTextView
|
||||
android:id="@+id/cc"
|
||||
style="@style/message_compose_header_field_value"
|
||||
android:inputType="textEmailAddress"
|
||||
android:imeOptions="actionNext"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- bcc: -->
|
||||
<LinearLayout
|
||||
style="@style/message_compose_header_field_container"
|
||||
>
|
||||
<TextView
|
||||
style="@style/message_compose_header_field_label"
|
||||
android:text="@string/message_compose_bcc_label"
|
||||
/>
|
||||
<com.android.email.activity.AddressTextView
|
||||
android:id="@+id/bcc"
|
||||
style="@style/message_compose_header_field_value"
|
||||
android:inputType="textEmailAddress"
|
||||
android:imeOptions="actionNext"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- subject -->
|
||||
<LinearLayout
|
||||
style="@style/message_compose_header_field_container"
|
||||
>
|
||||
<TextView
|
||||
style="@style/message_compose_header_field_label"
|
||||
android:text="@string/message_compose_subject_label"
|
||||
/>
|
||||
<EditText
|
||||
android:id="@+id/subject"
|
||||
style="@style/message_compose_header_field_value"
|
||||
android:inputType
|
||||
="textEmailSubject|textAutoCorrect|textCapSentences|textImeMultiLine"
|
||||
android:imeOptions="actionNext"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</LinearLayout> <!-- end of header -->
|
||||
|
||||
<!-- Buttons: +cc/bcc, add attachment -->
|
||||
<RelativeLayout
|
||||
android:layout_width="@dimen/message_compose_header_button_area_width"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0"
|
||||
android:paddingLeft="16dip"
|
||||
android:layout_gravity="bottom"
|
||||
>
|
||||
<Button
|
||||
android:id="@+id/add_cc_bcc"
|
||||
android:layout_height="48dip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginTop="48dip"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
style="@android:style/Widget.Holo.Button.Borderless"
|
||||
android:paddingTop="0dip"
|
||||
android:paddingBottom="0dip"
|
||||
android:paddingLeft="0dip"
|
||||
android:paddingRight="0dip"
|
||||
android:textSize="18dip"
|
||||
android:textColor="@color/text_primary_color"
|
||||
android:text="@string/add_cc_bcc_action"
|
||||
android:gravity="left|center_vertical"
|
||||
/>
|
||||
<ImageButton
|
||||
android:id="@+id/add_attachment"
|
||||
android:layout_height="48dip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
style="@android:style/Widget.Holo.Button.Borderless"
|
||||
android:paddingTop="0dip"
|
||||
android:paddingBottom="0dip"
|
||||
android:paddingLeft="0dip"
|
||||
android:paddingRight="0dip"
|
||||
android:gravity="left|center_vertical"
|
||||
android:src="@drawable/ic_add_attachment_holo_light"
|
||||
/>
|
||||
</RelativeLayout> <!-- end of buttons -->
|
||||
</LinearLayout> <!-- end of headers+buttons -->
|
||||
|
||||
<LinearLayout android:id="@+id/attachment_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dip"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone"
|
||||
>
|
||||
<!-- cc: -->
|
||||
<LinearLayout
|
||||
style="@style/message_compose_header_field_container"
|
||||
>
|
||||
<TextView
|
||||
style="@style/message_compose_header_field_label"
|
||||
android:text="@string/message_compose_cc_label"
|
||||
/>
|
||||
<com.android.email.activity.AddressTextView
|
||||
android:id="@+id/cc"
|
||||
style="@style/message_compose_header_field_value"
|
||||
android:inputType="textEmailAddress|textMultiLine"
|
||||
android:imeOptions="actionNext"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- bcc: -->
|
||||
<LinearLayout
|
||||
style="@style/message_compose_header_field_container"
|
||||
>
|
||||
<TextView
|
||||
style="@style/message_compose_header_field_label"
|
||||
android:text="@string/message_compose_bcc_label"
|
||||
/>
|
||||
<com.android.email.activity.AddressTextView
|
||||
android:id="@+id/bcc"
|
||||
style="@style/message_compose_header_field_value"
|
||||
android:inputType="textEmailAddress|textMultiLine"
|
||||
android:imeOptions="actionNext"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- subject -->
|
||||
<LinearLayout
|
||||
style="@style/message_compose_header_field_container"
|
||||
>
|
||||
<TextView
|
||||
style="@style/message_compose_header_field_label"
|
||||
android:text="@string/message_compose_subject_label"
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginRight="@dimen/message_compose_header_button_area_width"
|
||||
style="@style/horizontalDivider"
|
||||
/>
|
||||
<EditText
|
||||
android:id="@+id/subject"
|
||||
style="@style/message_compose_header_field_value"
|
||||
android:inputType
|
||||
="textEmailSubject|textAutoCorrect|textCapSentences|textImeMultiLine"
|
||||
android:imeOptions="actionNext"
|
||||
<!--
|
||||
Empty container for storing attachments. We'll stick
|
||||
instances of message_compose_attachment.xml in here.
|
||||
-->
|
||||
<LinearLayout android:id="@+id/attachments"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="112dip"
|
||||
android:orientation="vertical"
|
||||
/>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginRight="@dimen/message_compose_header_button_area_width"
|
||||
style="@style/horizontalDivider"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/add_cc_bcc"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/add_cc_bcc_action"
|
||||
/>
|
||||
<ImageButton
|
||||
android:id="@+id/add_attachment"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/add_attachment_action"
|
||||
android:src="@drawable/ic_add_attachment_holo_light"
|
||||
/>
|
||||
|
||||
<!--
|
||||
Empty container for storing attachments. We'll stick
|
||||
instances of message_compose_attachment.xml in here.
|
||||
-->
|
||||
<LinearLayout android:id="@+id/attachments"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
/>
|
||||
|
||||
<!-- message body -->
|
||||
<EditText
|
||||
android:id="@+id/message_content"
|
||||
style="@style/message_compose_message_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="32dip"
|
||||
android:layout_marginBottom="32dip"
|
||||
android:layout_marginLeft="16dip"
|
||||
android:layout_marginRight="16dip"
|
||||
android:gravity="left|top"
|
||||
android:minLines="3"
|
||||
android:hint="@string/message_compose_body_hint"
|
||||
android:inputType="textLongMessage|textMultiLine|textAutoCorrect|textCapSentences"
|
||||
android:imeOptions="actionDone|flagNoEnterAction"
|
||||
style="@style/PlainEditText"
|
||||
/>
|
||||
|
||||
<!-- quoted text bar -->
|
||||
|
@ -167,49 +231,45 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="4dip"
|
||||
android:paddingBottom="4dip"
|
||||
>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_alignParentTop="true"
|
||||
style="@style/horizontalDivider"
|
||||
/>
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="46dip"
|
||||
>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0"
|
||||
android:layout_gravity="left|center_vertical"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="?android:attr/textColorSecondaryInverse"
|
||||
android:layout_marginLeft="16dip"
|
||||
android:gravity="left|center_vertical"
|
||||
android:textSize="18dip"
|
||||
android:textColor="@color/text_secondary_color"
|
||||
android:text="@string/message_compose_quoted_text_label"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:layout_gravity="right|center_vertical"
|
||||
android:gravity="right|center_vertical"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="?android:attr/textColorSecondaryInverse"
|
||||
android:textSize="18dip"
|
||||
android:textColor="@color/text_primary_color"
|
||||
android:text="@string/message_compose_include_quoted_text_checkbox_label"
|
||||
/>
|
||||
<CheckBox
|
||||
android:id="@+id/include_quoted_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="48dip"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_alignParentBottom="true"
|
||||
style="@style/horizontalDivider"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
@ -220,6 +280,7 @@
|
|||
<WebView android:id="@+id/quoted_text"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginTop="16dip"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
|
|
@ -0,0 +1,93 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<!-- xlarge -->
|
||||
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="49dip"
|
||||
android:layout_marginBottom="-1dip"
|
||||
>
|
||||
<View
|
||||
android:id="@+id/divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginRight="@dimen/message_compose_header_button_area_width"
|
||||
android:layout_alignParentBottom="true"
|
||||
style="@style/horizontalDivider"
|
||||
/>
|
||||
<ImageView
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="48dip"
|
||||
android:layout_marginRight="16dip"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:src="@drawable/ic_attachment_holo_light"
|
||||
android:gravity="center"
|
||||
/>
|
||||
<!--
|
||||
Use FrameLayout to left-align the button image, within the width of
|
||||
@dimen/message_compose_header_button_area_width
|
||||
-->
|
||||
<FrameLayout
|
||||
android:id="@+id/attachment_delete_frame"
|
||||
android:layout_width="@dimen/message_compose_header_button_area_width"
|
||||
android:layout_height="48dip"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_gravity="center_vertical|left"
|
||||
>
|
||||
<ImageButton
|
||||
android:id="@+id/attachment_delete"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
style="@android:style/Widget.Holo.Button.Borderless"
|
||||
android:src="@drawable/ic_remove_attachment_holo_light"
|
||||
android:gravity="left|center_vertical"
|
||||
android:paddingTop="0dip"
|
||||
android:paddingBottom="0dip"
|
||||
android:paddingLeft="16dip"
|
||||
android:paddingRight="0dip"
|
||||
/>
|
||||
</FrameLayout>
|
||||
<TextView
|
||||
android:id="@+id/attachment_size"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="48dip"
|
||||
android:layout_marginLeft="8dip"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_toLeftOf="@id/attachment_delete_frame"
|
||||
android:textSize="14dip"
|
||||
android:textColor="@color/text_secondary_color"
|
||||
android:gravity="center_vertical|right"
|
||||
android:singleLine="true"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/attachment_name"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="48dip"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_toRightOf="@id/icon"
|
||||
android:layout_toLeftOf="@id/attachment_size"
|
||||
android:textSize="18dip"
|
||||
android:textColor="@color/text_secondary_color"
|
||||
android:gravity="center_vertical|left"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="start"
|
||||
/>
|
||||
<!-- TODO Show file size -->
|
||||
</RelativeLayout>
|
|
@ -96,6 +96,13 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" />
|
||||
<!-- Dummy view to keep it compatible with the xlarge counterpart -->
|
||||
<View
|
||||
android:id="@+id/attachment_container"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="0dip"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
<View android:layout_width="match_parent"
|
||||
android:layout_height="1dip"
|
||||
android:background="@drawable/divider_horizontal_email" />
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
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.
|
||||
|
@ -14,38 +14,47 @@
|
|||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!-- non-xlarge -->
|
||||
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="54dip"
|
||||
android:paddingRight="6dip"
|
||||
android:paddingTop="6dip"
|
||||
android:paddingBottom="6dip">
|
||||
<ImageButton
|
||||
android:id="@+id/attachment_delete"
|
||||
android:src="@drawable/ic_remove_attachment_holo_light"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_height="42dip"
|
||||
android:layout_width="42dip" />
|
||||
<TextView
|
||||
android:id="@+id/attachment_name"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="?android:attr/textColorSecondaryInverse"
|
||||
android:layout_width="1dip"
|
||||
android:layout_height="42dip"
|
||||
android:background="@drawable/text_box"
|
||||
android:paddingLeft="36dip"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="start"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginLeft="6dip"
|
||||
android:layout_marginRight="4dip"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_toLeftOf="@id/attachment_delete" />
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_attachment_holo_light"
|
||||
android:layout_marginLeft="1dip"
|
||||
android:layout_centerVertical="true" />
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="54dip"
|
||||
android:paddingRight="6dip"
|
||||
android:paddingTop="6dip"
|
||||
android:paddingBottom="6dip">
|
||||
<ImageButton
|
||||
android:id="@+id/attachment_delete"
|
||||
android:src="@drawable/ic_remove_attachment_holo_light"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_height="42dip"
|
||||
android:layout_width="42dip" />
|
||||
<TextView
|
||||
android:id="@+id/attachment_name"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="?android:attr/textColorSecondaryInverse"
|
||||
android:layout_width="1dip"
|
||||
android:layout_height="42dip"
|
||||
android:background="@drawable/text_box"
|
||||
android:paddingLeft="36dip"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="start"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginLeft="6dip"
|
||||
android:layout_marginRight="4dip"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_toLeftOf="@id/attachment_delete" />
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_attachment_holo_light"
|
||||
android:layout_marginLeft="1dip"
|
||||
android:layout_centerVertical="true" />
|
||||
<!-- Dummy view to keep it compatible with xlarge. -->
|
||||
<TextView
|
||||
android:id="@+id/attachment_size"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="0dip"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -48,17 +48,16 @@
|
|||
<style name="message_compose_header_field_container_no_tray" parent="PlainEditText">
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_marginTop">16dip</item>
|
||||
<item name="android:layout_marginLeft">16dip</item>
|
||||
<item name="android:layout_marginRight">4dip</item>
|
||||
<item name="android:layout_gravity">center_vertical</item>
|
||||
<item name="android:orientation">horizontal</item>
|
||||
</style>
|
||||
<style name="message_compose_header_field_container" parent="android:Widget.EditText">
|
||||
<style name="message_compose_header_field_container" parent="android:Widget.Holo.Light.EditText">
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_marginTop">16dip</item>
|
||||
<item name="android:layout_marginLeft">16dip</item>
|
||||
<item name="android:layout_marginRight">4dip</item>
|
||||
<item name="android:layout_height">48dip</item>
|
||||
<item name="android:layout_gravity">center_vertical</item>
|
||||
<item name="android:paddingTop">0dip</item>
|
||||
<item name="android:paddingBottom">0dip</item>
|
||||
<item name="android:paddingLeft">0dip</item>
|
||||
<item name="android:orientation">horizontal</item>
|
||||
<item name="android:addStatesFromChildren">true</item>
|
||||
<item name="android:focusable">false</item>
|
||||
|
@ -66,30 +65,29 @@
|
|||
</style>
|
||||
<style name="message_compose_header_field_label">
|
||||
<item name="android:layout_width">@dimen/message_compose_field_label_width</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_height">48dip</item>
|
||||
<item name="android:layout_weight">0</item>
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
<item name="android:paddingTop">0dip</item>
|
||||
<item name="android:paddingBottom">0dip</item>
|
||||
<item name="android:paddingLeft">16dip</item>
|
||||
<item name="android:paddingRight">16dip</item>
|
||||
<item name="android:ellipsize">end</item>
|
||||
<item name="android:singleLine">true</item>
|
||||
<item name="android:textAppearance">?android:attr/textAppearanceMedium</item>
|
||||
<item name="android:textColor">?android:attr/textColorSecondary</item>
|
||||
<item name="android:textSize">18dip</item>
|
||||
<item name="android:textColor">@color/text_secondary_color</item>
|
||||
</style>
|
||||
<style name="message_compose_header_field_value" parent="PlainEditText">
|
||||
<item name="android:layout_width">0dip</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_height">48dip</item>
|
||||
<item name="android:layout_weight">1</item>
|
||||
<item name="android:textAppearance">?android:attr/textAppearanceMedium</item>
|
||||
<item name="android:textColor">?android:attr/textColorPrimary</item>
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
<item name="android:paddingTop">0dip</item>
|
||||
<item name="android:paddingBottom">0dip</item>
|
||||
<item name="android:paddingLeft">0dip</item>
|
||||
<item name="android:paddingRight">0dip</item>
|
||||
<item name="android:textSize">18dip</item>
|
||||
<item name="android:textColor">@color/text_primary_color</item>
|
||||
<item name="android:singleLine">true</item>
|
||||
</style>
|
||||
|
||||
<style name="message_compose_message_content" parent="PlainEditText">
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_marginTop">16dip</item>
|
||||
<item name="android:layout_marginBottom">16dip</item>
|
||||
<item name="android:layout_marginLeft">16dip</item>
|
||||
<item name="android:layout_marginRight">16dip</item>
|
||||
<item name="android:textAppearance">?android:attr/textAppearanceMedium</item>
|
||||
<item name="android:textColor">?android:attr/textColorPrimary</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
|
|
@ -43,4 +43,7 @@
|
|||
<dimen name="widget_senders_font_size">14sp</dimen>
|
||||
<dimen name="widget_subject_font_size">14sp</dimen>
|
||||
<dimen name="widget_date_font_size">14sp</dimen>
|
||||
|
||||
<dimen name="message_compose_header_button_area_width">120dip</dimen>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -64,8 +64,8 @@
|
|||
</style>
|
||||
|
||||
<!-- EditText style without the "tray" -->
|
||||
<style name="PlainEditText" parent="android:Widget.EditText">
|
||||
<item name="android:background">#ffffff</item>
|
||||
<style name="PlainEditText" parent="android:Widget.Holo.Light.EditText">
|
||||
<item name="android:background">@null</item>
|
||||
</style>
|
||||
|
||||
<style name="horizontalDivider">
|
||||
|
|
|
@ -146,6 +146,7 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
|
|||
private View mCcBccContainer;
|
||||
private EditText mSubjectView;
|
||||
private EditText mMessageContentView;
|
||||
private View mAttachmentContainer;
|
||||
private LinearLayout mAttachments;
|
||||
private View mQuotedTextBar;
|
||||
private CheckBox mIncludeQuotedTextCheckBox;
|
||||
|
@ -455,6 +456,7 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
|
|||
mSubjectView = (EditText)findViewById(R.id.subject);
|
||||
mMessageContentView = (EditText)findViewById(R.id.message_content);
|
||||
mAttachments = (LinearLayout)findViewById(R.id.attachments);
|
||||
mAttachmentContainer = (LinearLayout)findViewById(R.id.attachment_container);
|
||||
mQuotedTextBar = findViewById(R.id.quoted_text_bar);
|
||||
mIncludeQuotedTextCheckBox = (CheckBox) findViewById(R.id.include_quoted_text);
|
||||
mQuotedText = (WebView)findViewById(R.id.quoted_text);
|
||||
|
@ -564,6 +566,8 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
|
|||
|
||||
mSubjectView.setOnFocusChangeListener(this);
|
||||
mMessageContentView.setOnFocusChangeListener(this);
|
||||
|
||||
updateAttachmentContainer();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1049,7 +1053,7 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
|
|||
|
||||
private void showCcBccFields() {
|
||||
mCcBccContainer.setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.add_cc_bcc).setVisibility(View.GONE);
|
||||
findViewById(R.id.add_cc_bcc).setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1127,7 +1131,10 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
|
|||
mAttachments, false);
|
||||
TextView nameView = (TextView)view.findViewById(R.id.attachment_name);
|
||||
ImageButton delete = (ImageButton)view.findViewById(R.id.attachment_delete);
|
||||
TextView sizeView = (TextView)view.findViewById(R.id.attachment_size);
|
||||
|
||||
nameView.setText(attachment.mFileName);
|
||||
sizeView.setText(Utility.formatSize(this, attachment.mSize));
|
||||
if (allowDelete) {
|
||||
delete.setOnClickListener(this);
|
||||
delete.setTag(view);
|
||||
|
@ -1136,6 +1143,12 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
|
|||
}
|
||||
view.setTag(attachment);
|
||||
mAttachments.addView(view);
|
||||
updateAttachmentContainer();
|
||||
}
|
||||
|
||||
private void updateAttachmentContainer() {
|
||||
mAttachmentContainer.setVisibility(mAttachments.getChildCount() == 0
|
||||
? View.GONE : View.VISIBLE);
|
||||
}
|
||||
|
||||
private void addAttachment(Uri uri) {
|
||||
|
@ -1184,6 +1197,7 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
|
|||
View attachmentView = (View) delButtonView.getTag();
|
||||
Attachment attachment = (Attachment) attachmentView.getTag();
|
||||
mAttachments.removeView(attachmentView);
|
||||
updateAttachmentContainer();
|
||||
if (attachment.isSaved()) {
|
||||
// The following async task for deleting attachments:
|
||||
// - can be started multiple times in parallel (to delete multiple attachments).
|
||||
|
|
Loading…
Reference in New Issue