Do 2 buttons for attach on tablet; remove unused assets
1 for attach photo, 1 for attach video
Change-Id: I6b4a22a47d9e746024d05e10932bc15d9624b1e6
diff --git a/res/drawable-hdpi/swiped_bg.9.png b/res/drawable-hdpi/swiped_bg.9.png
deleted file mode 100644
index 3355aef..0000000
--- a/res/drawable-hdpi/swiped_bg.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/swiped_bg.9.png b/res/drawable-mdpi/swiped_bg.9.png
deleted file mode 100644
index 6bfe72a..0000000
--- a/res/drawable-mdpi/swiped_bg.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/swiped_bg.9.png b/res/drawable-xhdpi/swiped_bg.9.png
deleted file mode 100644
index 067b531..0000000
--- a/res/drawable-xhdpi/swiped_bg.9.png
+++ /dev/null
Binary files differ
diff --git a/res/layout-sw600dp/compose.xml b/res/layout-sw600dp/compose.xml
index 91d5cd5..b2e59c0 100644
--- a/res/layout-sw600dp/compose.xml
+++ b/res/layout-sw600dp/compose.xml
@@ -31,56 +31,130 @@
android:fillViewport="true"
android:id="@+id/compose"
android:visibility="gone">
-
- <LinearLayout
- android:id="@+id/compose_scrollview"
- android:orientation="vertical"
+ <TableLayout android:id="@+id/content"
android:layout_width="@dimen/compose_scrollview_width"
android:layout_height="match_parent"
android:paddingTop="8dip"
android:background="@android:color/white"
- android:layout_gravity="center_horizontal">
-
- <LinearLayout
- android:id="@+id/content"
+ android:layout_gravity="center_horizontal"
+ android:paddingLeft="@dimen/compose_area_left_padding"
+ android:animateLayoutChanges="true">
+ <TableRow
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:animateLayoutChanges="true"
- android:orientation="vertical"
- android:paddingLeft="@dimen/compose_area_left_padding">
-
- <LinearLayout
- android:orientation="horizontal"
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
-
- <!-- For the to, cc, bcc, and subject -->
- <LinearLayout android:id="@+id/wrapper"
- android:orientation="vertical"
- android:layout_width="wrap_content"
- android:layout_weight="1"
- android:layout_height="wrap_content">
-
- <include layout="@layout/compose_from"/>
-
- <include layout="@layout/compose_recipients"/>
-
- </LinearLayout>
-
- <include layout="@layout/compose_buttons"/>
-
- </LinearLayout>
-
+ android:layout_height="wrap_content">
<FrameLayout
- android:layout_width="match_parent"
+ android:layout_width="0dip"
+ android:layout_weight="1"
android:layout_height="wrap_content"
+ android:layout_column="1"
android:layout_marginRight="@dimen/compose_area_right_padding">
- <include layout="@layout/compose_subject"/>
+ <include layout="@layout/compose_from"/>
</FrameLayout>
+ </TableRow>
+ <TableRow
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+ <LinearLayout
+ android:id="@+id/to_content"
+ style="@style/RecipientComposeFieldLayout"
+ android:layout_column="1"
+ android:layout_width="0dip"
+ android:layout_weight="1">
+ <LinearLayout android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:addStatesFromChildren="true"
+ android:gravity="center_vertical"
+ android:layout_gravity="center_vertical">
+
+ <TextView style="@style/RecipientComposeHeading"
+ android:text="@string/to"
+ android:id="@+id/to_label"
+ android:contentDescription="@string/to"/>
+
+ <com.android.ex.chips.RecipientEditTextView
+ android:id="@+id/to"
+ style="@style/RecipientEditTextViewStyle"
+ android:contentDescription="@string/to"/>
+
+ </LinearLayout>
+
+ <View style="@style/RecipientComposeFieldSpacer"/>
+ </LinearLayout>
+ <Button android:id="@+id/add_cc_bcc"
+ android:text="@string/add_cc_label"
+ style="@style/ComposeButton"
+ android:layout_width="wrap_content"
+ android:minWidth="@dimen/compose_button_width"
+ android:layout_column="2"
+ android:layout_gravity="center_vertical|left"
+ android:gravity="left"
+ android:layout_marginTop="16dip"
+ android:paddingLeft="8dip"/>
+ </TableRow>
+ <TableRow
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginRight="@dimen/compose_button_width">
+ <com.android.mail.compose.CcBccView
+ android:layout_height="wrap_content"
+ android:id="@+id/cc_bcc_wrapper"
+ android:layout_column="1"
+ android:layout_width="0dip"
+ android:layout_weight="1"/>
+ </TableRow>
+ <TableRow
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+ <RelativeLayout
+ android:id="@+id/subject_wrapper"
+ style="@style/ComposeFieldLayout"
+ android:layout_column="1"
+ android:layout_weight="1"
+ android:layout_width="0dip">
+ <!-- Subject: localization cannot control what field pressing tab will bring the user to. This is controlled at runtime. -->
+ <EditText android:id="@+id/subject"
+ android:inputType="textEmailSubject|textAutoCorrect|textCapSentences|textImeMultiLine|textMultiLine"
+ android:hint="@string/subject_hint"
+ android:textColorHint="@color/compose_label_text"
+ android:imeOptions="actionDone|flagNoExtractUi"
+ style="@style/ComposeEditTextView" />
+ </RelativeLayout>
+ <ImageView android:id="@+id/add_photo_attachment"
+ android:text="@string/add_file_attachment"
+ android:layout_width="@dimen/compose_button_width"
+ android:layout_height="wrap_content"
+ android:src="@drawable/ic_attachment_holo_light"
+ android:clickable="true"
+ android:layout_gravity="center_vertical|left"
+ android:gravity="left"
+ android:layout_column="2" />
+ </TableRow>
+ <TableRow
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+ <!-- Compose Area -->
+ <FrameLayout android:layout_width="0dip"
+ android:layout_weight="1"
+ android:layout_height="wrap_content"
+ android:id="@+id/compose_wrapper"
+ android:layout_column="1">
+ <include layout="@layout/compose_body"/>
+ </FrameLayout>
+ <ImageView android:id="@+id/add_video_attachment"
+ android:text="@string/add_file_attachment"
+ android:layout_width="@dimen/compose_button_width"
+ android:src="@drawable/ic_attachment_holo_light"
+ android:clickable="true"
+ android:layout_gravity="center_vertical|left"
+ android:gravity="left"
+ android:layout_column="2"/>
+ </TableRow>
+ <TableRow
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
<!-- Attachments -->
<com.android.mail.compose.AttachmentsView android:id="@+id/attachments"
android:layout_height="wrap_content"
- android:layout_width="match_parent"
android:orientation="vertical"
android:layout_marginTop="8dip"
android:layout_marginRight="@dimen/compose_area_right_padding"
@@ -88,36 +162,37 @@
android:paddingTop="2dip"
android:paddingBottom="0dip"
android:paddingLeft="0dip"
- android:visibility="gone" >
+ android:visibility="gone"
+ android:layout_column="1"
+ android:layout_weight="1"
+ android:layout_width="0dip" >
<include layout="@layout/compose_attachments" />
</com.android.mail.compose.AttachmentsView>
-
- <!-- Compose Area -->
- <FrameLayout android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginRight="@dimen/compose_area_right_padding">
-
- <include layout="@layout/compose_body"/>
-
- </FrameLayout>
-
+ </TableRow>
+ <TableRow
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
<!-- Quoted text -->
<com.android.mail.compose.QuotedTextView android:id="@+id/quoted_text_view"
android:layout_height="wrap_content"
- android:layout_width="match_parent"
android:visibility="gone"
- android:layout_marginRight="@dimen/compose_area_right_padding" />
-
+ android:layout_marginRight="@dimen/compose_area_right_padding"
+ android:layout_column="1"
+ android:layout_weight="1"
+ android:layout_width="0dip"/>
+ </TableRow>
+ <TableRow
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
<FrameLayout
android:id="@+id/composearea_tap_trap_bottom"
android:layout_weight="1"
- android:layout_height="0dip"
- android:layout_width="match_parent"
- android:clickable="true"/>
+ android:layout_height="wrap_content"
+ android:layout_width="0dip"
+ android:clickable="true" android:layout_column="1"/>
+ </TableRow>
- </LinearLayout>
-
- </LinearLayout>
+ </TableLayout>
</ScrollView>
-</FrameLayout>
+</FrameLayout>
\ No newline at end of file
diff --git a/res/layout-sw600dp/compose_buttons.xml b/res/layout-sw600dp/compose_buttons.xml
deleted file mode 100644
index f94c9b8..0000000
--- a/res/layout-sw600dp/compose_buttons.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2011 Google Inc.
- Licensed to 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.
--->
-<!-- For add attachments and +cc/bcc -->
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_height="match_parent"
- android:layout_width="wrap_content"
- style="@style/ComposeButtonColumn">
-
- <Button android:id="@+id/add_cc_bcc"
- android:text="@string/add_cc_label"
- style="@style/ComposeButton"
- android:layout_marginLeft="16dip"
- android:layout_gravity="bottom" />
-
-</FrameLayout>
diff --git a/res/layout/compose_subject.xml b/res/layout/compose_subject.xml
index 8b454f1..6ceaf0b 100644
--- a/res/layout/compose_subject.xml
+++ b/res/layout/compose_subject.xml
@@ -17,7 +17,7 @@
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/ComposeFieldLayout"
- android:layout_below="@id/cc_bcc_wrapper">
+ android:layout_below="@id/cc_bcc_wrapper">
<!-- Subject: localization cannot control what field pressing tab will bring the user to. This is controlled at runtime. -->
<EditText android:id="@+id/subject"
android:inputType="textEmailSubject|textAutoCorrect|textCapSentences|textImeMultiLine|textMultiLine"
diff --git a/res/menu-sw600dp/compose_menu.xml b/res/menu-sw600dp/compose_menu.xml
index c987bb0..5f5943b 100644
--- a/res/menu-sw600dp/compose_menu.xml
+++ b/res/menu-sw600dp/compose_menu.xml
@@ -22,16 +22,6 @@
android:title="@string/send"
android:icon="@drawable/send" />
- <item android:id="@+id/add_photo_attachment"
- android:icon="@drawable/ic_attachment_holo_light"
- android:title="@string/add_photo_attachment"
- android:showAsAction="never" />
-
- <item android:id="@+id/add_video_attachment"
- android:icon="@drawable/ic_attachment_holo_light"
- android:title="@string/add_video_attachment"
- android:showAsAction="never" />
-
<item android:id="@+id/save"
android:showAsAction="never"
android:title="@string/save_draft"
diff --git a/res/values/dimen.xml b/res/values/dimen.xml
index a1b03ea..cb64129 100644
--- a/res/values/dimen.xml
+++ b/res/values/dimen.xml
@@ -100,4 +100,5 @@
<dimen name="wait_padding">16dp</dimen>
<dimen name="senders_textview_top_padding">-4dp</dimen>
<dimen name="senders_textview_height">30dp</dimen>
+ <dimen name="compose_button_width">100dip</dimen>
</resources>
diff --git a/src/com/android/mail/compose/ComposeActivity.java b/src/com/android/mail/compose/ComposeActivity.java
index f42f997..2e66d07 100644
--- a/src/com/android/mail/compose/ComposeActivity.java
+++ b/src/com/android/mail/compose/ComposeActivity.java
@@ -235,6 +235,8 @@
private long mDraftId = UIProvider.INVALID_MESSAGE_ID;
private Message mDraft;
private Object mDraftLock = new Object();
+ private ImageView mPhotoAttachmentsButton;
+ private ImageView mVideoAttachmentsButton;
/**
* Boolean indicating whether ComposeActivity was launched from a Gmail controlled view.
@@ -861,6 +863,14 @@
}
mCcBccView = (CcBccView) findViewById(R.id.cc_bcc_wrapper);
mAttachmentsView = (AttachmentsView)findViewById(R.id.attachments);
+ mPhotoAttachmentsButton = (ImageView) findViewById(R.id.add_photo_attachment);
+ if (mPhotoAttachmentsButton != null) {
+ mPhotoAttachmentsButton.setOnClickListener(this);
+ }
+ mVideoAttachmentsButton = (ImageView) findViewById(R.id.add_video_attachment);
+ if (mVideoAttachmentsButton != null) {
+ mVideoAttachmentsButton.setOnClickListener(this);
+ }
LayoutTransition transition =
((ViewGroup) findViewById(R.id.content)).getLayoutTransition();
mAttachmentsView.setComposeLayoutTransition(transition);
@@ -1284,7 +1294,7 @@
mCcBccButton.setText(getString(!ccVisible ? R.string.add_cc_label
: R.string.add_bcc_label));
} else {
- mCcBccButton.setVisibility(View.GONE);
+ mCcBccButton.setVisibility(View.INVISIBLE);
}
}
}
@@ -1562,6 +1572,12 @@
// Animate in cc/bcc.
showCcBccViews();
break;
+ case R.id.add_photo_attachment:
+ doAttach(MIME_TYPE_PHOTO);
+ break;
+ case R.id.add_video_attachment:
+ doAttach(MIME_TYPE_VIDEO);
+ break;
}
}
@@ -2360,7 +2376,7 @@
private void showCcBccViews() {
mCcBccView.show(true, true, true);
if (mCcBccButton != null) {
- mCcBccButton.setVisibility(View.GONE);
+ mCcBccButton.setVisibility(View.INVISIBLE);
}
}