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

Create new preference option for wrapping folder names in folder list view.

Revert to using an ellipsized folder name as the default.
This commit is contained in:
Joe Steele 2012-11-26 17:50:43 -05:00
parent 7459f1c6b5
commit 26fe9b7757
7 changed files with 40 additions and 0 deletions

View File

@ -33,6 +33,8 @@
android:id="@+id/folder_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="start"
android:textColor="?android:attr/textColorPrimary"
android:textAppearance="?android:attr/textAppearanceLarge" />

View File

@ -322,6 +322,8 @@ Please submit bug reports, contribute new features and ask questions at
<string name="global_settings_registered_name_color_label">Colorize contacts</string>
<string name="global_settings_registered_name_color_default">Don\'t colorize names in your contact list</string>
<string name="global_settings_registered_name_color_changed">Colorize names in your contact list</string>
<string name="global_settings_folderlist_wrap_folder_names_label">Wrap folder names</string>
<string name="global_settings_folderlist_wrap_folder_names_summary">Show complete folder name wrapped on multiple lines rather than a partial name on a single line</string>
<string name="global_settings_messageview_fixedwidth_label">Fixed-width fonts</string>
<string name="global_settings_messageview_fixedwidth_summary">Use a fixed-width font when showing plain-text messages</string>
@ -812,6 +814,7 @@ Please submit bug reports, contribute new features and ask questions at
<string name="accountlist_preferences">Account list</string>
<string name="messagelist_preferences">Message lists</string>
<string name="messageview_preferences">Messages</string>
<string name="folderlist_preferences">Folder lists</string>
<string name="settings_theme_label">Theme</string>
<string name="settings_language_label">Language</string>

View File

@ -176,6 +176,18 @@
</PreferenceCategory>
<PreferenceCategory
android:key="folderlist_preferences"
android:title="@string/folderlist_preferences">
<CheckBoxPreference
android:persistent="false"
android:key="folderlist_wrap_folder_name"
android:title="@string/global_settings_folderlist_wrap_folder_names_label"
android:summary="@string/global_settings_folderlist_wrap_folder_names_summary" />
</PreferenceCategory>
</PreferenceScreen>
<PreferenceScreen

View File

@ -234,6 +234,7 @@ public class K9 extends Application {
private static String mQuietTimeStarts = null;
private static String mQuietTimeEnds = null;
private static String mAttachmentDefaultPath = "";
private static boolean mWrapFolderNames = false;
private static boolean mBatchButtonsMarkRead = true;
private static boolean mBatchButtonsDelete = true;
@ -499,6 +500,7 @@ public class K9 extends Application {
editor.putBoolean("messageViewFixedWidthFont", mMessageViewFixedWidthFont);
editor.putBoolean("messageViewReturnToList", mMessageViewReturnToList);
editor.putBoolean("messageViewShowNext", mMessageViewShowNext);
editor.putBoolean("wrapFolderNames", mWrapFolderNames);
editor.putBoolean("batchButtonsMarkRead", mBatchButtonsMarkRead);
editor.putBoolean("batchButtonsDelete", mBatchButtonsDelete);
@ -692,6 +694,7 @@ public class K9 extends Application {
mMessageViewFixedWidthFont = sprefs.getBoolean("messageViewFixedWidthFont", false);
mMessageViewReturnToList = sprefs.getBoolean("messageViewReturnToList", false);
mMessageViewShowNext = sprefs.getBoolean("messageViewShowNext", false);
mWrapFolderNames = sprefs.getBoolean("wrapFolderNames", false);
mBatchButtonsMarkRead = sprefs.getBoolean("batchButtonsMarkRead", true);
mBatchButtonsDelete = sprefs.getBoolean("batchButtonsDelete", true);
@ -1212,6 +1215,13 @@ public class K9 extends Application {
}
}
public static boolean wrapFolderNames() {
return mWrapFolderNames;
}
public static void setWrapFolderNames(final boolean state) {
mWrapFolderNames = state;
}
public static String getAttachmentDefaultPath() {
return mAttachmentDefaultPath;
}

View File

@ -1160,6 +1160,10 @@ public class FolderList extends K9ListActivity implements OnNavigationListener {
holder.chip.setBackgroundDrawable(mAccount.generateColorChip((folder.unreadMessageCount == 0 ? true : false ), false, false, false,false).drawable());
holder.folderName.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getFolderName());
if (K9.wrapFolderNames()) {
holder.folderName.setEllipsize(null);
holder.folderName.setSingleLine(false);
}
holder.folderStatus.setTextSize(TypedValue.COMPLEX_UNIT_SP, mFontSizes.getFolderStatus());

View File

@ -92,6 +92,7 @@ public class Prefs extends K9PreferenceActivity {
private static final String PREFERENCE_ATTACHMENT_DEF_PATH = "attachment_default_path";
private static final String PREFERENCE_BACKGROUND_AS_UNREAD_INDICATOR = "messagelist_background_as_unread_indicator";
private static final String PREFERENCE_THREADED_VIEW = "threaded_view";
private static final String PREFERENCE_FOLDERLIST_WRAP_NAME = "folderlist_wrap_folder_name";
private static final int ACTIVITY_CHOOSE_FOLDER = 1;
@ -122,6 +123,7 @@ public class Prefs extends K9PreferenceActivity {
private CheckBoxPreference mUseGalleryBugWorkaround;
private CheckBoxPreference mDebugLogging;
private CheckBoxPreference mSensitiveLogging;
private CheckBoxPreference mWrapFolderNames;
private CheckBoxPreference mQuietTimeEnabled;
private com.fsck.k9.preferences.TimePickerPreference mQuietTimeStarts;
@ -394,6 +396,9 @@ public class Prefs extends K9PreferenceActivity {
}
};
});
mWrapFolderNames = (CheckBoxPreference)findPreference(PREFERENCE_FOLDERLIST_WRAP_NAME);
mWrapFolderNames.setChecked(K9.wrapFolderNames());
mBatchButtonsMarkRead = (CheckBoxPreference)findPreference(PREFERENCE_BATCH_BUTTONS_MARK_READ);
mBatchButtonsDelete = (CheckBoxPreference)findPreference(PREFERENCE_BATCH_BUTTONS_DELETE);
@ -468,6 +473,7 @@ public class Prefs extends K9PreferenceActivity {
K9.setQuietTimeStarts(mQuietTimeStarts.getTime());
K9.setQuietTimeEnds(mQuietTimeEnds.getTime());
K9.setWrapFolderNames(mWrapFolderNames.isChecked());
if (mNotificationQuickDelete != null) {
K9.setNotificationQuickDeleteBehaviour(

View File

@ -197,6 +197,9 @@ public class GlobalSettings {
s.put("useVolumeKeysForNavigation", Settings.versions(
new V(1, new BooleanSetting(false))
));
s.put("wrapFolderNames", Settings.versions(
new V(21, new BooleanSetting(false))
));
s.put("batchButtonsMarkRead", Settings.versions(
new V(8, new BooleanSetting(true))
));