Switch to Light Holo theme, clean up menu options.
- Changed the default theme to Light.Holo - MessageCompose now has ActionBar. - Removed unnecessary MessageCompose menu items. - Also removed "Add Account" menu from MessageListXL. (Use the + button on account settings) - Fixed "calender response section invisible" bug. Bug 2926517 Change-Id: Id27632ec82dad158f43b0903dbc2cb219188400d
This commit is contained in:
parent
61bddf2519
commit
2f4e87c223
|
@ -56,19 +56,12 @@
|
|||
android:description="@string/permission_access_provider_desc"/>
|
||||
<uses-permission android:name="com.android.email.permission.ACCESS_PROVIDER"/>
|
||||
|
||||
<!--
|
||||
Regarding android:theme
|
||||
Some of the activities can't handle ActionBar, which comes with the new
|
||||
default theme "Holo". Explicitly set the traditional default theme.
|
||||
TODO This should go away. (Or make Light.Holo default)
|
||||
-->
|
||||
<application android:icon="@drawable/icon" android:label="@string/app_name"
|
||||
android:name="Email"
|
||||
android:theme="@android:style/Theme"
|
||||
android:theme="@android:style/Theme.Light.Holo"
|
||||
>
|
||||
<activity
|
||||
android:name=".activity.Welcome"
|
||||
android:theme="@android:style/Theme.WithActionBar" >
|
||||
>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
@ -80,28 +73,33 @@
|
|||
android:name=".activity.UpgradeAccounts"
|
||||
android:label="@string/upgrade_accounts_title"
|
||||
android:theme="@android:style/Theme.NoTitleBar"
|
||||
android:configChanges="keyboardHidden|orientation" >
|
||||
android:configChanges="keyboardHidden|orientation"
|
||||
>
|
||||
</activity>
|
||||
<!-- Must be exported in order for the AccountManager to launch it -->
|
||||
<activity
|
||||
android:name=".activity.setup.AccountSetupBasics"
|
||||
android:label="@string/account_setup_basics_title"
|
||||
android:theme="@android:style/Theme"
|
||||
android:exported="true"
|
||||
>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activity.setup.AccountSetupAccountType"
|
||||
android:label="@string/account_setup_account_type_title"
|
||||
android:theme="@android:style/Theme"
|
||||
>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activity.setup.AccountSetupIncoming"
|
||||
android:label="@string/account_setup_incoming_title"
|
||||
android:theme="@android:style/Theme"
|
||||
>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activity.setup.AccountSetupOutgoing"
|
||||
android:label="@string/account_setup_outgoing_title"
|
||||
android:theme="@android:style/Theme"
|
||||
>
|
||||
</activity>
|
||||
<!--EXCHANGE-REMOVE-SECTION-START-->
|
||||
|
@ -110,6 +108,7 @@
|
|||
<activity
|
||||
android:name=".activity.setup.AccountSetupExchange"
|
||||
android:label="@string/account_setup_exchange_title"
|
||||
android:theme="@android:style/Theme"
|
||||
android:configChanges="keyboardHidden|orientation"
|
||||
>
|
||||
</activity>
|
||||
|
@ -117,11 +116,13 @@
|
|||
<activity
|
||||
android:name=".activity.setup.AccountSetupOptions"
|
||||
android:label="@string/account_setup_options_title"
|
||||
android:theme="@android:style/Theme"
|
||||
>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activity.setup.AccountSetupNames"
|
||||
android:label="@string/account_setup_names_title"
|
||||
android:theme="@android:style/Theme"
|
||||
>
|
||||
</activity>
|
||||
<!-- XXX Note: this activity is hacked to ignore config changes,
|
||||
|
@ -129,12 +130,14 @@
|
|||
<activity
|
||||
android:name=".activity.setup.AccountSetupCheckSettings"
|
||||
android:label="@string/account_setup_check_settings_title"
|
||||
android:theme="@android:style/Theme"
|
||||
android:configChanges="keyboardHidden|orientation"
|
||||
>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activity.setup.AccountSettings"
|
||||
android:label="@string/account_settings_action"
|
||||
android:theme="@android:style/Theme"
|
||||
>
|
||||
<intent-filter>
|
||||
<action android:name="com.android.email.activity.setup.ACCOUNT_MANAGER_ENTRY" />
|
||||
|
@ -146,7 +149,6 @@
|
|||
<activity
|
||||
android:name=".activity.setup.AccountSettingsXL"
|
||||
android:label="@string/account_settings_action"
|
||||
android:theme="@android:style/Theme.WithActionBar" >
|
||||
>
|
||||
</activity>
|
||||
<activity
|
||||
|
@ -157,12 +159,13 @@
|
|||
|
||||
<activity
|
||||
android:name=".activity.Debug"
|
||||
android:label="@string/debug_title">
|
||||
android:label="@string/debug_title"
|
||||
>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activity.AccountFolderList"
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@android:style/Theme.WithActionBar" >
|
||||
>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
|
@ -178,16 +181,16 @@
|
|||
|
||||
<activity
|
||||
android:name=".activity.MailboxList"
|
||||
android:theme="@android:style/Theme.WithActionBar" >
|
||||
>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".activity.MessageList"
|
||||
android:theme="@style/ThemeNoTitleBar">
|
||||
android:theme="@style/ThemeNoTitleBar"
|
||||
>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activity.MessageListXL"
|
||||
android:theme="@android:style/Theme.WithActionBar"
|
||||
>
|
||||
</activity>
|
||||
|
||||
|
@ -210,11 +213,11 @@
|
|||
|
||||
<activity
|
||||
android:name=".activity.MessageView"
|
||||
android:theme="@android:style/Theme.NoTitleBar" >
|
||||
>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activity.MessageFileView"
|
||||
android:theme="@android:style/Theme.NoTitleBar" >
|
||||
>
|
||||
<intent-filter android:label="@string/app_name">
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<data android:mimeType="application/eml" />
|
||||
|
|
|
@ -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.
|
||||
|
@ -30,7 +30,7 @@
|
|||
android:id="@+id/to" android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="?android:attr/textColorSecondaryInverse"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:layout_marginLeft="6dip"
|
||||
android:layout_marginRight="6dip"
|
||||
android:inputType="textEmailAddress|textMultiLine"
|
||||
|
@ -40,7 +40,7 @@
|
|||
android:id="@+id/cc" android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="?android:attr/textColorSecondaryInverse"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:layout_marginLeft="6dip"
|
||||
android:layout_marginRight="6dip"
|
||||
android:inputType="textEmailAddress|textMultiLine"
|
||||
|
@ -51,7 +51,7 @@
|
|||
android:id="@+id/bcc" android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="?android:attr/textColorSecondaryInverse"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:layout_marginLeft="6dip"
|
||||
android:layout_marginRight="6dip"
|
||||
android:inputType="textEmailAddress|textMultiLine"
|
||||
|
@ -62,11 +62,12 @@
|
|||
android:layout_width="match_parent"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?android:attr/textColorSecondaryInverse"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:layout_marginLeft="6dip"
|
||||
android:layout_marginRight="6dip"
|
||||
android:hint="@string/message_compose_subject_hint"
|
||||
android:inputType="textEmailSubject|textAutoCorrect|textCapSentences|textImeMultiLine"
|
||||
android:inputType
|
||||
="textEmailSubject|textAutoCorrect|textCapSentences|textImeMultiLine"
|
||||
android:imeOptions="actionNext"
|
||||
/>
|
||||
<!--
|
||||
|
@ -82,7 +83,7 @@
|
|||
android:background="@drawable/divider_horizontal_email" />
|
||||
</LinearLayout>
|
||||
<EditText android:id="@+id/message_content"
|
||||
android:textColor="?android:attr/textColorSecondaryInverse"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1.0"
|
||||
|
@ -116,7 +117,7 @@
|
|||
android:layout_width="match_parent" />
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -124,7 +125,7 @@
|
|||
android:paddingTop="5dip"
|
||||
android:paddingLeft="4dip"
|
||||
android:paddingRight="4dip"
|
||||
android:paddingBottom="1dip"
|
||||
android:paddingBottom="1dip"
|
||||
android:background="@android:drawable/bottom_bar" >
|
||||
<Button
|
||||
android:id="@+id/send"
|
||||
|
|
|
@ -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.
|
||||
|
@ -21,7 +21,7 @@
|
|||
android:layout_centerVertical="true"
|
||||
android:layout_gravity="center_vertical">
|
||||
<TextView android:id="@+id/text1"
|
||||
android:textColor="?android:attr/textColorPrimaryInverse"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -33,7 +33,7 @@
|
|||
android:ellipsize="end"
|
||||
/>
|
||||
<TextView android:id="@+id/text2"
|
||||
android:textColor="?android:attr/textColorSecondaryInverse"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
@ -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.
|
||||
|
@ -15,34 +15,18 @@
|
|||
-->
|
||||
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:id="@+id/add_cc_bcc"
|
||||
<item
|
||||
android:id="@+id/add_cc_bcc"
|
||||
android:alphabeticShortcut="c"
|
||||
android:title="@string/add_cc_bcc_action"
|
||||
android:icon="@drawable/ic_menu_cc"
|
||||
/>
|
||||
<item
|
||||
android:id="@+id/send"
|
||||
android:alphabeticShortcut="s"
|
||||
android:title="@string/send_action"
|
||||
android:icon="@android:drawable/ic_menu_send"
|
||||
/>
|
||||
<item
|
||||
android:id="@+id/save"
|
||||
android:alphabeticShortcut="d"
|
||||
android:title="@string/save_draft_action"
|
||||
android:icon="@drawable/ic_menu_save_draft"
|
||||
/>
|
||||
<item
|
||||
android:id="@+id/discard"
|
||||
android:alphabeticShortcut="q"
|
||||
android:title="@string/discard_action"
|
||||
android:icon="@android:drawable/ic_menu_close_clear_cancel"
|
||||
/>
|
||||
<item
|
||||
android:id="@+id/add_attachment"
|
||||
android:title="@string/add_cc_bcc_action"
|
||||
android:icon="@drawable/ic_menu_cc"
|
||||
android:showAsAction="always"
|
||||
/>
|
||||
<item
|
||||
android:id="@+id/add_attachment"
|
||||
android:alphabeticShortcut="n"
|
||||
android:title="@string/add_attachment_action"
|
||||
android:icon="@drawable/ic_menu_attachment"
|
||||
/>
|
||||
android:title="@string/add_attachment_action"
|
||||
android:icon="@drawable/ic_menu_attachment"
|
||||
android:showAsAction="always"
|
||||
/>
|
||||
</menu>
|
||||
|
|
|
@ -31,12 +31,6 @@
|
|||
android:title="@string/account_settings_action"
|
||||
android:icon="@android:drawable/ic_menu_preferences"
|
||||
/>
|
||||
<!-- STOPSHIP: Dev version only. Remove this. -->
|
||||
<item android:id="@+id/add_new_account"
|
||||
android:title="@string/add_account_action"
|
||||
android:icon="@android:drawable/ic_menu_add"
|
||||
/>
|
||||
<!-- STOPSHIP: Dev version only. Remove this. -->
|
||||
<item android:id="@+id/change_orientation"
|
||||
android:title="@string/menu_change_orientation"
|
||||
/>
|
||||
|
|
|
@ -16,14 +16,11 @@
|
|||
|
||||
package com.android.email.activity;
|
||||
|
||||
import android.widget.AutoCompleteTextView.Validator;
|
||||
import android.widget.MultiAutoCompleteTextView;
|
||||
import android.view.KeyEvent;
|
||||
import com.android.email.R;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.Rect;
|
||||
import com.android.email.R;
|
||||
import android.widget.MultiAutoCompleteTextView;
|
||||
|
||||
/**
|
||||
* This is a MultiAutoCompleteTextView which sets the error state
|
||||
|
|
|
@ -34,6 +34,7 @@ import com.android.email.provider.EmailContent.Message;
|
|||
import com.android.email.provider.EmailContent.MessageColumns;
|
||||
import com.android.exchange.provider.GalEmailAddressAdapter;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.app.Activity;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.ContentResolver;
|
||||
|
@ -58,7 +59,6 @@ import android.util.Log;
|
|||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.View.OnFocusChangeListener;
|
||||
import android.webkit.WebView;
|
||||
|
@ -76,6 +76,14 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* Activity to compose a message.
|
||||
*
|
||||
* TODO Revive shortcuts command for removed menu options.
|
||||
* S: send
|
||||
* D: save draft
|
||||
* Q: discard
|
||||
*/
|
||||
public class MessageCompose extends Activity implements OnClickListener, OnFocusChangeListener {
|
||||
private static final String ACTION_REPLY = "com.android.email.intent.action.REPLY";
|
||||
private static final String ACTION_REPLY_ALL = "com.android.email.intent.action.REPLY_ALL";
|
||||
|
@ -128,6 +136,7 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
|
|||
*/
|
||||
private boolean mSourceMessageProcessed = false;
|
||||
|
||||
private ActionBar mActionBar;
|
||||
private MultiAutoCompleteTextView mToView;
|
||||
private MultiAutoCompleteTextView mCcView;
|
||||
private MultiAutoCompleteTextView mBccView;
|
||||
|
@ -140,8 +149,6 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
|
|||
private View mQuotedTextBar;
|
||||
private ImageButton mQuotedTextDelete;
|
||||
private WebView mQuotedText;
|
||||
private TextView mLeftTitle;
|
||||
private TextView mRightTitle;
|
||||
|
||||
private Controller mController;
|
||||
private boolean mDraftNeedsSaving;
|
||||
|
@ -252,7 +259,7 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
|
|||
private void setAccount(Account account) {
|
||||
mAccount = account;
|
||||
if (account != null) {
|
||||
mRightTitle.setText(account.mDisplayName);
|
||||
mActionBar.setSubtitle(account.mDisplayName);
|
||||
mAddressAdapterTo.setAccount(account);
|
||||
mAddressAdapterCc.setAccount(account);
|
||||
mAddressAdapterBcc.setAccount(account);
|
||||
|
@ -262,9 +269,7 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
|
|||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
|
||||
setContentView(R.layout.message_compose);
|
||||
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.list_title);
|
||||
|
||||
mController = Controller.getInstance(getApplication());
|
||||
initViews();
|
||||
|
@ -325,7 +330,6 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
|
|||
*/
|
||||
// TODO: signal the controller to load the message
|
||||
}
|
||||
updateTitle();
|
||||
}
|
||||
|
||||
// needed for unit tests
|
||||
|
@ -420,6 +424,7 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
|
|||
}
|
||||
|
||||
private void initViews() {
|
||||
mActionBar = getActionBar();
|
||||
mToView = (MultiAutoCompleteTextView)findViewById(R.id.to);
|
||||
mCcView = (MultiAutoCompleteTextView)findViewById(R.id.cc);
|
||||
mBccView = (MultiAutoCompleteTextView)findViewById(R.id.bcc);
|
||||
|
@ -432,8 +437,6 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
|
|||
mQuotedTextBar = findViewById(R.id.quoted_text_bar);
|
||||
mQuotedTextDelete = (ImageButton)findViewById(R.id.quoted_text_delete);
|
||||
mQuotedText = (WebView)findViewById(R.id.quoted_text);
|
||||
mLeftTitle = (TextView)findViewById(R.id.title_left_text);
|
||||
mRightTitle = (TextView)findViewById(R.id.title_right_text);
|
||||
|
||||
TextWatcher watcher = new TextWatcher() {
|
||||
public void beforeTextChanged(CharSequence s, int start,
|
||||
|
@ -672,18 +675,8 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
|
|||
}
|
||||
}
|
||||
|
||||
private void updateTitle() {
|
||||
if (mSubjectView.getText().length() == 0) {
|
||||
mLeftTitle.setText(R.string.compose_title);
|
||||
} else {
|
||||
mLeftTitle.setText(mSubjectView.getText().toString());
|
||||
}
|
||||
}
|
||||
|
||||
public void onFocusChange(View view, boolean focused) {
|
||||
if (!focused) {
|
||||
updateTitle();
|
||||
} else {
|
||||
if (focused) {
|
||||
switch (view.getId()) {
|
||||
case R.id.message_content:
|
||||
setMessageContentSelection((mAccount != null) ? mAccount.mSignature : null);
|
||||
|
|
Loading…
Reference in New Issue