XL layout for message compose

The layout is not final, but it's closer to the wireframe.
- All dimensions and colors are not final.  I just made them up.
- The "+cc/bcc" and "add attachment" buttons are in the wrong position.

I'll wait for the pixel perfect before addressing them.

Bug 3138037

Change-Id: I72fc7557c28e72df08a3751c3c93acfb35749d68
This commit is contained in:
Makoto Onuki 2010-11-15 12:12:09 -08:00
parent 28214840dc
commit 15f46cc715
8 changed files with 340 additions and 1 deletions

View File

@ -0,0 +1,216 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 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 -->
<!-- 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: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: -->
<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"
android:text="@string/message_compose_from_label"
/>
</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"
/>
</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"
/>
</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"
/>
</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"
/>
</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"
/>
<Button
android:id="@+id/add_attachment"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/add_attachment_action"
/>
<!--
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:gravity="left|top"
android:minLines="3"
android:hint="@string/message_compose_body_hint"
android:inputType="textLongMessage|textMultiLine|textAutoCorrect|textCapSentences"
android:imeOptions="actionDone|flagNoEnterAction"
/>
<!-- quoted text bar -->
<RelativeLayout
android:id="@+id/quoted_text_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="4dip"
android:paddingBottom="4dip"
>
<View
id="@+id/topDivider"
android:layout_alignParentTop="true"
style="@style/message_compose_divider"
/>
<View
id="@+id/bottomDivider"
android:layout_alignParentBottom="true"
style="@style/message_compose_divider"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@id/topDivider"
android:layout_above="@id/bottomDivider"
android:layout_centerVertical="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="?android:attr/textColorSecondaryInverse"
android:text="@string/message_compose_quoted_text_label"
/>
<CheckBox
android:id="@+id/include_quoted_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@id/topDivider"
android:layout_above="@id/bottomDivider"
android:layout_centerVertical="true"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/include_quoted_text"
android:layout_below="@id/topDivider"
android:layout_above="@id/bottomDivider"
android:layout_centerVertical="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="?android:attr/textColorSecondaryInverse"
android:text="@string/message_compose_include_quoted_text_checkbox_label"
/>
</RelativeLayout>
<!--
Quoted text
TODO: Don't put a webview in a scroll view.
-->
<WebView android:id="@+id/quoted_text"
android:layout_height="wrap_content"
android:layout_width="match_parent"
/>
</LinearLayout>
</ScrollView>
</FrameLayout>

View File

@ -14,6 +14,7 @@
limitations under the License.
-->
<!-- small -->
<!-- TODO Simplify this. This layout is way too deep. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
@ -28,6 +29,13 @@
<LinearLayout android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:background="#ededed">
<!-- Invisible from field to keep it compatible with the xlarge counterpart. -->
<TextView
android:id="@+id/from"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
/>
<com.android.email.activity.AddressTextView
android:id="@+id/to" android:layout_width="match_parent"
android:layout_height="wrap_content"

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 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, landscape -->
<resources>
<!-- message compose STOPSHIP not final -->
<dimen name="message_compose_paper_width">800dip</dimen>
<dimen name="message_compose_field_label_width">120dip</dimen>
</resources>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 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, portrait -->
<resources>
<!-- message compose STOPSHIP not final -->
<dimen name="message_compose_paper_width">700dip</dimen>
<dimen name="message_compose_field_label_width">120dip</dimen>
</resources>

View File

@ -30,4 +30,58 @@
<item name="android:textSize">24sp</item>
</style>
<!-- Message compose STOPSHIP not final -->
<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:orientation">horizontal</item>
</style>
<style name="message_compose_header_field_container" parent="android:Widget.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:orientation">horizontal</item>
<item name="android:addStatesFromChildren">true</item>
<item name="android:focusable">false</item>
<item name="android:focusableInTouchMode">false</item>
</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_weight">0</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>
</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_weight">1</item>
<item name="android:textAppearance">?android:attr/textAppearanceMedium</item>
<item name="android:textColor">?android:attr/textColorPrimary</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>
<style name="message_compose_divider">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">1dip</item>
<!-- STOPSHIP Use same color as EditText tray? -->
<item name="android:background">#ff808080</item>
</style>
</resources>

View File

@ -308,6 +308,16 @@
<string name="message_compose_bcc_hint">Bcc</string>
<!-- Hint text in Subject field -->
<string name="message_compose_subject_hint">Subject</string>
<!-- Label for From field [CHAR LIMIT=12] -->
<string name="message_compose_from_label">From:</string>
<!-- Label for To field [CHAR LIMIT=12] -->
<string name="message_compose_to_label">To:</string>
<!-- Label for Cc field [CHAR LIMIT=12] -->
<string name="message_compose_cc_label">Cc:</string>
<!-- Label for Bcc field [CHAR LIMIT=12] -->
<string name="message_compose_bcc_label">Bcc:</string>
<!-- Label for Subject field [CHAR LIMIT=12] -->
<string name="message_compose_subject_label">Subject:</string>
<!-- Hint text in Message composer body field -->
<string name="message_compose_body_hint">Compose Mail</string>
<!-- Header for forwarded original messages -->

View File

@ -48,4 +48,9 @@
<item name="android:layout_height">40sp</item>
<item name="android:textAppearance">?android:attr/textColorPrimary</item>
</style>
<!-- EditText style without the "tray" -->
<style name="PlainEditText" parent="android:Widget.EditText">
<item name="android:background">#ffffff</item>
</style>
</resources>

View File

@ -143,6 +143,7 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
private boolean mSourceMessageProcessed = false;
private ActionBar mActionBar;
private TextView mFromView;
private MultiAutoCompleteTextView mToView;
private MultiAutoCompleteTextView mCcView;
private MultiAutoCompleteTextView mBccView;
@ -266,7 +267,7 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
private void setAccount(Account account) {
mAccount = account;
if (account != null) {
mActionBar.setSubtitle(account.mDisplayName);
mFromView.setText(account.mEmailAddress);
mAddressAdapterTo.setAccount(account);
mAddressAdapterCc.setAccount(account);
mAddressAdapterBcc.setAccount(account);
@ -432,6 +433,7 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
private void initViews() {
mActionBar = getActionBar();
mFromView = (TextView)findViewById(R.id.from);
mToView = (MultiAutoCompleteTextView)findViewById(R.id.to);
mCcView = (MultiAutoCompleteTextView)findViewById(R.id.cc);
mBccView = (MultiAutoCompleteTextView)findViewById(R.id.bcc);