Update sync settings UI to specs
- minor text changes - use light holo theme - slight order changes Bug: 5110452 Change-Id: Icf558ee495860dc97048765d3b8d09d31161dd32
This commit is contained in:
parent
876537bb25
commit
6be8cceadd
|
@ -275,7 +275,6 @@
|
|||
<activity
|
||||
android:name=".activity.setup.MailboxSettings"
|
||||
android:label="@string/mailbox_settings_activity_title"
|
||||
android:theme="@android:style/Theme.Holo.DialogWhenLarge"
|
||||
>
|
||||
</activity>
|
||||
|
||||
|
|
|
@ -51,16 +51,16 @@
|
|||
android:id="@+id/older"
|
||||
android:visible="false"
|
||||
/>
|
||||
<item
|
||||
android:id="@+id/account_settings"
|
||||
android:orderInCategory="2000"
|
||||
android:title="@string/account_settings_action"
|
||||
android:icon="@android:drawable/ic_menu_preferences"
|
||||
/>
|
||||
<item
|
||||
android:id="@+id/mailbox_settings"
|
||||
android:orderInCategory="3000"
|
||||
android:orderInCategory="2000"
|
||||
android:title="@string/mailbox_settings_action"
|
||||
android:icon="@android:drawable/ic_menu_preferences"
|
||||
/>
|
||||
<item
|
||||
android:id="@+id/account_settings"
|
||||
android:orderInCategory="3000"
|
||||
android:title="@string/settings_action"
|
||||
android:icon="@android:drawable/ic_menu_preferences"
|
||||
/>
|
||||
</menu>
|
||||
|
|
|
@ -64,16 +64,16 @@
|
|||
android:showAsAction="always"
|
||||
android:visible="false"
|
||||
/>
|
||||
<item
|
||||
android:id="@+id/account_settings"
|
||||
android:orderInCategory="2000"
|
||||
android:title="@string/settings_action"
|
||||
android:icon="@android:drawable/ic_menu_preferences"
|
||||
/>
|
||||
<item
|
||||
android:id="@+id/mailbox_settings"
|
||||
android:orderInCategory="3000"
|
||||
android:orderInCategory="2000"
|
||||
android:title="@string/mailbox_settings_action"
|
||||
android:icon="@android:drawable/ic_menu_preferences"
|
||||
/>
|
||||
<item
|
||||
android:id="@+id/account_settings"
|
||||
android:orderInCategory="3000"
|
||||
android:title="@string/settings_action"
|
||||
android:icon="@android:drawable/ic_menu_preferences"
|
||||
/>
|
||||
</menu>
|
||||
|
|
|
@ -136,7 +136,7 @@
|
|||
<!-- Menu item for settings [CHAR LIMIT=40]-->
|
||||
<string name="settings_action">Settings</string>
|
||||
<!-- Menu item [CHAR LIMIT=32] -->
|
||||
<string name="mailbox_settings_action">Folder settings</string>
|
||||
<string name="mailbox_settings_action">Sync options</string>
|
||||
<!-- Menu item -->
|
||||
<string name="mark_as_unread_action">Mark as unread</string>
|
||||
<!-- Menu item for moving messages to folders [CHAR LIMIT=10] -->
|
||||
|
@ -777,7 +777,7 @@ save attachment.</string>
|
|||
<!-- Dialog title when "setup" could not finish -->
|
||||
<string name="account_setup_failed_dlg_title">Setup could not finish</string>
|
||||
<!-- In Account setup options screen, label for email lookback selector -->
|
||||
<string name="account_setup_options_mail_window_label">Amount to synchronize</string>
|
||||
<string name="account_setup_options_mail_window_label">Days to sync</string>
|
||||
<!-- In account setup options & account settings screens (exchange), sync window length; this
|
||||
implies loading a 'reasonable' number of messages [CHAR LIMIT=25] -->
|
||||
<string name="account_setup_options_mail_window_auto">Automatic</string>
|
||||
|
@ -1035,15 +1035,15 @@ save attachment.</string>
|
|||
<string name="account_settings_delete_account_label">Remove account</string>
|
||||
|
||||
<!-- Mailbox settings activity title [CHAR LIMIT=none] -->
|
||||
<string name="mailbox_settings_activity_title">Folder settings</string>
|
||||
<string name="mailbox_settings_activity_title">Sync options</string>
|
||||
<!-- Mailbox settings activity title, with the target folder name [CHAR LIMIT=none] -->
|
||||
<string name="mailbox_settings_activity_title_with_mailbox">Folder settings (<xliff:g id="mailboxx_name" example="Family">%s</xliff:g>)</string>
|
||||
<string name="mailbox_settings_activity_title_with_mailbox">Sync options (<xliff:g id="mailboxx_name" example="Family">%s</xliff:g>)</string>
|
||||
<!-- Mailbox "sync settings" preference header [CHAR LIMIT=none] -->
|
||||
<string name="mailbox_preferences_header">Sync settings</string>
|
||||
<!-- On mailbox settings screen: Mailbox check frequency setting label [CHAR LIMIT=none] -->
|
||||
<string name="mailbox_settings_mailbox_check_frequency_label">Check frequency</string>
|
||||
<!-- On mailbox settings screen: Mailbox sync window (the number of days to synchronize email for) setting label [CHAR LIMIT=none] -->
|
||||
<string name="mailbox_settings_mailbox_sync_window_label">Amount to synchronize</string>
|
||||
<string name="mailbox_settings_mailbox_sync_window_label">Days to sync</string>
|
||||
|
||||
<!-- Strings used for account shortcut picker -->
|
||||
<!-- String displayed in launcher [CHAR_LIMIT=10] -->
|
||||
|
|
|
@ -61,29 +61,32 @@
|
|||
|
||||
<!-- Reserve order#2 here for window size (if inserted) -->
|
||||
|
||||
<!-- (will hide on POP3 accounts) -->
|
||||
<CheckBoxPreference
|
||||
android:key="account_background_attachments"
|
||||
android:order="3"
|
||||
android:title="@string/account_settings_background_attachments_label"
|
||||
android:summary="@string/account_settings_background_attachments_summary" />
|
||||
|
||||
|
||||
<CheckBoxPreference
|
||||
android:key="account_sync_email"
|
||||
android:order="3"
|
||||
android:defaultValue="true"
|
||||
android:title="@string/account_settings_sync_email_enable"
|
||||
android:summary="@string/account_settings_sync_email_summary" />
|
||||
<CheckBoxPreference
|
||||
android:key="account_sync_contacts"
|
||||
android:order="4"
|
||||
android:defaultValue="true"
|
||||
android:title="@string/account_settings_sync_contacts_enable"
|
||||
android:summary="@string/account_settings_sync_contacts_summary" />
|
||||
<CheckBoxPreference
|
||||
android:key="account_sync_calendar"
|
||||
android:order="5"
|
||||
android:defaultValue="true"
|
||||
android:title="@string/account_settings_sync_calendar_enable"
|
||||
android:summary="@string/account_settings_sync_calendar_summary" />
|
||||
|
||||
<!-- (will hide on POP3 accounts) -->
|
||||
<CheckBoxPreference
|
||||
android:key="account_background_attachments"
|
||||
android:order="6"
|
||||
android:title="@string/account_settings_background_attachments_label"
|
||||
android:summary="@string/account_settings_background_attachments_summary" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
|
|
|
@ -16,28 +16,24 @@
|
|||
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/mailbox_preferences_header">
|
||||
<!-- summary is set at runtime -->
|
||||
<ListPreference
|
||||
android:key="check_frequency"
|
||||
android:title="@string/mailbox_settings_mailbox_check_frequency_label"
|
||||
android:dialogTitle="@string/mailbox_settings_mailbox_check_frequency_label"
|
||||
android:entries="@array/account_settings_check_frequency_entries_push"
|
||||
android:entryValues="@array/account_settings_check_frequency_values_push"
|
||||
android:persistent="false"
|
||||
/>
|
||||
|
||||
<!-- summary is set at runtime -->
|
||||
<ListPreference
|
||||
android:key="check_frequency"
|
||||
android:title="@string/mailbox_settings_mailbox_check_frequency_label"
|
||||
android:dialogTitle="@string/mailbox_settings_mailbox_check_frequency_label"
|
||||
android:entries="@array/account_settings_check_frequency_entries_push"
|
||||
android:entryValues="@array/account_settings_check_frequency_values_push"
|
||||
android:persistent="false"
|
||||
/>
|
||||
<!-- summary is set at runtime -->
|
||||
<ListPreference
|
||||
android:key="sync_window"
|
||||
android:title="@string/mailbox_settings_mailbox_sync_window_label"
|
||||
android:dialogTitle="@string/mailbox_settings_mailbox_sync_window_label"
|
||||
android:entries="@array/account_settings_mail_window_entries_with_default"
|
||||
android:entryValues="@array/account_settings_mail_window_values_with_default"
|
||||
android:persistent="false"
|
||||
/>
|
||||
|
||||
<!-- summary is set at runtime -->
|
||||
<ListPreference
|
||||
android:key="sync_window"
|
||||
android:title="@string/mailbox_settings_mailbox_sync_window_label"
|
||||
android:dialogTitle="@string/mailbox_settings_mailbox_sync_window_label"
|
||||
android:entries="@array/account_settings_mail_window_entries_with_default"
|
||||
android:entryValues="@array/account_settings_mail_window_values_with_default"
|
||||
android:persistent="false"
|
||||
/>
|
||||
|
||||
</PreferenceCategory>
|
||||
</PreferenceScreen>
|
||||
|
|
|
@ -16,19 +16,7 @@
|
|||
|
||||
package com.android.email.activity.setup;
|
||||
|
||||
import com.android.email.Email;
|
||||
import com.android.email.FolderProperties;
|
||||
import com.android.email.R;
|
||||
import com.android.email.RefreshManager;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.AccountColumns;
|
||||
import com.android.emailcommon.provider.EmailContent.MailboxColumns;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
import com.android.emailcommon.utility.EmailAsyncTask;
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.app.Activity;
|
||||
import android.content.ContentUris;
|
||||
import android.content.ContentValues;
|
||||
|
@ -41,6 +29,20 @@ import android.preference.Preference;
|
|||
import android.preference.Preference.OnPreferenceChangeListener;
|
||||
import android.preference.PreferenceActivity;
|
||||
import android.util.Log;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import com.android.email.Email;
|
||||
import com.android.email.FolderProperties;
|
||||
import com.android.email.R;
|
||||
import com.android.email.RefreshManager;
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.provider.Account;
|
||||
import com.android.emailcommon.provider.EmailContent.AccountColumns;
|
||||
import com.android.emailcommon.provider.EmailContent.MailboxColumns;
|
||||
import com.android.emailcommon.provider.Mailbox;
|
||||
import com.android.emailcommon.utility.EmailAsyncTask;
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
/**
|
||||
* "Mailbox settings" activity.
|
||||
|
@ -111,6 +113,12 @@ public class MailboxSettings extends PreferenceActivity {
|
|||
} else {
|
||||
onDataLoaded();
|
||||
}
|
||||
|
||||
// Always show "app up" as we expect our parent to be an Email activity.
|
||||
ActionBar actionBar = getActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayOptions(ActionBar.DISPLAY_HOME_AS_UP, ActionBar.DISPLAY_HOME_AS_UP);
|
||||
}
|
||||
}
|
||||
|
||||
private void enablePreferences(boolean enabled) {
|
||||
|
@ -178,8 +186,15 @@ public class MailboxSettings extends PreferenceActivity {
|
|||
Preconditions.checkNotNull(mMailbox);
|
||||
|
||||
// Update the title with the mailbox name.
|
||||
setTitle(getString(R.string.mailbox_settings_activity_title_with_mailbox,
|
||||
FolderProperties.getInstance(this).getDisplayName(mMailbox)));
|
||||
ActionBar actionBar = getActionBar();
|
||||
String mailboxName = FolderProperties.getInstance(this).getDisplayName(mMailbox);
|
||||
if (actionBar != null) {
|
||||
actionBar.setTitle(mailboxName);
|
||||
actionBar.setSubtitle(getString(R.string.mailbox_settings_activity_title));
|
||||
} else {
|
||||
setTitle(getString(R.string.mailbox_settings_activity_title_with_mailbox, mailboxName));
|
||||
}
|
||||
|
||||
|
||||
// Special case: If setting inbox, don't show "Use account's default".
|
||||
if (mMailbox.mType == Mailbox.TYPE_INBOX) {
|
||||
|
@ -195,6 +210,7 @@ public class MailboxSettings extends PreferenceActivity {
|
|||
|
||||
// Make then enabled
|
||||
enablePreferences(true);
|
||||
|
||||
}
|
||||
|
||||
private void updatePreferenceSummary() {
|
||||
|
@ -287,7 +303,7 @@ public class MailboxSettings extends PreferenceActivity {
|
|||
// activity...)
|
||||
final Account account = mAccount;
|
||||
final Mailbox mailbox = mMailbox;
|
||||
final Context context = this.getApplicationContext();
|
||||
final Context context = getApplicationContext();
|
||||
|
||||
new EmailAsyncTask<Void, Void, Void> (null /* no cancel */) {
|
||||
@Override
|
||||
|
@ -318,4 +334,13 @@ public class MailboxSettings extends PreferenceActivity {
|
|||
}
|
||||
}.executeSerial((Void [])null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if (item.getItemId() == android.R.id.home) {
|
||||
onBackPressed();
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue