1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-23 16:18:50 -05:00

Added a "Signature" preference.

* Broke out mail composition preferences to their own page
This commit is contained in:
Jesse Vincent 2008-10-30 03:24:48 +00:00
parent cbfeadfd01
commit 2a8b7a00e3
9 changed files with 311 additions and 145 deletions

View File

@ -41,6 +41,11 @@
android:label="@string/account_setup_incoming_title"
>
</activity>
<activity
android:name=".activity.setup.AccountSetupComposition"
android:label="@string/account_settings_composition_title"
>
</activity>
<activity
android:name=".activity.setup.AccountSetupOutgoing"
android:label="@string/account_setup_outgoing_title"

View File

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbarStyle="outsideInset">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<TextView
android:text="@string/account_settings_email_label"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorPrimary" />
<EditText
android:id="@+id/account_email"
android:singleLine="true"
android:layout_height="wrap_content"
android:layout_width="fill_parent" />
<TextView
android:text="@string/account_settings_always_bcc_label"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorPrimary" />
<EditText
android:id="@+id/account_always_bcc"
android:singleLine="true"
android:layout_height="wrap_content"
android:layout_width="fill_parent" />
<TextView
android:text="@string/account_settings_signature_label"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorPrimary" />
<EditText
android:id="@+id/account_signature"
android:singleLine="false"
android:layout_height="wrap_content"
android:layout_width="fill_parent" />
</LinearLayout>
</ScrollView>

View File

@ -220,9 +220,18 @@
<string name="account_settings_vibrate_summary">Also vibrate when email arrives</string>
<string name="account_settings_ringtone">Select ringtone</string>
<string name="account_settings_servers">Server settings</string>
<string name="account_settings_composition_title">Message composition options</string>
<string name="account_settings_composition_label">Message composition</string>
<string name="account_settings_always_bcc_label">Always Bcc address</string>
<string name="account_settings_always_bcc_summary">Send this address a copy of every outgoing message</string>
<string name="account_settings_signature_label">Signature</string>
<string name="account_settings_signature_summary">Append a signature to every message you send</string>
<string name="account_delete_dlg_title">Remove</string>
<string name="account_delete_dlg_instructions_fmt">The account \"<xliff:g id="account">%s</xliff:g>\" will be removed from Email.</string>

View File

@ -31,12 +31,6 @@
android:summary=""
android:dialogTitle="@string/account_settings_name_label" />
<EditTextPreference
android:key="account_email"
android:title="@string/account_settings_email_label"
android:summary=""
android:dialogTitle="@string/account_settings_email_label" />
<ListPreference
android:key="account_check_frequency"
android:title="@string/account_settings_mail_check_frequency_label"
@ -49,12 +43,9 @@
android:title="@string/account_settings_default_label"
android:summary="@string/account_settings_default_summary" />
<EditTextPreference
android:key="account_always_bcc"
android:title="@string/account_settings_always_bcc_label"
android:summary="@string/account_settings_always_bcc_summary"
android:dialogTitle="@string/account_settings_always_bcc_label" />
<PreferenceScreen
android:key="composition"
android:title="@string/account_settings_composition_label" />
</PreferenceCategory>

View File

