|
|
@ -1394,207 +1394,211 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void setOptions() {
|
|
|
|
private void setOptions() {
|
|
|
|
if (view == null || getContext() == null)
|
|
|
|
try {
|
|
|
|
return;
|
|
|
|
if (view == null || getContext() == null)
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String startup = prefs.getString("startup", "unified");
|
|
|
|
|
|
|
|
String[] startupValues = getResources().getStringArray(R.array.startupValues);
|
|
|
|
|
|
|
|
for (int pos = 0; pos < startupValues.length; pos++)
|
|
|
|
|
|
|
|
if (startupValues[pos].equals(startup)) {
|
|
|
|
|
|
|
|
spStartup.setSelection(pos);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
|
|
|
swDate.setChecked(prefs.getBoolean("date", true));
|
|
|
|
|
|
|
|
swDateWeek.setChecked(prefs.getBoolean("date_week", false));
|
|
|
|
String startup = prefs.getString("startup", "unified");
|
|
|
|
swDateWeek.setEnabled(swDate.isChecked());
|
|
|
|
String[] startupValues = getResources().getStringArray(R.array.startupValues);
|
|
|
|
swDateFixed.setChecked(prefs.getBoolean("date_fixed", false));
|
|
|
|
for (int pos = 0; pos < startupValues.length; pos++)
|
|
|
|
swDateFixed.setEnabled(!swDate.isChecked());
|
|
|
|
if (startupValues[pos].equals(startup)) {
|
|
|
|
swDateBold.setChecked(prefs.getBoolean("date_bold", false));
|
|
|
|
spStartup.setSelection(pos);
|
|
|
|
swDateBold.setEnabled(swDate.isChecked() || swDateFixed.isChecked());
|
|
|
|
break;
|
|
|
|
swCategory.setChecked(prefs.getBoolean("group_category", false));
|
|
|
|
}
|
|
|
|
swCards.setChecked(prefs.getBoolean("cards", true));
|
|
|
|
|
|
|
|
swBeige.setChecked(prefs.getBoolean("beige", true));
|
|
|
|
swDate.setChecked(prefs.getBoolean("date", true));
|
|
|
|
swTabularBackground.setChecked(prefs.getBoolean("tabular_card_bg", false));
|
|
|
|
swDateWeek.setChecked(prefs.getBoolean("date_week", false));
|
|
|
|
swShadow.setChecked(prefs.getBoolean("shadow_unread", false));
|
|
|
|
swDateWeek.setEnabled(swDate.isChecked());
|
|
|
|
swShadowBorder.setChecked(prefs.getBoolean("shadow_border", true));
|
|
|
|
swDateFixed.setChecked(prefs.getBoolean("date_fixed", false));
|
|
|
|
swShadowHighlight.setChecked(prefs.getBoolean("shadow_highlight", false));
|
|
|
|
swDateFixed.setEnabled(!swDate.isChecked());
|
|
|
|
swBeige.setEnabled(swCards.isChecked());
|
|
|
|
swDateBold.setChecked(prefs.getBoolean("date_bold", false));
|
|
|
|
swTabularBackground.setEnabled(!swCards.isChecked());
|
|
|
|
swDateBold.setEnabled(swDate.isChecked() || swDateFixed.isChecked());
|
|
|
|
swShadow.setEnabled(swCards.isChecked());
|
|
|
|
swCategory.setChecked(prefs.getBoolean("group_category", false));
|
|
|
|
swShadowBorder.setEnabled(swShadow.isEnabled() && swShadow.isChecked());
|
|
|
|
swCards.setChecked(prefs.getBoolean("cards", true));
|
|
|
|
swShadowHighlight.setEnabled(swShadow.isEnabled() && swShadow.isChecked());
|
|
|
|
swBeige.setChecked(prefs.getBoolean("beige", true));
|
|
|
|
swTabularDividers.setChecked(prefs.getBoolean("dividers", true));
|
|
|
|
swTabularBackground.setChecked(prefs.getBoolean("tabular_card_bg", false));
|
|
|
|
swTabularDividers.setEnabled(!swCards.isChecked());
|
|
|
|
swShadow.setChecked(prefs.getBoolean("shadow_unread", false));
|
|
|
|
swPortrait2.setChecked(prefs.getBoolean("portrait2", false));
|
|
|
|
swShadowBorder.setChecked(prefs.getBoolean("shadow_border", true));
|
|
|
|
swPortrait2c.setChecked(prefs.getBoolean("portrait2c", false) && !swPortrait2.isChecked());
|
|
|
|
swShadowHighlight.setChecked(prefs.getBoolean("shadow_highlight", false));
|
|
|
|
spPortraitMinSize.setSelection(prefs.getInt("portrait_min_size", 0));
|
|
|
|
swBeige.setEnabled(swCards.isChecked());
|
|
|
|
swLandscape.setChecked(prefs.getBoolean("landscape", true));
|
|
|
|
swTabularBackground.setEnabled(!swCards.isChecked());
|
|
|
|
spLandscapeMinSize.setSelection(prefs.getInt("landscape_min_size", 0));
|
|
|
|
swShadow.setEnabled(swCards.isChecked());
|
|
|
|
swClosePane.setChecked(prefs.getBoolean("close_pane", !Helper.isSurfaceDuo()));
|
|
|
|
swShadowBorder.setEnabled(swShadow.isEnabled() && swShadow.isChecked());
|
|
|
|
|
|
|
|
swShadowHighlight.setEnabled(swShadow.isEnabled() && swShadow.isChecked());
|
|
|
|
int column_width = prefs.getInt("column_width", 67);
|
|
|
|
swTabularDividers.setChecked(prefs.getBoolean("dividers", true));
|
|
|
|
tvColumnWidth.setText(getString(R.string.title_advanced_column_width, NF.format(column_width)));
|
|
|
|
swTabularDividers.setEnabled(!swCards.isChecked());
|
|
|
|
sbColumnWidth.setProgress(column_width);
|
|
|
|
swPortrait2.setChecked(prefs.getBoolean("portrait2", false));
|
|
|
|
|
|
|
|
swPortrait2c.setChecked(prefs.getBoolean("portrait2c", false) && !swPortrait2.isChecked());
|
|
|
|
swHideToolbar.setChecked(prefs.getBoolean("hide_toolbar", !BuildConfig.PLAY_STORE_RELEASE));
|
|
|
|
spPortraitMinSize.setSelection(prefs.getInt("portrait_min_size", 0));
|
|
|
|
swNavOptions.setChecked(prefs.getBoolean("nav_options", true));
|
|
|
|
swLandscape.setChecked(prefs.getBoolean("landscape", true));
|
|
|
|
swNavCategories.setChecked(prefs.getBoolean("nav_categories", false));
|
|
|
|
spLandscapeMinSize.setSelection(prefs.getInt("landscape_min_size", 0));
|
|
|
|
swNavLastSync.setChecked(prefs.getBoolean("nav_last_sync", true));
|
|
|
|
swClosePane.setChecked(prefs.getBoolean("close_pane", !Helper.isSurfaceDuo()));
|
|
|
|
swNavMessageCount.setChecked(prefs.getBoolean("nav_count", false));
|
|
|
|
|
|
|
|
swNavUnseenDrafts.setChecked(prefs.getBoolean("nav_unseen_drafts", false));
|
|
|
|
int column_width = prefs.getInt("column_width", 67);
|
|
|
|
swNavPinnedCount.setChecked(prefs.getBoolean("nav_count_pinned", false));
|
|
|
|
tvColumnWidth.setText(getString(R.string.title_advanced_column_width, NF.format(column_width)));
|
|
|
|
swNavBarColorize.setChecked(prefs.getBoolean("navbar_colorize", false));
|
|
|
|
sbColumnWidth.setProgress(column_width);
|
|
|
|
|
|
|
|
|
|
|
|
swThreading.setChecked(prefs.getBoolean("threading", true));
|
|
|
|
swHideToolbar.setChecked(prefs.getBoolean("hide_toolbar", !BuildConfig.PLAY_STORE_RELEASE));
|
|
|
|
swThreadingUnread.setChecked(prefs.getBoolean("threading_unread", false));
|
|
|
|
swNavOptions.setChecked(prefs.getBoolean("nav_options", true));
|
|
|
|
swThreadingUnread.setEnabled(swThreading.isChecked());
|
|
|
|
swNavCategories.setChecked(prefs.getBoolean("nav_categories", false));
|
|
|
|
swIndentation.setChecked(prefs.getBoolean("indentation", false));
|
|
|
|
swNavLastSync.setChecked(prefs.getBoolean("nav_last_sync", true));
|
|
|
|
swIndentation.setEnabled(swCards.isChecked() && swThreading.isChecked());
|
|
|
|
swNavMessageCount.setChecked(prefs.getBoolean("nav_count", false));
|
|
|
|
swSeekbar.setChecked(prefs.getBoolean("seekbar", false));
|
|
|
|
swNavUnseenDrafts.setChecked(prefs.getBoolean("nav_unseen_drafts", false));
|
|
|
|
swActionbar.setChecked(prefs.getBoolean("actionbar", true));
|
|
|
|
swNavPinnedCount.setChecked(prefs.getBoolean("nav_count_pinned", false));
|
|
|
|
swActionbarSwap.setChecked(prefs.getBoolean("actionbar_swap", false));
|
|
|
|
swNavBarColorize.setChecked(prefs.getBoolean("navbar_colorize", false));
|
|
|
|
swActionbarSwap.setEnabled(swActionbar.isChecked());
|
|
|
|
|
|
|
|
swActionbarColor.setChecked(prefs.getBoolean("actionbar_color", false));
|
|
|
|
swThreading.setChecked(prefs.getBoolean("threading", true));
|
|
|
|
swActionbarColor.setEnabled(swActionbar.isChecked());
|
|
|
|
swThreadingUnread.setChecked(prefs.getBoolean("threading_unread", false));
|
|
|
|
|
|
|
|
swThreadingUnread.setEnabled(swThreading.isChecked());
|
|
|
|
swHighlightUnread.setChecked(prefs.getBoolean("highlight_unread", true));
|
|
|
|
swIndentation.setChecked(prefs.getBoolean("indentation", false));
|
|
|
|
|
|
|
|
swIndentation.setEnabled(swCards.isChecked() && swThreading.isChecked());
|
|
|
|
btnHighlightColor.setColor(prefs.getInt("highlight_color",
|
|
|
|
swSeekbar.setChecked(prefs.getBoolean("seekbar", false));
|
|
|
|
Helper.resolveColor(getContext(), R.attr.colorUnreadHighlight)));
|
|
|
|
swActionbar.setChecked(prefs.getBoolean("actionbar", true));
|
|
|
|
|
|
|
|
swActionbarSwap.setChecked(prefs.getBoolean("actionbar_swap", false));
|
|
|
|
swColorStripe.setChecked(prefs.getBoolean("color_stripe", true));
|
|
|
|
swActionbarSwap.setEnabled(swActionbar.isChecked());
|
|
|
|
swColorStripeWide.setChecked(prefs.getBoolean("color_stripe_wide", false));
|
|
|
|
swActionbarColor.setChecked(prefs.getBoolean("actionbar_color", false));
|
|
|
|
//swColorStripeWide.setEnabled(swColorStripe.isChecked());
|
|
|
|
swActionbarColor.setEnabled(swActionbar.isChecked());
|
|
|
|
swAvatars.setChecked(prefs.getBoolean("avatars", true));
|
|
|
|
|
|
|
|
swBimi.setChecked(prefs.getBoolean("bimi", false));
|
|
|
|
swHighlightUnread.setChecked(prefs.getBoolean("highlight_unread", true));
|
|
|
|
swGravatars.setChecked(prefs.getBoolean("gravatars", false));
|
|
|
|
|
|
|
|
swLibravatars.setChecked(prefs.getBoolean("libravatars", false));
|
|
|
|
btnHighlightColor.setColor(prefs.getInt("highlight_color",
|
|
|
|
swFavicons.setChecked(prefs.getBoolean("favicons", false));
|
|
|
|
Helper.resolveColor(getContext(), R.attr.colorUnreadHighlight)));
|
|
|
|
swFaviconsPartial.setChecked(prefs.getBoolean("favicons_partial", true));
|
|
|
|
|
|
|
|
swFaviconsPartial.setEnabled(swFavicons.isChecked());
|
|
|
|
swColorStripe.setChecked(prefs.getBoolean("color_stripe", true));
|
|
|
|
swGeneratedIcons.setChecked(prefs.getBoolean("generated_icons", true));
|
|
|
|
swColorStripeWide.setChecked(prefs.getBoolean("color_stripe_wide", false));
|
|
|
|
swIdenticons.setChecked(prefs.getBoolean("identicons", false));
|
|
|
|
//swColorStripeWide.setEnabled(swColorStripe.isChecked());
|
|
|
|
swIdenticons.setEnabled(swGeneratedIcons.isChecked());
|
|
|
|
swAvatars.setChecked(prefs.getBoolean("avatars", true));
|
|
|
|
swCircular.setChecked(prefs.getBoolean("circular", true));
|
|
|
|
swBimi.setChecked(prefs.getBoolean("bimi", false));
|
|
|
|
|
|
|
|
swGravatars.setChecked(prefs.getBoolean("gravatars", false));
|
|
|
|
int saturation = prefs.getInt("saturation", 100);
|
|
|
|
swLibravatars.setChecked(prefs.getBoolean("libravatars", false));
|
|
|
|
tvSaturation.setText(getString(R.string.title_advanced_color_saturation, NF.format(saturation)));
|
|
|
|
swFavicons.setChecked(prefs.getBoolean("favicons", false));
|
|
|
|
sbSaturation.setProgress(saturation);
|
|
|
|
swFaviconsPartial.setChecked(prefs.getBoolean("favicons_partial", true));
|
|
|
|
sbSaturation.setEnabled(swGeneratedIcons.isChecked());
|
|
|
|
swFaviconsPartial.setEnabled(swFavicons.isChecked());
|
|
|
|
|
|
|
|
swGeneratedIcons.setChecked(prefs.getBoolean("generated_icons", true));
|
|
|
|
int brightness = prefs.getInt("brightness", 100);
|
|
|
|
swIdenticons.setChecked(prefs.getBoolean("identicons", false));
|
|
|
|
tvBrightness.setText(getString(R.string.title_advanced_color_value, NF.format(brightness)));
|
|
|
|
swIdenticons.setEnabled(swGeneratedIcons.isChecked());
|
|
|
|
sbBrightness.setProgress(brightness);
|
|
|
|
swCircular.setChecked(prefs.getBoolean("circular", true));
|
|
|
|
sbBrightness.setEnabled(swGeneratedIcons.isChecked());
|
|
|
|
|
|
|
|
|
|
|
|
int saturation = prefs.getInt("saturation", 100);
|
|
|
|
int threshold = prefs.getInt("threshold", 50);
|
|
|
|
tvSaturation.setText(getString(R.string.title_advanced_color_saturation, NF.format(saturation)));
|
|
|
|
tvThreshold.setText(getString(R.string.title_advanced_color_threshold, NF.format(threshold)));
|
|
|
|
sbSaturation.setProgress(saturation);
|
|
|
|
sbThreshold.setProgress(threshold);
|
|
|
|
sbSaturation.setEnabled(swGeneratedIcons.isChecked());
|
|
|
|
sbThreshold.setEnabled(swGeneratedIcons.isChecked());
|
|
|
|
|
|
|
|
|
|
|
|
int brightness = prefs.getInt("brightness", 100);
|
|
|
|
MessageHelper.AddressFormat email_format = MessageHelper.getAddressFormat(getContext());
|
|
|
|
tvBrightness.setText(getString(R.string.title_advanced_color_value, NF.format(brightness)));
|
|
|
|
spNameEmail.setSelection(email_format.ordinal());
|
|
|
|
sbBrightness.setProgress(brightness);
|
|
|
|
swPreferContact.setChecked(prefs.getBoolean("prefer_contact", false));
|
|
|
|
sbBrightness.setEnabled(swGeneratedIcons.isChecked());
|
|
|
|
swOnlyContact.setChecked(prefs.getBoolean("only_contact", false));
|
|
|
|
|
|
|
|
swDistinguishContacts.setChecked(prefs.getBoolean("distinguish_contacts", false));
|
|
|
|
int threshold = prefs.getInt("threshold", 50);
|
|
|
|
swShowRecipients.setChecked(prefs.getBoolean("show_recipients", false));
|
|
|
|
tvThreshold.setText(getString(R.string.title_advanced_color_threshold, NF.format(threshold)));
|
|
|
|
|
|
|
|
sbThreshold.setProgress(threshold);
|
|
|
|
swSubjectTop.setChecked(prefs.getBoolean("subject_top", false));
|
|
|
|
sbThreshold.setEnabled(swGeneratedIcons.isChecked());
|
|
|
|
swSubjectItalic.setChecked(prefs.getBoolean("subject_italic", true));
|
|
|
|
|
|
|
|
swHighlightSubject.setChecked(prefs.getBoolean("highlight_subject", false));
|
|
|
|
MessageHelper.AddressFormat email_format = MessageHelper.getAddressFormat(getContext());
|
|
|
|
|
|
|
|
spNameEmail.setSelection(email_format.ordinal());
|
|
|
|
int[] fontSizeValues = getResources().getIntArray(R.array.fontSizeValues);
|
|
|
|
swPreferContact.setChecked(prefs.getBoolean("prefer_contact", false));
|
|
|
|
String[] ellipsizeValues = getResources().getStringArray(R.array.ellipsizeValues);
|
|
|
|
swOnlyContact.setChecked(prefs.getBoolean("only_contact", false));
|
|
|
|
|
|
|
|
swDistinguishContacts.setChecked(prefs.getBoolean("distinguish_contacts", false));
|
|
|
|
int font_size_sender = prefs.getInt("font_size_sender", -1);
|
|
|
|
swShowRecipients.setChecked(prefs.getBoolean("show_recipients", false));
|
|
|
|
for (int pos = 0; pos < fontSizeValues.length; pos++)
|
|
|
|
|
|
|
|
if (fontSizeValues[pos] == font_size_sender) {
|
|
|
|
swSubjectTop.setChecked(prefs.getBoolean("subject_top", false));
|
|
|
|
spFontSizeSender.setSelection(pos);
|
|
|
|
swSubjectItalic.setChecked(prefs.getBoolean("subject_italic", true));
|
|
|
|
break;
|
|
|
|
swHighlightSubject.setChecked(prefs.getBoolean("highlight_subject", false));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int[] fontSizeValues = getResources().getIntArray(R.array.fontSizeValues);
|
|
|
|
int font_size_subject = prefs.getInt("font_size_subject", -1);
|
|
|
|
String[] ellipsizeValues = getResources().getStringArray(R.array.ellipsizeValues);
|
|
|
|
for (int pos = 0; pos < fontSizeValues.length; pos++)
|
|
|
|
|
|
|
|
if (fontSizeValues[pos] == font_size_subject) {
|
|
|
|
int font_size_sender = prefs.getInt("font_size_sender", -1);
|
|
|
|
spFontSizeSubject.setSelection(pos);
|
|
|
|
for (int pos = 0; pos < fontSizeValues.length; pos++)
|
|
|
|
break;
|
|
|
|
if (fontSizeValues[pos] == font_size_sender) {
|
|
|
|
}
|
|
|
|
spFontSizeSender.setSelection(pos);
|
|
|
|
|
|
|
|
break;
|
|
|
|
String sender_ellipsize = prefs.getString("sender_ellipsize", "end");
|
|
|
|
}
|
|
|
|
for (int pos = 0; pos < ellipsizeValues.length; pos++)
|
|
|
|
|
|
|
|
if (ellipsizeValues[pos].equals(sender_ellipsize)) {
|
|
|
|
int font_size_subject = prefs.getInt("font_size_subject", -1);
|
|
|
|
spSenderEllipsize.setSelection(pos);
|
|
|
|
for (int pos = 0; pos < fontSizeValues.length; pos++)
|
|
|
|
break;
|
|
|
|
if (fontSizeValues[pos] == font_size_subject) {
|
|
|
|
}
|
|
|
|
spFontSizeSubject.setSelection(pos);
|
|
|
|
|
|
|
|
break;
|
|
|
|
String subject_ellipsize = prefs.getString("subject_ellipsize", "full");
|
|
|
|
}
|
|
|
|
for (int pos = 0; pos < ellipsizeValues.length; pos++)
|
|
|
|
|
|
|
|
if (ellipsizeValues[pos].equals(subject_ellipsize)) {
|
|
|
|
String sender_ellipsize = prefs.getString("sender_ellipsize", "end");
|
|
|
|
spSubjectEllipsize.setSelection(pos);
|
|
|
|
for (int pos = 0; pos < ellipsizeValues.length; pos++)
|
|
|
|
break;
|
|
|
|
if (ellipsizeValues[pos].equals(sender_ellipsize)) {
|
|
|
|
}
|
|
|
|
spSenderEllipsize.setSelection(pos);
|
|
|
|
|
|
|
|
break;
|
|
|
|
swKeywords.setChecked(prefs.getBoolean("keywords_header", false));
|
|
|
|
}
|
|
|
|
swLabels.setChecked(prefs.getBoolean("labels_header", true));
|
|
|
|
|
|
|
|
swFlags.setChecked(prefs.getBoolean("flags", true));
|
|
|
|
String subject_ellipsize = prefs.getString("subject_ellipsize", "full");
|
|
|
|
swFlagsBackground.setChecked(prefs.getBoolean("flags_background", false));
|
|
|
|
for (int pos = 0; pos < ellipsizeValues.length; pos++)
|
|
|
|
swPreview.setChecked(prefs.getBoolean("preview", false));
|
|
|
|
if (ellipsizeValues[pos].equals(subject_ellipsize)) {
|
|
|
|
swPreviewItalic.setChecked(prefs.getBoolean("preview_italic", true));
|
|
|
|
spSubjectEllipsize.setSelection(pos);
|
|
|
|
swPreviewItalic.setEnabled(swPreview.isChecked());
|
|
|
|
break;
|
|
|
|
spPreviewLines.setSelection(prefs.getInt("preview_lines", 1) - 1);
|
|
|
|
}
|
|
|
|
spPreviewLines.setEnabled(swPreview.isChecked());
|
|
|
|
|
|
|
|
swAlignHeader.setChecked(prefs.getBoolean("align_header", false));
|
|
|
|
swKeywords.setChecked(prefs.getBoolean("keywords_header", false));
|
|
|
|
|
|
|
|
swLabels.setChecked(prefs.getBoolean("labels_header", true));
|
|
|
|
swAddresses.setChecked(prefs.getBoolean("addresses", false));
|
|
|
|
swFlags.setChecked(prefs.getBoolean("flags", true));
|
|
|
|
|
|
|
|
swFlagsBackground.setChecked(prefs.getBoolean("flags_background", false));
|
|
|
|
int message_zoom = prefs.getInt("message_zoom", 100);
|
|
|
|
swPreview.setChecked(prefs.getBoolean("preview", false));
|
|
|
|
tvMessageZoom.setText(getString(R.string.title_advanced_message_text_zoom2, NF.format(message_zoom)));
|
|
|
|
swPreviewItalic.setChecked(prefs.getBoolean("preview_italic", true));
|
|
|
|
if (message_zoom >= 50 && message_zoom <= 250)
|
|
|
|
swPreviewItalic.setEnabled(swPreview.isChecked());
|
|
|
|
sbMessageZoom.setProgress(message_zoom - 50);
|
|
|
|
spPreviewLines.setSelection(prefs.getInt("preview_lines", 1) - 1);
|
|
|
|
|
|
|
|
spPreviewLines.setEnabled(swPreview.isChecked());
|
|
|
|
swOverviewMode.setChecked(prefs.getBoolean("overview_mode", false));
|
|
|
|
swAlignHeader.setChecked(prefs.getBoolean("align_header", false));
|
|
|
|
swOverrideWidth.setChecked(prefs.getBoolean("override_width", false));
|
|
|
|
|
|
|
|
|
|
|
|
swAddresses.setChecked(prefs.getBoolean("addresses", false));
|
|
|
|
swContrast.setChecked(prefs.getBoolean("contrast", false));
|
|
|
|
|
|
|
|
swHyphenation.setChecked(prefs.getBoolean("hyphenation", false));
|
|
|
|
int message_zoom = prefs.getInt("message_zoom", 100);
|
|
|
|
|
|
|
|
tvMessageZoom.setText(getString(R.string.title_advanced_message_text_zoom2, NF.format(message_zoom)));
|
|
|
|
String display_font = prefs.getString("display_font", "");
|
|
|
|
if (message_zoom >= 50 && message_zoom <= 250)
|
|
|
|
List<StyleHelper.FontDescriptor> fonts = StyleHelper.getFonts(getContext());
|
|
|
|
sbMessageZoom.setProgress(message_zoom - 50);
|
|
|
|
for (int pos = 0; pos < fonts.size(); pos++) {
|
|
|
|
|
|
|
|
StyleHelper.FontDescriptor font = fonts.get(pos);
|
|
|
|
swOverviewMode.setChecked(prefs.getBoolean("overview_mode", false));
|
|
|
|
if (font.type.equals(display_font)) {
|
|
|
|
swOverrideWidth.setChecked(prefs.getBoolean("override_width", false));
|
|
|
|
spDisplayFont.setSelection(pos + 1);
|
|
|
|
|
|
|
|
break;
|
|
|
|
swContrast.setChecked(prefs.getBoolean("contrast", false));
|
|
|
|
}
|
|
|
|
swHyphenation.setChecked(prefs.getBoolean("hyphenation", false));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String display_font = prefs.getString("display_font", "");
|
|
|
|
|
|
|
|
List<StyleHelper.FontDescriptor> fonts = StyleHelper.getFonts(getContext());
|
|
|
|
|
|
|
|
for (int pos = 0; pos < fonts.size(); pos++) {
|
|
|
|
|
|
|
|
StyleHelper.FontDescriptor font = fonts.get(pos);
|
|
|
|
|
|
|
|
if (font.type.equals(display_font)) {
|
|
|
|
|
|
|
|
spDisplayFont.setSelection(pos + 1);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
swMonospacedPre.setChecked(prefs.getBoolean("monospaced_pre", false));
|
|
|
|
swMonospacedPre.setChecked(prefs.getBoolean("monospaced_pre", false));
|
|
|
|
swTextSeparators.setChecked(prefs.getBoolean("text_separators", true));
|
|
|
|
swTextSeparators.setChecked(prefs.getBoolean("text_separators", true));
|
|
|
|
swCollapseQuotes.setChecked(prefs.getBoolean("collapse_quotes", false));
|
|
|
|
swCollapseQuotes.setChecked(prefs.getBoolean("collapse_quotes", false));
|
|
|
|
swImagesPlaceholders.setChecked(prefs.getBoolean("image_placeholders", true));
|
|
|
|
swImagesPlaceholders.setChecked(prefs.getBoolean("image_placeholders", true));
|
|
|
|
swImagesInline.setChecked(prefs.getBoolean("inline_images", false));
|
|
|
|
swImagesInline.setChecked(prefs.getBoolean("inline_images", false));
|
|
|
|
swButtonExtra.setChecked(prefs.getBoolean("button_extra", false));
|
|
|
|
swButtonExtra.setChecked(prefs.getBoolean("button_extra", false));
|
|
|
|
swUnzip.setChecked(prefs.getBoolean("unzip", !BuildConfig.PLAY_STORE_RELEASE));
|
|
|
|
swUnzip.setChecked(prefs.getBoolean("unzip", !BuildConfig.PLAY_STORE_RELEASE));
|
|
|
|
swAttachmentsAlt.setChecked(prefs.getBoolean("attachments_alt", false));
|
|
|
|
swAttachmentsAlt.setChecked(prefs.getBoolean("attachments_alt", false));
|
|
|
|
swThumbnails.setChecked(prefs.getBoolean("thumbnails", true));
|
|
|
|
swThumbnails.setChecked(prefs.getBoolean("thumbnails", true));
|
|
|
|
|
|
|
|
|
|
|
|
swListCount.setChecked(prefs.getBoolean("list_count", false));
|
|
|
|
swListCount.setChecked(prefs.getBoolean("list_count", false));
|
|
|
|
swBundledFonts.setChecked(prefs.getBoolean("bundled_fonts", true));
|
|
|
|
swBundledFonts.setChecked(prefs.getBoolean("bundled_fonts", true));
|
|
|
|
swParseClasses.setChecked(prefs.getBoolean("parse_classes", true));
|
|
|
|
swParseClasses.setChecked(prefs.getBoolean("parse_classes", true));
|
|
|
|
swBackgroundColor.setChecked(prefs.getBoolean("background_color", false));
|
|
|
|
swBackgroundColor.setChecked(prefs.getBoolean("background_color", false));
|
|
|
|
swTextColor.setChecked(prefs.getBoolean("text_color", true));
|
|
|
|
swTextColor.setChecked(prefs.getBoolean("text_color", true));
|
|
|
|
swTextSize.setChecked(prefs.getBoolean("text_size", true));
|
|
|
|
swTextSize.setChecked(prefs.getBoolean("text_size", true));
|
|
|
|
swTextFont.setChecked(prefs.getBoolean("text_font", true));
|
|
|
|
swTextFont.setChecked(prefs.getBoolean("text_font", true));
|
|
|
|
swTextAlign.setChecked(prefs.getBoolean("text_align", true));
|
|
|
|
swTextAlign.setChecked(prefs.getBoolean("text_align", true));
|
|
|
|
swTextTitles.setChecked(prefs.getBoolean("text_titles", false));
|
|
|
|
swTextTitles.setChecked(prefs.getBoolean("text_titles", false));
|
|
|
|
swAuthentication.setChecked(prefs.getBoolean("authentication", true));
|
|
|
|
swAuthentication.setChecked(prefs.getBoolean("authentication", true));
|
|
|
|
swAuthenticationIndicator.setChecked(prefs.getBoolean("authentication_indicator", false));
|
|
|
|
swAuthenticationIndicator.setChecked(prefs.getBoolean("authentication_indicator", false));
|
|
|
|
swAuthenticationIndicator.setEnabled(swAuthentication.isChecked());
|
|
|
|
swAuthenticationIndicator.setEnabled(swAuthentication.isChecked());
|
|
|
|
|
|
|
|
|
|
|
|
updateColor();
|
|
|
|
updateColor();
|
|
|
|
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
|
|
|
|
Log.e(ex);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void setNavigationBarColor(int color) {
|
|
|
|
private void setNavigationBarColor(int color) {
|
|
|
|