diff options
author | mindyp <mindyp@google.com> | 2012-08-29 16:32:15 -0700 |
---|---|---|
committer | mindyp <mindyp@google.com> | 2012-08-30 08:54:10 -0700 |
commit | 93b079ba1d38d919b557dabcd971e7aa1e3f5cbc (patch) | |
tree | 4220fc38f35c0c54940d08a99778cfb17bbda3f1 | |
parent | daaf8061dc6fc3cf9f2dda352988c9de08e1a8a8 (diff) | |
download | android_packages_apps_UnifiedEmail-93b079ba1d38d919b557dabcd971e7aa1e3f5cbc.tar.gz android_packages_apps_UnifiedEmail-93b079ba1d38d919b557dabcd971e7aa1e3f5cbc.tar.bz2 android_packages_apps_UnifiedEmail-93b079ba1d38d919b557dabcd971e7aa1e3f5cbc.zip |
Update compose layout to put add photo/add video next to each other
Change-Id: I85723237bc12d74848262ba5dcee62884ec6cd60
-rw-r--r-- | res/layout-sw600dp/compose.xml | 111 | ||||
-rw-r--r-- | res/values-sw600dp-port/dimen.xml | 2 | ||||
-rw-r--r-- | res/values/dimen.xml | 1 | ||||
-rw-r--r-- | res/values/styles.xml | 16 | ||||
-rw-r--r-- | src/com/android/mail/compose/ComposeActivity.java | 8 |
5 files changed, 71 insertions, 67 deletions
diff --git a/res/layout-sw600dp/compose.xml b/res/layout-sw600dp/compose.xml index c09db798c..02318b2ea 100644 --- a/res/layout-sw600dp/compose.xml +++ b/res/layout-sw600dp/compose.xml @@ -38,16 +38,13 @@ android:background="@android:color/white" android:layout_gravity="center_horizontal" android:paddingLeft="@dimen/compose_area_left_padding" + android:paddingRight="@dimen/compose_area_right_padding" android:animateLayoutChanges="true"> <TableRow android:layout_width="match_parent" android:layout_height="wrap_content"> <FrameLayout - 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"> + style="@style/FillRowStyle"> <include layout="@layout/compose_from"/> </FrameLayout> </TableRow> @@ -56,15 +53,18 @@ 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_weight="1" + style="@style/RecipientComposeFieldLayout" + android:paddingRight="8dp" + android:orientation="horizontal"> + <LinearLayout android:layout_width="0dip" android:layout_height="wrap_content" - android:addStatesFromChildren="true" + android:layout_weight="1" android:gravity="center_vertical" - android:layout_gravity="center_vertical"> + android:layout_gravity="center_vertical" + android:addStatesFromChildren="true"> <TextView style="@style/RecipientComposeHeading" android:text="@string/to" @@ -78,29 +78,23 @@ </LinearLayout> - <View style="@style/RecipientComposeFieldSpacer"/> + <Button android:id="@+id/add_cc_bcc" + android:text="@string/add_cc_label" + style="@style/ComposeButton" + android:layout_width="wrap_content" + android:layout_column="2" + android:layout_gravity="bottom" + android:gravity="bottom" + android:layout_marginTop="16dip" + android:paddingLeft="8dip"/> </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"> + android:layout_height="wrap_content"> <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"/> + style="@style/FillRowStyle"/> </TableRow> <TableRow android:layout_width="match_parent" @@ -115,53 +109,53 @@ <com.android.mail.compose.EnterSubject android:id="@+id/subject" style="@style/ComposeSubjectView" /> </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_attach_image_holo_light" - android:clickable="true" - android:layout_gravity="center_vertical|left" - android:gravity="left" - android:layout_column="2" /> + <RelativeLayout android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_column="2"> + <RelativeLayout android:id="@+id/add_photo_attachment" + style="@style/AttachmentButtonStyle"> + <ImageView + android:text="@string/add_file_attachment" + android:src="@drawable/ic_attach_image_holo_light" + android:clickable="false" + android:layout_width="wrap_content" + android:layout_height="wrap_content"/> + </RelativeLayout> + <RelativeLayout android:id="@+id/add_video_attachment" + android:layout_toRightOf="@id/add_photo_attachment" + style="@style/AttachmentButtonStyle"> + <ImageView + android:text="@string/add_file_attachment" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:src="@drawable/ic_attach_video_holo_light" + android:clickable="false"/> + </RelativeLayout> + </RelativeLayout> </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" + <FrameLayout android:id="@+id/compose_wrapper" - android:layout_column="1"> + style="@style/FillRowStyle"> <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_attach_video_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:orientation="vertical" android:layout_marginTop="8dip" - android:layout_marginRight="@dimen/compose_area_right_padding" android:animateLayoutChanges="true" android:paddingTop="2dip" android:paddingBottom="0dip" android:paddingLeft="0dip" android:visibility="gone" - android:layout_column="1" - android:layout_weight="1" - android:layout_width="0dip" > + style="@style/FillRowStyle"> <include layout="@layout/compose_attachments" /> </com.android.mail.compose.AttachmentsView> </TableRow> @@ -172,20 +166,15 @@ <com.android.mail.compose.QuotedTextView android:id="@+id/quoted_text_view" android:layout_height="wrap_content" android:visibility="gone" - android:layout_marginRight="@dimen/compose_area_right_padding" - android:layout_column="1" - android:layout_weight="1" - android:layout_width="0dip"/> + style="@style/FillRowStyle"/> </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="wrap_content" - android:layout_width="0dip" - android:clickable="true" android:layout_column="1"/> + style="@style/FillRowStyle" + android:clickable="true"/> </TableRow> </TableLayout> diff --git a/res/values-sw600dp-port/dimen.xml b/res/values-sw600dp-port/dimen.xml index 98c334a58..5c2be7b4d 100644 --- a/res/values-sw600dp-port/dimen.xml +++ b/res/values-sw600dp-port/dimen.xml @@ -18,6 +18,6 @@ <resources> <dimen name="compose_scrollview_width">600dip</dimen> <dimen name="compose_area_left_padding">76dip</dimen> - <dimen name="compose_area_right_padding">100dip</dimen> + <dimen name="compose_area_right_padding">76dip</dimen> <dimen name="search_view_width">400dip</dimen> </resources> diff --git a/res/values/dimen.xml b/res/values/dimen.xml index ec2d3523c..0d7772d59 100644 --- a/res/values/dimen.xml +++ b/res/values/dimen.xml @@ -101,5 +101,4 @@ <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/res/values/styles.xml b/res/values/styles.xml index e7daf655d..d7bded2a9 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -467,4 +467,20 @@ <style name="AccountSpinnerStyle"> <item name="android:layout_width">wrap_content</item> </style> + + <style name="AttachmentButtonStyle"> + <item name="android:clickable">true</item> + <item name="android:layout_width">48dip</item> + <item name="android:layout_height">48dip</item> + <item name="android:background">?android:attr/selectableItemBackground</item> + <item name="android:addStatesFromChildren">true</item> + <item name="android:gravity">bottom|center_horizontal</item> + </style> + + <style name="FillRowStyle"> + <item name="android:layout_width">0dip</item> + <item name="android:layout_weight">1</item> + <item name="android:layout_height">wrap_content</item> + <item name="android:layout_column">1</item> + </style> </resources> diff --git a/src/com/android/mail/compose/ComposeActivity.java b/src/com/android/mail/compose/ComposeActivity.java index ef9682b8d..103191717 100644 --- a/src/com/android/mail/compose/ComposeActivity.java +++ b/src/com/android/mail/compose/ComposeActivity.java @@ -239,8 +239,8 @@ public class ComposeActivity extends Activity implements OnClickListener, OnNavi private long mDraftId = UIProvider.INVALID_MESSAGE_ID; private Message mDraft; private Object mDraftLock = new Object(); - private ImageView mPhotoAttachmentsButton; - private ImageView mVideoAttachmentsButton; + private View mPhotoAttachmentsButton; + private View mVideoAttachmentsButton; /** * Boolean indicating whether ComposeActivity was launched from a Gmail controlled view. @@ -873,11 +873,11 @@ public class ComposeActivity extends Activity implements OnClickListener, OnNavi } mCcBccView = (CcBccView) findViewById(R.id.cc_bcc_wrapper); mAttachmentsView = (AttachmentsView)findViewById(R.id.attachments); - mPhotoAttachmentsButton = (ImageView) findViewById(R.id.add_photo_attachment); + mPhotoAttachmentsButton = findViewById(R.id.add_photo_attachment); if (mPhotoAttachmentsButton != null) { mPhotoAttachmentsButton.setOnClickListener(this); } - mVideoAttachmentsButton = (ImageView) findViewById(R.id.add_video_attachment); + mVideoAttachmentsButton = findViewById(R.id.add_video_attachment); if (mVideoAttachmentsButton != null) { mVideoAttachmentsButton.setOnClickListener(this); } |