@ -27,6 +27,7 @@ public class Account implements Serializable {
String mDescription;
String mName;
String mEmail;
String mSignature;
String mAlwaysBcc;
int mAutomaticCheckIntervalMinutes;
long mLastAutomaticCheckTime;
@ -55,6 +56,7 @@ public class Account implements Serializable {
mAutomaticCheckIntervalMinutes = -1;
mAccountNumber = -1;
mNotifyNewMail = true;
mSignature = "Sent from my Android phone with K-9. Please excuse my brevity.";
mVibrate = false;
mRingtoneUri = "content://settings/system/notification_sound";
}
@ -77,6 +79,7 @@ public class Account implements Serializable {
mAlwaysBcc = preferences.mSharedPreferences.getString(mUuid + ".alwaysBcc", mAlwaysBcc);
mName = preferences.mSharedPreferences.getString(mUuid + ".name", mName);
mEmail = preferences.mSharedPreferences.getString(mUuid + ".email", mEmail);
mSignature = preferences.mSharedPreferences.getString(mUuid + ".signature", mSignature);
mAutomaticCheckIntervalMinutes = preferences.mSharedPreferences.getInt(mUuid
+ ".automaticCheckIntervalMinutes", -1);
mLastAutomaticCheckTime = preferences.mSharedPreferences.getLong(mUuid
@ -134,6 +137,14 @@ public class Account implements Serializable {
this.mName = name;
}
public String getSignature() {
return mSignature;
}
public void setSignature(String signature) {
this.mSignature = signature;
}
public String getEmail() {
return mEmail;
}
@ -245,6 +256,7 @@ public class Account implements Serializable {
editor.putString(mUuid + ".description", mDescription);
editor.putString(mUuid + ".name", mName);
editor.putString(mUuid + ".email", mEmail);
editor.putString(mUuid + ".signature", mSignature);
editor.putString(mUuid + ".alwaysBcc", mAlwaysBcc);
editor.putInt(mUuid + ".automaticCheckIntervalMinutes", mAutomaticCheckIntervalMinutes);
editor.putLong(mUuid + ".lastAutomaticCheckTime", mLastAutomaticCheckTime);

View File

@ -91,110 +91,113 @@ public final class R {
public static final int text_box_light=0x7f020043;
}
public static final class id {
public static final int account_check_frequency=0x7f0a0016;
public static final int account_always_bcc=0x7f0a000a;
public static final int account_check_frequency=0x7f0a0018;
public static final int account_default=0x7f0a0005;
public static final int account_delete_policy=0x7f0a0010;
public static final int account_delete_policy_label=0x7f0a000f;
public static final int account_description=0x7f0a0013;
public static final int account_delete_policy=0x7f0a0012;
public static final int account_delete_policy_label=0x7f0a0011;
public static final int account_description=0x7f0a0015;
public static final int account_email=0x7f0a0002;
public static final int account_name=0x7f0a0014;
public static final int account_notify=0x7f0a0017;
public static final int account_name=0x7f0a0016;
public static final int account_notify=0x7f0a0019;
public static final int account_password=0x7f0a0003;
public static final int account_port=0x7f0a000d;
public static final int account_require_login=0x7f0a0018;
public static final int account_require_login_settings=0x7f0a0019;
public static final int account_security_type=0x7f0a000e;
public static final int account_server=0x7f0a000c;
public static final int account_server_label=0x7f0a000b;
public static final int account_settings=0x7f0a004f;
public static final int account_username=0x7f0a000a;
public static final int accounts=0x7f0a004e;
public static final int add_attachment=0x7f0a0051;
public static final int add_cc_bcc=0x7f0a0050;
public static final int add_new_account=0x7f0a001b;
public static final int attachment=0x7f0a003e;
public static final int attachment_delete=0x7f0a0034;
public static final int attachment_icon=0x7f0a003a;
public static final int attachment_info=0x7f0a003b;
public static final int attachment_name=0x7f0a0035;
public static final int attachments=0x7f0a002c;
public static final int bcc=0x7f0a002b;
public static final int account_port=0x7f0a000f;
public static final int account_require_login=0x7f0a001a;
public static final int account_require_login_settings=0x7f0a001b;
public static final int account_security_type=0x7f0a0010;
public static final int account_server=0x7f0a000e;
public static final int account_server_label=0x7f0a000d;
public static final int account_settings=0x7f0a0051;
public static final int account_signature=0x7f0a000b;
public static final int account_username=0x7f0a000c;
public static final int accounts=0x7f0a0050;
public static final int add_attachment=0x7f0a0053;
public static final int add_cc_bcc=0x7f0a0052;
public static final int add_new_account=0x7f0a001d;
public static final int attachment=0x7f0a0040;
public static final int attachment_delete=0x7f0a0036;
public static final int attachment_icon=0x7f0a003c;
public static final int attachment_info=0x7f0a003d;
public static final int attachment_name=0x7f0a0037;
public static final int attachments=0x7f0a002e;
public static final int bcc=0x7f0a002d;
public static final int cancel=0x7f0a0009;
public static final int cc=0x7f0a002a;
public static final int check_mail=0x7f0a0048;
public static final int chip=0x7f0a0022;
public static final int compose=0x7f0a0049;
public static final int date=0x7f0a0024;
public static final int debug_logging=0x7f0a0020;
public static final int delete=0x7f0a0039;
public static final int delete_account=0x7f0a0047;
public static final int description=0x7f0a001c;
public static final int discard=0x7f0a0033;
public static final int done=0x7f0a0015;
public static final int download=0x7f0a003c;
public static final int dump_settings=0x7f0a004a;
public static final int edit_account=0x7f0a0046;
public static final int email=0x7f0a001d;
public static final int empty=0x7f0a001a;
public static final int folder_name=0x7f0a0027;
public static final int folder_status=0x7f0a0028;
public static final int forward=0x7f0a004b;
public static final int from=0x7f0a0023;
public static final int cc=0x7f0a002c;
public static final int check_mail=0x7f0a004a;
public static final int chip=0x7f0a0024;
public static final int compose=0x7f0a004b;
public static final int date=0x7f0a0026;
public static final int debug_logging=0x7f0a0022;
public static final int delete=0x7f0a003b;
public static final int delete_account=0x7f0a0049;
public static final int description=0x7f0a001e;
public static final int discard=0x7f0a0035;
public static final int done=0x7f0a0017;
public static final int download=0x7f0a003e;
public static final int dump_settings=0x7f0a004c;
public static final int edit_account=0x7f0a0048;
public static final int email=0x7f0a001f;
public static final int empty=0x7f0a001c;
public static final int folder_name=0x7f0a0029;
public static final int folder_status=0x7f0a002a;
public static final int forward=0x7f0a004d;
public static final int from=0x7f0a0025;
public static final int imap=0x7f0a0001;
public static final int imap_path_prefix=0x7f0a0012;
public static final int imap_path_prefix_section=0x7f0a0011;
public static final int main_text=0x7f0a0026;
public static final int imap_path_prefix=0x7f0a0014;
public static final int imap_path_prefix_section=0x7f0a0013;
public static final int main_text=0x7f0a0028;
public static final int manual_setup=0x7f0a0006;
public static final int mark_as_read=0x7f0a004c;
public static final int mark_as_unread=0x7f0a0052;
public static final int mark_as_read=0x7f0a004e;
public static final int mark_as_unread=0x7f0a0054;
public static final int message=0x7f0a0007;
public static final int message_content=0x7f0a002d;
public static final int new_message_count=0x7f0a001e;
public static final int message_content=0x7f0a002f;
public static final int new_message_count=0x7f0a0020;
public static final int next=0x7f0a0004;
public static final int open=0x7f0a0045;
public static final int open=0x7f0a0047;
public static final int pop=0x7f0a0000;
public static final int previous=0x7f0a0036;
public static final int previous=0x7f0a0038;
public static final int progress=0x7f0a0008;
public static final int quoted_text=0x7f0a0030;
public static final int quoted_text_bar=0x7f0a002e;
public static final int quoted_text_delete=0x7f0a002f;
public static final int refresh=0x7f0a004d;
public static final int reply=0x7f0a0037;
public static final int reply_all=0x7f0a0038;
public static final int save=0x7f0a0032;
public static final int send=0x7f0a0031;
public static final int sensitive_logging=0x7f0a0021;
public static final int show_pictures=0x7f0a0042;
public static final int show_pictures_section=0x7f0a0041;
public static final int subject=0x7f0a0025;
public static final int text1=0x7f0a0043;
public static final int text2=0x7f0a0044;
public static final int to=0x7f0a0029;
public static final int to_container=0x7f0a003f;
public static final int to_label=0x7f0a0040;
public static final int version=0x7f0a001f;
public static final int view=0x7f0a003d;
public static final int quoted_text=0x7f0a0032;
public static final int quoted_text_bar=0x7f0a0030;
public static final int quoted_text_delete=0x7f0a0031;
public static final int refresh=0x7f0a004f;
public static final int reply=0x7f0a0039;
public static final int reply_all=0x7f0a003a;
public static final int save=0x7f0a0034;
public static final int send=0x7f0a0033;
public static final int sensitive_logging=0x7f0a0023;
public static final int show_pictures=0x7f0a0044;
public static final int show_pictures_section=0x7f0a0043;
public static final int subject=0x7f0a0027;
public static final int text1=0x7f0a0045;
public static final int text2=0x7f0a0046;
public static final int to=0x7f0a002b;
public static final int to_container=0x7f0a0041;
public static final int to_label=0x7f0a0042;
public static final int version=0x7f0a0021;
public static final int view=0x7f0a003f;
}
public static final class layout {
public static final int account_setup_account_type=0x7f030000;
public static final int account_setup_basics=0x7f030001;
public static final int account_setup_check_settings=0x7f030002;
public static final int account_setup_incoming=0x7f030003;
public static final int account_setup_names=0x7f030004;
public static final int account_setup_options=0x7f030005;
public static final int account_setup_outgoing=0x7f030006;
public static final int accounts=0x7f030007;
public static final int accounts_item=0x7f030008;
public static final int debug=0x7f030009;
public static final int folder_message_list_child=0x7f03000a;
public static final int folder_message_list_child_footer=0x7f03000b;
public static final int folder_message_list_group=0x7f03000c;
public static final int message_compose=0x7f03000d;
public static final int message_compose_attachment=0x7f03000e;
public static final int message_view=0x7f03000f;
public static final int message_view_attachment=0x7f030010;
public static final int message_view_header=0x7f030011;
public static final int recipient_dropdown_item=0x7f030012;
public static final int account_setup_composition=0x7f030003;
public static final int account_setup_incoming=0x7f030004;
public static final int account_setup_names=0x7f030005;
public static final int account_setup_options=0x7f030006;
public static final int account_setup_outgoing=0x7f030007;
public static final int accounts=0x7f030008;
public static final int accounts_item=0x7f030009;
public static final int debug=0x7f03000a;
public static final int folder_message_list_child=0x7f03000b;
public static final int folder_message_list_child_footer=0x7f03000c;
public static final int folder_message_list_group=0x7f03000d;
public static final int message_compose=0x7f03000e;
public static final int message_compose_attachment=0x7f03000f;
public static final int message_view=0x7f030010;
public static final int message_view_attachment=0x7f030011;
public static final int message_view_header=0x7f030012;
public static final int recipient_dropdown_item=0x7f030013;
}
public static final class menu {
public static final int accounts_context=0x7f090000;
@ -206,12 +209,14 @@ public final class R {
public static final int message_view_option=0x7f090006;
}
public static final class string {
public static final int account_delete_dlg_instructions_fmt=0x7f0600c2;
public static final int account_delete_dlg_title=0x7f0600c1;
public static final int account_delete_dlg_instructions_fmt=0x7f0600c6;
public static final int account_delete_dlg_title=0x7f0600c5;
public static final int account_settings_action=0x7f06001b;
public static final int account_settings_add_account_label=0x7f0600b7;
public static final int account_settings_always_bcc_label=0x7f0600bf;
public static final int account_settings_always_bcc_summary=0x7f0600c0;
public static final int account_settings_always_bcc_label=0x7f0600c1;
public static final int account_settings_always_bcc_summary=0x7f0600c2;
public static final int account_settings_composition_label=0x7f0600c0;
public static final int account_settings_composition_title=0x7f0600bf;
public static final int account_settings_default_label=0x7f0600ac;
public static final int account_settings_default_summary=0x7f0600ad;
public static final int account_settings_description_label=0x7f0600b8;
@ -228,6 +233,8 @@ public final class R {
public static final int account_settings_ringtone=0x7f0600bd;
public static final int account_settings_servers=0x7f0600be;
public static final int account_settings_show_combined_label=0x7f0600b1;
public static final int account_settings_signature_label=0x7f0600c3;
public static final int account_settings_signature_summary=0x7f0600c4;
public static final int account_settings_title_fmt=0x7f0600ab;
public static final int account_settings_vibrate_enable=0x7f0600bb;
public static final int account_settings_vibrate_summary=0x7f0600bc;
@ -399,8 +406,8 @@ public final class R {
public static final int okay_action=0x7f060008;
public static final int open_action=0x7f06001a;
public static final int preferences_action=0x7f060019;
public static final int provider_note_live=0x7f0600c4;
public static final int provider_note_yahoo=0x7f0600c3;
public static final int provider_note_live=0x7f0600c8;
public static final int provider_note_yahoo=0x7f0600c7;
public static final int read_action=0x7f06001e;
public static final int read_attachment_desc=0x7f060002;
public static final int read_attachment_label=0x7f060001;

View File

@ -551,6 +551,8 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
}
}
text += "\n-- \n" + mAccount.getSignature();
TextBody body = new TextBody(text);
if (mAttachments.getChildCount() > 0) {

View File

@ -24,8 +24,7 @@ public class AccountSettings extends PreferenceActivity {
private static final String PREFERENCE_TOP_CATERGORY = "account_settings";
private static final String PREFERENCE_DESCRIPTION = "account_description";
private static final String PREFERENCE_NAME = "account_name";
private static final String PREFERENCE_EMAIL = "account_email";
private static final String PREFERENCE_ALWAYS_BCC = "account_always_bcc";
private static final String PREFERENCE_COMPOSITION = "composition";
private static final String PREFERENCE_FREQUENCY = "account_check_frequency";
private static final String PREFERENCE_DEFAULT = "account_default";
private static final String PREFERENCE_NOTIFY = "account_notify";
@ -39,8 +38,6 @@ public class AccountSettings extends PreferenceActivity {
private EditTextPreference mAccountDescription;
private EditTextPreference mAccountName;
private EditTextPreference mAccountEmail;
private EditTextPreference mAccountAlwaysBcc;
private ListPreference mCheckFrequency;
private CheckBoxPreference mAccountDefault;
private CheckBoxPreference mAccountNotify;
@ -89,38 +86,6 @@ public class AccountSettings extends PreferenceActivity {
});
mAccountEmail = (EditTextPreference) findPreference(PREFERENCE_EMAIL);
mAccountEmail.setSummary(mAccount.getEmail());
mAccountEmail.setText(mAccount.getEmail());
mAccountEmail.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
public boolean onPreferenceChange(Preference preference, Object newValue) {
final String summary = newValue.toString();
mAccountEmail.setSummary(summary);
mAccountEmail.setText(summary);
return false;
}
});
mAccountAlwaysBcc = (EditTextPreference) findPreference(PREFERENCE_ALWAYS_BCC);
if (mAccount.getAlwaysBcc() != null && (mAccount.getAlwaysBcc().length() > 0 )) {
mAccountAlwaysBcc.setSummary(mAccount.getAlwaysBcc());
}
mAccountAlwaysBcc.setText(mAccount.getAlwaysBcc());
mAccountAlwaysBcc.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
public boolean onPreferenceChange(Preference preference, Object newValue) {
final String summary = newValue.toString();
mAccountAlwaysBcc.setSummary(summary);
mAccountAlwaysBcc.setText(summary);
return false;
}
});
mCheckFrequency = (ListPreference) findPreference(PREFERENCE_FREQUENCY);
mCheckFrequency.setValue(String.valueOf(mAccount.getAutomaticCheckIntervalMinutes()));
mCheckFrequency.setSummary(mCheckFrequency.getEntry());
@ -151,6 +116,15 @@ public class AccountSettings extends PreferenceActivity {
mAccountVibrate = (CheckBoxPreference) findPreference(PREFERENCE_VIBRATE);
mAccountVibrate.setChecked(mAccount.isVibrate());
findPreference(PREFERENCE_COMPOSITION).setOnPreferenceClickListener(
new Preference.OnPreferenceClickListener() {
public boolean onPreferenceClick(Preference preference) {
onCompositionSettings();
return true;
}
});
findPreference(PREFERENCE_INCOMING).setOnPreferenceClickListener(
new Preference.OnPreferenceClickListener() {
public boolean onPreferenceClick(Preference preference) {
@ -187,8 +161,6 @@ public class AccountSettings extends PreferenceActivity {
}
mAccount.setDescription(mAccountDescription.getText());
mAccount.setName(mAccountName.getText());
mAccount.setEmail(mAccountEmail.getText());
mAccount.setAlwaysBcc(mAccountAlwaysBcc.getText());
mAccount.setNotifyNewMail(mAccountNotify.isChecked());
mAccount.setAutomaticCheckIntervalMinutes(Integer.parseInt(mCheckFrequency.getValue()));
mAccount.setVibrate(mAccountVibrate.isChecked());
@ -206,6 +178,10 @@ public class AccountSettings extends PreferenceActivity {
return super.onKeyDown(keyCode, event);
}
private void onCompositionSettings() {
AccountSetupComposition.actionEditCompositionSettings(this, mAccount);
}
private void onIncomingSettings() {
AccountSetupIncoming.actionEditIncomingSettings(this, mAccount);
}

View File

@ -0,0 +1,119 @@
package com.fsck.k9.activity.setup;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.text.method.DigitsKeyListener;
import android.view.View;
import android.view.KeyEvent;
import android.widget.AdapterView;
import android.widget.EditText;
import android.widget.TextView;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.EditTextPreference;
import com.fsck.k9.Account;
import com.fsck.k9.Preferences;
import com.fsck.k9.R;
import com.fsck.k9.k9;
import com.fsck.k9.Utility;
public class AccountSetupComposition extends Activity {
private static final String EXTRA_ACCOUNT = "account";
// rivate static final String EXTRA_MAKE_DEFAULT = "makeDefault";
private static final String PREFERENCE_ALWAYS_BCC = "account_always_bcc";
private static final String PREFERENCE_EMAIL = "account_email";
private static final String PREFERENCE_SIGNATURE = "account_signature";
private Account mAccount;
private EditText mAccountSignature;
private EditText mAccountEmail;
private EditText mAccountAlwaysBcc;
public static void actionCompositionSettings(Activity context, Account account, boolean makeDefault) {
Intent i = new Intent(context, AccountSetupComposition.class);
i.putExtra(EXTRA_ACCOUNT, account);
//i.putExtra(EXTRA_MAKE_DEFAULT, makeDefault);
context.startActivity(i);
}
public static void actionEditCompositionSettings(Activity context, Account account) {
Intent i = new Intent(context, AccountSetupComposition.class);
i.setAction(Intent.ACTION_EDIT);
i.putExtra(EXTRA_ACCOUNT, account);
context.startActivity(i);
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mAccount = (Account)getIntent().getSerializableExtra(EXTRA_ACCOUNT);
// addPreferencesFromResource(R.xml.account_settings_preferences);
setContentView(R.layout.account_setup_composition);
/*
* If we're being reloaded we override the original account with the one
* we saved
*/
if (savedInstanceState != null && savedInstanceState.containsKey(EXTRA_ACCOUNT)) {
mAccount = (Account)savedInstanceState.getSerializable(EXTRA_ACCOUNT);
}
mAccountEmail = (EditText)findViewById(R.id.account_email);
mAccountEmail.setText(mAccount.getEmail());
mAccountAlwaysBcc = (EditText)findViewById(R.id.account_always_bcc);
mAccountAlwaysBcc.setText(mAccount.getAlwaysBcc());
mAccountSignature = (EditText)findViewById(R.id.account_signature);
mAccountSignature.setText(mAccount.getSignature());
}
@Override
public void onResume() {
super.onResume();
mAccount.refresh(Preferences.getPreferences(this));
}
private void saveSettings() {
mAccount.setEmail(mAccountEmail.getText().toString());
mAccount.setAlwaysBcc(mAccountAlwaysBcc.getText().toString());
mAccount.setSignature(mAccountSignature.getText().toString());
mAccount.save(Preferences.getPreferences(this));
k9.setServicesEnabled(this);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
saveSettings();
}
return super.onKeyDown(keyCode, event);
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putSerializable(EXTRA_ACCOUNT, mAccount);
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
mAccount.save(Preferences.getPreferences(this));
finish();
}
}