Improved display settings

pull/175/head
M66B 5 years ago
parent 4eadb534e7
commit f88a1c8064

@ -65,6 +65,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private SwitchCompat swThreading; private SwitchCompat swThreading;
private SwitchCompat swIndentation; private SwitchCompat swIndentation;
private SwitchCompat swSeekbar;
private SwitchCompat swActionbar; private SwitchCompat swActionbar;
private SwitchCompat swHighlightUnread; private SwitchCompat swHighlightUnread;
@ -105,18 +106,17 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private SwitchCompat swTextSize; private SwitchCompat swTextSize;
private SwitchCompat swCollapseQuotes; private SwitchCompat swCollapseQuotes;
private SwitchCompat swImagesInline; private SwitchCompat swImagesInline;
private SwitchCompat swSeekbar;
private final static String[] RESET_OPTIONS = new String[]{ private final static String[] RESET_OPTIONS = new String[]{
"theme", "startup", "cards", "date", "navbar_colorize", "landscape", "landscape3", "theme", "startup", "cards", "date", "navbar_colorize", "landscape", "landscape3",
"threading", "indentation", "actionbar", "threading", "indentation", "seekbar", "actionbar",
"highlight_unread", "color_stripe", "highlight_unread", "color_stripe",
"avatars", "gravatars", "generated_icons", "identicons", "circular", "saturation", "brightness", "threshold", "avatars", "gravatars", "generated_icons", "identicons", "circular", "saturation", "brightness", "threshold",
"name_email", "prefer_contact", "distinguish_contacts", "authentication", "name_email", "prefer_contact", "distinguish_contacts", "authentication",
"subject_top", "font_size_sender", "font_size_subject", "subject_italic", "subject_ellipsize", "keywords_header", "subject_top", "font_size_sender", "font_size_subject", "subject_italic", "subject_ellipsize", "keywords_header",
"flags", "flags_background", "preview", "preview_italic", "preview_lines", "addresses", "attachments_alt", "flags", "flags_background", "preview", "preview_italic", "preview_lines", "addresses", "attachments_alt",
"contrast", "monospaced", "text_color", "text_size", "contrast", "monospaced", "text_color", "text_size",
"inline_images", "collapse_quotes", "seekbar" "inline_images", "collapse_quotes"
}; };
@Override @Override
@ -139,6 +139,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swThreading = view.findViewById(R.id.swThreading); swThreading = view.findViewById(R.id.swThreading);
swIndentation = view.findViewById(R.id.swIndentation); swIndentation = view.findViewById(R.id.swIndentation);
swSeekbar = view.findViewById(R.id.swSeekbar);
swActionbar = view.findViewById(R.id.swActionbar); swActionbar = view.findViewById(R.id.swActionbar);
swHighlightUnread = view.findViewById(R.id.swHighlightUnread); swHighlightUnread = view.findViewById(R.id.swHighlightUnread);
@ -178,7 +179,6 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swTextSize = view.findViewById(R.id.swTextSize); swTextSize = view.findViewById(R.id.swTextSize);
swCollapseQuotes = view.findViewById(R.id.swCollapseQuotes); swCollapseQuotes = view.findViewById(R.id.swCollapseQuotes);
swImagesInline = view.findViewById(R.id.swImagesInline); swImagesInline = view.findViewById(R.id.swImagesInline);
swSeekbar = view.findViewById(R.id.swSeekbar);
setOptions(); setOptions();
@ -260,6 +260,13 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
} }
}); });
swSeekbar.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("seekbar", checked).apply();
}
});
swActionbar.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { swActionbar.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -579,13 +586,6 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
} }
}); });
swSeekbar.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("seekbar", checked).apply();
}
});
PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this); PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this);
return view; return view;
@ -657,6 +657,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swThreading.setChecked(prefs.getBoolean("threading", true)); swThreading.setChecked(prefs.getBoolean("threading", true));
swIndentation.setChecked(prefs.getBoolean("indentation", false)); swIndentation.setChecked(prefs.getBoolean("indentation", false));
swIndentation.setEnabled(swCards.isChecked()); swIndentation.setEnabled(swCards.isChecked());
swSeekbar.setChecked(prefs.getBoolean("seekbar", false));
swActionbar.setChecked(prefs.getBoolean("actionbar", true)); swActionbar.setChecked(prefs.getBoolean("actionbar", true));
swHighlightUnread.setChecked(prefs.getBoolean("highlight_unread", true)); swHighlightUnread.setChecked(prefs.getBoolean("highlight_unread", true));
@ -724,7 +725,6 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swTextSize.setChecked(prefs.getBoolean("text_size", true)); swTextSize.setChecked(prefs.getBoolean("text_size", true));
swCollapseQuotes.setChecked(prefs.getBoolean("collapse_quotes", false)); swCollapseQuotes.setChecked(prefs.getBoolean("collapse_quotes", false));
swImagesInline.setChecked(prefs.getBoolean("inline_images", false)); swImagesInline.setChecked(prefs.getBoolean("inline_images", false));
swSeekbar.setChecked(prefs.getBoolean("seekbar", false));
updateColor(); updateColor();
} }

