We must have unique id's in order for the state to be saved automatically by the widget.

Also turned off extract mode for subject/ body as we already
did this in gmail at request of ux.
Fixes b/5161118 TO field drops all entry chips on rotation

Change-Id: Iada93bbf7ee457801340167aa1086b03b87b4268
This commit is contained in:
Mindy Pereira 2011-08-15 17:38:22 -07:00
parent e6bfd3f124
commit ac9975e745
6 changed files with 182 additions and 98 deletions

View File

@ -1,31 +0,0 @@
<?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.
-->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/ComposeFieldLinearLayout"
android:layout_alignParentTop="true">
<TextView style="@style/ComposeHeading"
android:text="@string/message_compose_to_hint"
android:id="@+id/label"/>
<com.android.email.activity.ChipsAddressTextView
style="@style/RecipientEditTextView"
android:layout_toRightOf="@id/label"
android:id="@+id/address_field" />
</RelativeLayout>

View File

@ -0,0 +1,83 @@
<?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.
-->
<!-- We must have unique ID's for the address fields in order to have the text
automatically saved by framework.-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_marginLeft="6dip"
android:layout_marginRight="6dip">
<RelativeLayout
style="@style/ComposeFieldLinearLayout"
android:layout_alignParentTop="true"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:id="@+id/to_content">
<TextView style="@style/ComposeHeading"
android:text="@string/message_compose_to_hint"
android:id="@+id/label"/>
<com.android.email.activity.ChipsAddressTextView
style="@style/RecipientEditTextView"
android:layout_toRightOf="@id/label"
android:id="@+id/to_address_field" />
</RelativeLayout>
<LinearLayout
android:layout_below="@id/to_content"
android:id="@+id/cc_bcc_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone">
<RelativeLayout
style="@style/ComposeFieldLinearLayout"
android:layout_alignParentTop="true"
android:id="@+id/cc_content">
<TextView style="@style/ComposeHeading"
android:text="@string/message_compose_to_hint"
android:id="@+id/label"/>
<com.android.email.activity.ChipsAddressTextView
style="@style/RecipientEditTextView"
android:layout_toRightOf="@id/label"
android:id="@+id/cc_address_field" />
</RelativeLayout>
<RelativeLayout
style="@style/ComposeFieldLinearLayout"
android:layout_alignParentTop="true"
android:id="@+id/bcc_content">
<TextView style="@style/ComposeHeading"
android:text="@string/message_compose_to_hint"
android:id="@+id/label"/>
<com.android.email.activity.ChipsAddressTextView
style="@style/RecipientEditTextView"
android:layout_toRightOf="@id/label"
android:id="@+id/bcc_address_field" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>

View File

@ -1,35 +0,0 @@
<?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.
-->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/ComposeFieldLinearLayout"
android:layout_alignParentTop="true">
<TextView style="@style/ComposeHeading"
android:text="@string/message_compose_to_hint"
android:id="@+id/label"/>
<com.android.email.activity.AddressTextView
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="?android:attr/textColorSecondary"
android:inputType="textEmailAddress|textMultiLine"
android:imeOptions="actionNext"
android:layout_weight="1"
android:layout_toRightOf="@id/label"
android:id="@+id/address_field" />
</RelativeLayout>

View File

@ -39,33 +39,8 @@
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="?android:attr/textColorSecondary"
/>
<!-- To -->
<FrameLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginLeft="6dip"
android:layout_marginRight="6dip">
<include android:id="@+id/to_content"
layout="@layout/address_text_view"/>
</FrameLayout>
<LinearLayout
android:id="@+id/cc_bcc_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone"
android:layout_marginLeft="6dip"
android:layout_marginRight="6dip">
<include android:id="@+id/cc_content"
layout="@layout/address_text_view"
android:layout_marginLeft="6dip"
android:layout_marginRight="6dip"/>
<include android:id="@+id/bcc_content"
layout="@layout/address_text_view"
android:layout_marginLeft="6dip"
android:layout_marginRight="6dip"/>
</LinearLayout>
<include layout="@layout/recipients_area"/>
<EditText android:id="@+id/subject"
android:layout_width="match_parent"
@ -77,7 +52,7 @@
android:hint="@string/message_compose_subject_hint"
android:inputType
="textEmailSubject|textAutoCorrect|textCapSentences|textMultiLine"
android:imeOptions="actionNext"
android:imeOptions="actionNext|flagNoExtractUi"
/>
<!--
@ -109,7 +84,7 @@
android:minLines="3"
android:hint="@string/message_compose_body_hint"
android:inputType="textMultiLine|textAutoCorrect|textCapSentences"
android:imeOptions="actionDone|flagNoEnterAction"
android:imeOptions="actionDone|flagNoEnterAction|flagNoExtractUi"
/>
<!-- quoted text bar -->
<RelativeLayout
@ -150,4 +125,4 @@
/>
</LinearLayout>
</ScrollView>
</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.
-->
<!-- We must have unique ID's for the address fields in order to have the text
automatically saved by framework.-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_marginLeft="6dip"
android:layout_marginRight="6dip">
<RelativeLayout
style="@style/ComposeFieldLinearLayout"
android:layout_alignParentTop="true"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:id="@+id/to_content">
<TextView style="@style/ComposeHeading"
android:id="@+id/label"/>
<com.android.email.activity.AddressTextView
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="?android:attr/textColorSecondary"
android:inputType="textEmailAddress|textMultiLine"
android:imeOptions="actionNext"
android:layout_weight="1"
android:layout_toRightOf="@id/label"
android:id="@+id/to_address_field" />
</RelativeLayout>
<LinearLayout
android:layout_below="@id/to_content"
android:id="@+id/cc_bcc_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone">
<RelativeLayout
style="@style/ComposeFieldLinearLayout"
android:layout_alignParentTop="true"
android:id="@+id/cc_content">
<TextView style="@style/ComposeHeading"
android:id="@+id/label"/>
<com.android.email.activity.AddressTextView
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="?android:attr/textColorSecondary"
android:inputType="textEmailAddress|textMultiLine"
android:imeOptions="actionNext"
android:layout_weight="1"
android:layout_toRightOf="@id/label"
android:id="@+id/cc_address_field" />
</RelativeLayout>
<RelativeLayout
style="@style/ComposeFieldLinearLayout"
android:layout_alignParentTop="true"
android:id="@+id/bcc_content">
<TextView style="@style/ComposeHeading"
android:id="@+id/label"/>
<com.android.email.activity.AddressTextView
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="?android:attr/textColorSecondary"
android:inputType="textEmailAddress|textMultiLine"
android:imeOptions="actionNext"
android:layout_weight="1"
android:layout_toRightOf="@id/label"
android:id="@+id/bcc_address_field" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>

View File

@ -661,16 +661,16 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
private void initViews() {
ViewGroup toParent = UiUtilities.getViewOrNull(this, R.id.to_content);
if (toParent != null) {
mToView = (MultiAutoCompleteTextView) toParent.findViewById(R.id.address_field);
mToView = (MultiAutoCompleteTextView) toParent.findViewById(R.id.to_address_field);
((TextView) toParent.findViewById(R.id.label))
.setText(R.string.message_compose_to_hint);
ViewGroup ccParent, bccParent;
ccParent = (ViewGroup) findViewById(R.id.cc_content);
mCcView = (MultiAutoCompleteTextView) ccParent.findViewById(R.id.address_field);
mCcView = (MultiAutoCompleteTextView) ccParent.findViewById(R.id.cc_address_field);
((TextView) ccParent.findViewById(R.id.label))
.setText(R.string.message_compose_cc_hint);
bccParent = (ViewGroup) findViewById(R.id.bcc_content);
mBccView = (MultiAutoCompleteTextView) bccParent.findViewById(R.id.address_field);
mBccView = (MultiAutoCompleteTextView) bccParent.findViewById(R.id.bcc_address_field);
((TextView) bccParent.findViewById(R.id.label))
.setText(R.string.message_compose_bcc_hint);
} else {