Added option to swap sender and subject

pull/161/head
M66B 6 years ago
parent 426a3cfb07
commit 7430b63444

@ -182,6 +182,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private boolean date; private boolean date;
private boolean threading; private boolean threading;
private boolean name_email; private boolean name_email;
private boolean subject_top;
private boolean subject_italic; private boolean subject_italic;
private boolean flags; private boolean flags;
private boolean preview; private boolean preview;
@ -341,7 +342,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ivExpander = itemView.findViewById(R.id.ivExpander); ivExpander = itemView.findViewById(R.id.ivExpander);
ivFlagged = itemView.findViewById(R.id.ivFlagged); ivFlagged = itemView.findViewById(R.id.ivFlagged);
ivAvatar = itemView.findViewById(R.id.ivAvatar); ivAvatar = itemView.findViewById(R.id.ivAvatar);
tvFrom = itemView.findViewById(R.id.tvFrom); tvFrom = itemView.findViewById(subject_top ? R.id.tvSubject : R.id.tvFrom);
tvSize = itemView.findViewById(R.id.tvSize); tvSize = itemView.findViewById(R.id.tvSize);
tvTime = itemView.findViewById(R.id.tvTime); tvTime = itemView.findViewById(R.id.tvTime);
ivType = itemView.findViewById(R.id.ivType); ivType = itemView.findViewById(R.id.ivType);
@ -352,7 +353,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ivPlain = itemView.findViewById(R.id.ivPlain); ivPlain = itemView.findViewById(R.id.ivPlain);
ivReceipt = itemView.findViewById(R.id.ivReceipt); ivReceipt = itemView.findViewById(R.id.ivReceipt);
ivAttachments = itemView.findViewById(R.id.ivAttachments); ivAttachments = itemView.findViewById(R.id.ivAttachments);
tvSubject = itemView.findViewById(R.id.tvSubject); tvSubject = itemView.findViewById(subject_top ? R.id.tvFrom : R.id.tvSubject);
tvPreview = itemView.findViewById(R.id.tvPreview); tvPreview = itemView.findViewById(R.id.tvPreview);
tvFolder = itemView.findViewById(R.id.tvFolder); tvFolder = itemView.findViewById(R.id.tvFolder);
tvCount = itemView.findViewById(R.id.tvCount); tvCount = itemView.findViewById(R.id.tvCount);
@ -3010,6 +3011,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
this.date = prefs.getBoolean("date", true); this.date = prefs.getBoolean("date", true);
this.threading = prefs.getBoolean("threading", true); this.threading = prefs.getBoolean("threading", true);
this.name_email = prefs.getBoolean("name_email", !compact); this.name_email = prefs.getBoolean("name_email", !compact);
this.subject_top = prefs.getBoolean("subject_top", false);
this.subject_italic = prefs.getBoolean("subject_italic", true); this.subject_italic = prefs.getBoolean("subject_italic", true);
this.flags = prefs.getBoolean("flags", true); this.flags = prefs.getBoolean("flags", true);
this.preview = prefs.getBoolean("preview", false); this.preview = prefs.getBoolean("preview", false);

