email: Add an ActionBar to the mail app's PreferenceActivity

Change-Id: Id2ed98d2c2cd6648e179fb2942f3bc4479049cd0
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
This commit is contained in:
Jorge Ruesga 2015-10-17 01:18:20 +02:00 committed by Steve Kondik
parent 296d358d37
commit e3c39f0e6d

View File

@ -67,6 +67,7 @@ import com.android.mail.preferences.notifications.FolderNotificationLightPrefere
import com.android.mail.providers.Folder;
import com.android.mail.providers.UIProvider;
import com.android.mail.ui.MailAsyncTaskLoader;
import com.android.mail.ui.settings.BasePreferenceActivity;
import com.android.mail.utils.LogUtils;
import com.google.common.base.Preconditions;
@ -89,7 +90,7 @@ import java.util.Map;
* sync window may result in removal of messages. Instead, we only save to the database in {@link
* #onDestroy()}, unless it's called for configuration changes.
*/
public class MailboxSettings extends PreferenceActivity {
public class MailboxSettings extends BasePreferenceActivity {
public static final String PREFERENCE_SYNC_SETTINGS = "account_sync_settings";
public static final String PREFERENCE_PER_FOLDER_NOTIFICATIONS =
"account_per_folder_notifications";
@ -134,10 +135,6 @@ public class MailboxSettings extends PreferenceActivity {
// 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);
// Hide the app icon.
actionBar.setIcon(android.R.color.transparent);
actionBar.setDisplayUseLogoEnabled(false);
if (mType != null && mType.equals(PREFERENCE_SYNC_SETTINGS)) {
actionBar.setTitle(getString(R.string.mailbox_settings_activity_title));
} else if (mType != null && mType.equals(PREFERENCE_PER_FOLDER_NOTIFICATIONS)) {