Added support for text alignment

This commit is contained in:
M66B
2020-05-03 19:29:02 +02:00
parent c22bf91210
commit fc353a2817
4 changed files with 66 additions and 2 deletions

View File

@@ -107,6 +107,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private SwitchCompat swMonospaced;
private SwitchCompat swTextColor;
private SwitchCompat swTextSize;
private SwitchCompat swTextAlign;
private SwitchCompat swCollapseQuotes;
private SwitchCompat swImagesInline;
private SwitchCompat swAttachmentsAlt;
@@ -124,7 +125,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
"keywords_header", "flags", "flags_background",
"preview", "preview_italic", "preview_lines",
"addresses", "button_archive_trash", "button_move",
"contrast", "monospaced", "text_color", "text_size",
"contrast", "monospaced", "text_color", "text_size", "text_align",
"inline_images", "collapse_quotes", "attachments_alt",
"parse_classes", "authentication"
};
@@ -189,6 +190,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swMonospaced = view.findViewById(R.id.swMonospaced);
swTextColor = view.findViewById(R.id.swTextColor);
swTextSize = view.findViewById(R.id.swTextSize);
swTextAlign = view.findViewById(R.id.swTextAlign);
swCollapseQuotes = view.findViewById(R.id.swCollapseQuotes);
swImagesInline = view.findViewById(R.id.swImagesInline);
swAttachmentsAlt = view.findViewById(R.id.swAttachmentsAlt);
@@ -602,6 +604,13 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}
});
swTextAlign.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("text_align", checked).apply();
}
});
swCollapseQuotes.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -776,6 +785,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swMonospaced.setChecked(prefs.getBoolean("monospaced", false));
swTextColor.setChecked(prefs.getBoolean("text_color", true));
swTextSize.setChecked(prefs.getBoolean("text_size", true));
swTextAlign.setChecked(prefs.getBoolean("text_align", true));
swCollapseQuotes.setChecked(prefs.getBoolean("collapse_quotes", false));
swImagesInline.setChecked(prefs.getBoolean("inline_images", false));
swAttachmentsAlt.setChecked(prefs.getBoolean("attachments_alt", false));