@ -38,8 +38,10 @@ public class FragmentOptions extends FragmentBase {
private PagerAdapter adapter; private PagerAdapter adapter;
static String[] OPTIONS_RESTART = new String[]{ static String[] OPTIONS_RESTART = new String[]{
"startup", "cards", "date", "threading", "highlight_unread", "avatars", "generated_icons", "identicons", "circular", "name_email", "subject_italic", "flags", "preview", "preview_italic", "startup", "cards", "date", "threading", "highlight_unread", "avatars", "generated_icons", "identicons", "circular",
"addresses", "attachments_alt", "contrast", "monospaced", "inline_images", "contact_images", "all_images", "collapse_quotes", "autocontent", "actionbar", "name_email", "subject_top", "subject_italic", "flags", "preview", "preview_italic",
"addresses", "attachments_alt", "contrast", "monospaced", "inline_images",
"contact_images", "all_images", "collapse_quotes", "autocontent", "actionbar",
"autoscroll", "swipenav", "autoexpand", "autoclose", "onclose", "autoscroll", "swipenav", "autoexpand", "autoclose", "onclose",
"subscriptions", "debug", "subscriptions", "debug",
"biometrics" "biometrics"

@ -53,6 +53,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private SwitchCompat swIdenticons; private SwitchCompat swIdenticons;
private SwitchCompat swCircular; private SwitchCompat swCircular;
private SwitchCompat swNameEmail; private SwitchCompat swNameEmail;
private SwitchCompat swSubjectTop;
private SwitchCompat swSubjectItalic; private SwitchCompat swSubjectItalic;
private SwitchCompat swFlags; private SwitchCompat swFlags;
private SwitchCompat swPreview; private SwitchCompat swPreview;
@ -70,7 +71,8 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private SwitchCompat swActionbar; private SwitchCompat swActionbar;
private final static String[] RESET_OPTIONS = new String[]{ private final static String[] RESET_OPTIONS = new String[]{
"theme", "startup", "cards", "date", "threading", "highlight_unread", "avatars", "generated_icons", "identicons", "circular", "name_email", "subject_italic", "theme", "startup", "cards", "date", "threading", "highlight_unread",
"avatars", "generated_icons", "identicons", "circular", "name_email", "subject_top", "subject_italic",
"flags", "preview", "preview_italic", "addresses", "attachments_alt", "flags", "preview", "preview_italic", "addresses", "attachments_alt",
"contrast", "monospaced", "inline_images", "contact_images", "all_images", "collapse_quotes", "autocontent", "actionbar", "contrast", "monospaced", "inline_images", "contact_images", "all_images", "collapse_quotes", "autocontent", "actionbar",
}; };
@ -96,6 +98,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swIdenticons = view.findViewById(R.id.swIdenticons); swIdenticons = view.findViewById(R.id.swIdenticons);
swCircular = view.findViewById(R.id.swCircular); swCircular = view.findViewById(R.id.swCircular);
swNameEmail = view.findViewById(R.id.swNameEmail); swNameEmail = view.findViewById(R.id.swNameEmail);
swSubjectTop = view.findViewById(R.id.swSubjectTop);
swSubjectItalic = view.findViewById(R.id.swSubjectItalic); swSubjectItalic = view.findViewById(R.id.swSubjectItalic);
swFlags = view.findViewById(R.id.swFlags); swFlags = view.findViewById(R.id.swFlags);
swPreview = view.findViewById(R.id.swPreview); swPreview = view.findViewById(R.id.swPreview);
@ -205,6 +208,13 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
} }
}); });
swSubjectTop.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("subject_top", checked).apply();
}
});
swSubjectItalic.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { swSubjectItalic.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -369,6 +379,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swIdenticons.setEnabled(swGeneratedIcons.isChecked()); swIdenticons.setEnabled(swGeneratedIcons.isChecked());
swCircular.setChecked(prefs.getBoolean("circular", true)); swCircular.setChecked(prefs.getBoolean("circular", true));
swNameEmail.setChecked(prefs.getBoolean("name_email", !compact)); swNameEmail.setChecked(prefs.getBoolean("name_email", !compact));
swSubjectTop.setChecked(prefs.getBoolean("subject_top", false));
swSubjectItalic.setChecked(prefs.getBoolean("subject_italic", true)); swSubjectItalic.setChecked(prefs.getBoolean("subject_italic", true));
swFlags.setChecked(prefs.getBoolean("flags", true)); swFlags.setChecked(prefs.getBoolean("flags", true));
swPreview.setChecked(prefs.getBoolean("preview", false)); swPreview.setChecked(prefs.getBoolean("preview", false));

@ -181,6 +181,18 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swNameEmail" /> app:layout_constraintTop_toBottomOf="@id/swNameEmail" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swSubjectTop"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_subject_top"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvNameEmailHint"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat
android:id="@+id/swSubjectItalic" android:id="@+id/swSubjectItalic"
android:layout_width="0dp" android:layout_width="0dp"
@ -190,7 +202,7 @@
android:text="@string/title_advanced_subject_italic" android:text="@string/title_advanced_subject_italic"
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/tvNameEmailHint" app:layout_constraintTop_toBottomOf="@id/swSubjectTop"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat

@ -235,6 +235,7 @@
<string name="title_advanced_identicons">Show identicons</string> <string name="title_advanced_identicons">Show identicons</string>
<string name="title_advanced_circular">Show round icons</string> <string name="title_advanced_circular">Show round icons</string>
<string name="title_advanced_name_email">Show names and email addresses</string> <string name="title_advanced_name_email">Show names and email addresses</string>
<string name="title_advanced_subject_top">Show subject above sender</string>
<string name="title_advanced_subject_italic">Show subject in italics</string> <string name="title_advanced_subject_italic">Show subject in italics</string>
<string name="title_advanced_flags">Show stars</string> <string name="title_advanced_flags">Show stars</string>
<string name="title_advanced_preview">Show message preview</string> <string name="title_advanced_preview">Show message preview</string>

Loading…
Cancel
Save