@ -219,6 +219,17 @@
app:layout_constraintTop_toBottomOf="@id/tvThreadingHint" app:layout_constraintTop_toBottomOf="@id/tvThreadingHint"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swSeekbar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_seekbar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swIndentation"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat
android:id="@+id/swActionbar" android:id="@+id/swActionbar"
android:layout_width="0dp" android:layout_width="0dp"
@ -228,18 +239,18 @@
android:text="@string/title_advanced_actionbar" android:text="@string/title_advanced_actionbar"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swIndentation" app:layout_constraintTop_toBottomOf="@id/swSeekbar"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<!-- message --> <!-- message -->
<eu.faircode.email.FixedTextView <eu.faircode.email.FixedTextView
android:id="@+id/tvCaptionMessage" android:id="@+id/tvCaptionHeader"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="24dp" android:layout_marginTop="24dp"
android:gravity="center" android:gravity="center"
android:text="@string/title_advanced_caption_message" android:text="@string/title_advanced_caption_message_header"
android:textAppearance="@style/TextAppearance.AppCompat.Large" android:textAppearance="@style/TextAppearance.AppCompat.Large"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
@ -254,7 +265,7 @@
android:text="@string/title_advanced_highlight_unread" android:text="@string/title_advanced_highlight_unread"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvCaptionMessage" app:layout_constraintTop_toBottomOf="@id/tvCaptionHeader"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat
@ -724,6 +735,18 @@
app:layout_constraintTop_toBottomOf="@id/swAddresses" app:layout_constraintTop_toBottomOf="@id/swAddresses"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvCaptionBody"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:gravity="center"
android:text="@string/title_advanced_caption_message_body"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/swAttachmentsAlt" />
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat
android:id="@+id/swContrast" android:id="@+id/swContrast"
android:layout_width="0dp" android:layout_width="0dp"
@ -732,7 +755,7 @@
android:text="@string/title_advanced_contrast" android:text="@string/title_advanced_contrast"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swAttachmentsAlt" app:layout_constraintTop_toBottomOf="@id/tvCaptionBody"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat
@ -803,16 +826,5 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swImagesInline" /> app:layout_constraintTop_toBottomOf="@id/swImagesInline" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swSeekbar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_seekbar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvImagesInlineHint"
app:switchPadding="12dp" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView> </ScrollView>

@ -300,7 +300,8 @@
<string name="title_advanced_caption_general">General</string> <string name="title_advanced_caption_general">General</string>
<string name="title_advanced_caption_conversation">Conversation</string> <string name="title_advanced_caption_conversation">Conversation</string>
<string name="title_advanced_caption_message">Message</string> <string name="title_advanced_caption_message_header">Message header</string>
<string name="title_advanced_caption_message_body">Message body</string>
<string name="title_advanced_landscape">Use two columns in landscape mode</string> <string name="title_advanced_landscape">Use two columns in landscape mode</string>
<string name="title_advanced_landscape3">Allow fixed navigation menu in landscape mode</string> <string name="title_advanced_landscape3">Allow fixed navigation menu in landscape mode</string>

Loading…
Cancel
Save