1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-08-13 17:03:48 -04:00

Add a preference for the new "touch friendly" view.

This commit is contained in:
Jesse Vincent 2010-01-13 03:37:13 +00:00
parent d5c185545b
commit 9bfc01ca32
5 changed files with 25 additions and 1 deletions

View File

@ -420,7 +420,7 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin
<string name="account_settings_notify_sync_summary">Notify in status bar while mail is checked</string>
<string name="account_settings_show_combined_label">Show combined Inbox</string>
<string name="account_settings_left_handed_label">Widgets on the left</string>
<string name="account_settings_touchable_label">Touch-friendly view</string>
<string name="account_settings_notify_self_label">Notify for mail I sent</string>
<string name="account_settings_notify_self_summary">Notify even for mail sent from an account identity</string>

View File

@ -39,6 +39,9 @@
/>
</PreferenceCategory>
<PreferenceCategory android:title="@string/messagelist_preferences" android:key="messagelist_preferences">
<CheckBoxPreference
android:key="messagelist_touchable"
android:title="@string/account_settings_touchable_label"/>
<CheckBoxPreference
android:key="messagelist_lefthanded_widgets"

View File

@ -67,6 +67,7 @@ public class K9 extends Application
private static boolean mMessageListLefthandedWidgets = false;
private static boolean mMessageListTouchable = false;
/**
@ -307,6 +308,7 @@ public class K9 extends Application
editor.putString("backgroundOperations", K9.backgroundOps.toString());
editor.putBoolean("animations", mAnimations);
editor.putBoolean("messageListLefthandedWidgets",mMessageListLefthandedWidgets);
editor.putBoolean("messageListTouchable",mMessageListTouchable);
editor.putInt("theme", theme);
}
@ -321,6 +323,7 @@ public class K9 extends Application
DEBUG_SENSITIVE = sprefs.getBoolean("enableSensitiveLogging", false);
mAnimations = sprefs.getBoolean("animations", true);
mMessageListLefthandedWidgets = sprefs.getBoolean("messageListLefthandedWidgets",false);
mMessageListTouchable = sprefs.getBoolean("messageListTouchable",false);
try
@ -441,6 +444,16 @@ public class K9 extends Application
mAnimations = animations;
}
public static boolean messageListTouchable()
{
return mMessageListTouchable;
}
public static void setMessageListTouchable(boolean touchy)
{
mMessageListTouchable = touchy;
}
public static boolean messageListLefthandedWidgets()
{
return mMessageListLefthandedWidgets;

View File

@ -460,6 +460,7 @@ public class MessageList
super.onResume();
mLeftHanded = K9.messageListLefthandedWidgets();
mTouchView = K9.messageListTouchable();
sortType = mController.getSortType();
sortAscending = mController.isSortAscending(sortType);

View File

@ -28,6 +28,7 @@ public class Prefs extends K9PreferenceActivity
private static final String PREFERENCE_ANIMATIONS = "animations";
private static final String PREFERENCE_MESSAGELIST_LEFTHANDED_WIDGETS = "messagelist_lefthanded_widgets";
private static final String PREFERENCE_MESSAGELIST_TOUCHABLE = "messagelist_touchable";
private ListPreference mTheme;
private ListPreference mDateFormat;
@ -36,6 +37,7 @@ public class Prefs extends K9PreferenceActivity
private CheckBoxPreference mSensitiveLogging;
private CheckBoxPreference mAnimations;
private CheckBoxPreference mLefthandedWidgets;
private CheckBoxPreference mTouchable;
private String initBackgroundOps;
@ -124,6 +126,9 @@ public class Prefs extends K9PreferenceActivity
mLefthandedWidgets = (CheckBoxPreference)findPreference(PREFERENCE_MESSAGELIST_LEFTHANDED_WIDGETS);
mLefthandedWidgets.setChecked(K9.messageListLefthandedWidgets());
mTouchable = (CheckBoxPreference)findPreference(PREFERENCE_MESSAGELIST_TOUCHABLE);
mTouchable.setChecked(K9.messageListTouchable());
}
@Override
@ -144,6 +149,8 @@ public class Prefs extends K9PreferenceActivity
K9.setAnimations(mAnimations.isChecked());
K9.setMessageListLefthandedWidgets(mLefthandedWidgets.isChecked());
K9.setMessageListTouchable(mTouchable.isChecked());
Editor editor = preferences.edit();
K9.save(editor);
DateFormatter.setDateFormat(editor, mDateFormat.getValue());