Added settings to show subject normal

This commit is contained in:
M66B 2019-03-09 07:36:45 +00:00
parent 037445a319
commit 2ba77f3b5e
5 changed files with 31 additions and 4 deletions

2
FAQ.md
View File

@ -238,6 +238,8 @@ In the display section of the advanced options you can enable or disable:
* *Conversation threading*: to disable conversation threading and to show individual messages instead * *Conversation threading*: to disable conversation threading and to show individual messages instead
* *Show contact photos*: to hide contact photos * *Show contact photos*: to hide contact photos
* *Show identicons*: to show generated contact avatars * *Show identicons*: to show generated contact avatars
* *Show names and email addresses*: to show names or to show names and email addresses
* *Show subject italic*: to show the message subject as normal text
* *Show stars*: to hide stars (favorites) * *Show stars*: to hide stars (favorites)
* *Show message preview*: to show two lines of the message text * *Show message preview*: to show two lines of the message text
* *Show address details by default*: to collapse the addresses section by default * *Show address details by default*: to collapse the addresses section by default

View File

@ -141,6 +141,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private ViewType viewType; private ViewType viewType;
private boolean compact; private boolean compact;
private boolean name_email; private boolean name_email;
private boolean subject_italic;
private int zoom; private int zoom;
private String sort; private String sort;
private boolean internet; private boolean internet;
@ -544,7 +545,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
tvFrom.setTypeface(null, typeface); tvFrom.setTypeface(null, typeface);
tvSize.setTypeface(null, typeface); tvSize.setTypeface(null, typeface);
tvTime.setTypeface(null, typeface); tvTime.setTypeface(null, typeface);
tvSubject.setTypeface(null, typeface | Typeface.ITALIC); tvSubject.setTypeface(null, typeface | (subject_italic ? Typeface.ITALIC : 0));
tvCount.setTypeface(null, typeface); tvCount.setTypeface(null, typeface);
int colorUnseen = (message.unseen > 0 ? colorUnread : textColorSecondary); int colorUnseen = (message.unseen > 0 ? colorUnread : textColorSecondary);
@ -2819,6 +2820,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
this.viewType = viewType; this.viewType = viewType;
this.compact = compact; this.compact = compact;
this.name_email = prefs.getBoolean("name_email", !compact); this.name_email = prefs.getBoolean("name_email", !compact);
this.subject_italic = prefs.getBoolean("subject_italic", true);
this.zoom = zoom; this.zoom = zoom;
this.sort = sort; this.sort = sort;
this.internet = Helper.suitableNetwork(context, false); this.internet = Helper.suitableNetwork(context, false);

View File

@ -78,6 +78,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
private SwitchCompat swAvatars; private SwitchCompat swAvatars;
private SwitchCompat swIdenticons; private SwitchCompat swIdenticons;
private SwitchCompat swNameEmail; private SwitchCompat swNameEmail;
private SwitchCompat swSubjectItalic;
private SwitchCompat swFlags; private SwitchCompat swFlags;
private SwitchCompat swPreview; private SwitchCompat swPreview;
private SwitchCompat swAddresses; private SwitchCompat swAddresses;
@ -108,7 +109,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
private Group grpNotification; private Group grpNotification;
static String[] OPTIONS_RESTART = new String[]{ static String[] OPTIONS_RESTART = new String[]{
"unified", "date", "threading", "avatars", "identicons", "name_email", "flags", "preview", "addresses", "autoimages", "actionbar", "unified", "date", "threading", "avatars", "identicons", "name_email", "subject_italic", "flags", "preview", "addresses", "autoimages", "actionbar",
"pull", "swipenav", "autoexpand", "autoclose", "autonext", "pull", "swipenav", "autoexpand", "autoclose", "autonext",
"debug" "debug"
}; };
@ -116,7 +117,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
private final static String[] ADVANCED_OPTIONS = new String[]{ private final static String[] ADVANCED_OPTIONS = new String[]{
"enabled", "schedule_start", "schedule_end", "enabled", "schedule_start", "schedule_end",
"metered", "download", "metered", "download",
"unified", "date", "threading", "avatars", "identicons", "name_email", "flags", "preview", "addresses", "autoimages", "actionbar", "unified", "date", "threading", "avatars", "identicons", "name_email", "subject_italic", "flags", "preview", "addresses", "autoimages", "actionbar",
"pull", "swipenav", "autoexpand", "autoclose", "autonext", "collapse", "autoread", "automove", "pull", "swipenav", "autoexpand", "autoclose", "autonext", "collapse", "autoread", "automove",
"autoresize", "sender", "autosend", "autoresize", "sender", "autosend",
"notify_preview", "search_local", "light", "sound", "notify_preview", "search_local", "light", "sound",
@ -149,6 +150,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
swAvatars = view.findViewById(R.id.swAvatars); swAvatars = view.findViewById(R.id.swAvatars);
swIdenticons = view.findViewById(R.id.swIdenticons); swIdenticons = view.findViewById(R.id.swIdenticons);
swNameEmail = view.findViewById(R.id.swNameEmail); swNameEmail = view.findViewById(R.id.swNameEmail);
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);
swAddresses = view.findViewById(R.id.swAddresses); swAddresses = view.findViewById(R.id.swAddresses);
@ -314,6 +316,13 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
} }
}); });
swSubjectItalic.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("subject_italic", checked).apply();
}
});
swFlags.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { swFlags.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -562,6 +571,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
swAvatars.setChecked(prefs.getBoolean("avatars", true)); swAvatars.setChecked(prefs.getBoolean("avatars", true));
swIdenticons.setChecked(prefs.getBoolean("identicons", false)); swIdenticons.setChecked(prefs.getBoolean("identicons", false));
swNameEmail.setChecked(prefs.getBoolean("name_email", !compact)); swNameEmail.setChecked(prefs.getBoolean("name_email", !compact));
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));
swAddresses.setChecked(prefs.getBoolean("addresses", true)); swAddresses.setChecked(prefs.getBoolean("addresses", true));

View File

@ -329,6 +329,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/swSubjectItalic"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="12dp"
android:text="@string/title_advanced_subject_italic"
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/swFlags" android:id="@+id/swFlags"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -338,7 +350,7 @@
android:layout_marginEnd="12dp" android:layout_marginEnd="12dp"
android:text="@string/title_advanced_flags" android:text="@string/title_advanced_flags"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvNameEmailHint" app:layout_constraintTop_toBottomOf="@id/swSubjectItalic"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<TextView <TextView

View File

@ -158,6 +158,7 @@
<string name="title_advanced_avatars">Show contact photos</string> <string name="title_advanced_avatars">Show contact photos</string>
<string name="title_advanced_identicons">Show identicons</string> <string name="title_advanced_identicons">Show identicons</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_italic">Show subject italic</string>
<string name="title_advanced_flags">Show stars (favorites)</string> <string name="title_advanced_flags">Show stars (favorites)</string>
<string name="title_advanced_preview">Show message preview</string> <string name="title_advanced_preview">Show message preview</string>
<string name="title_advanced_addresses">Show address details by default</string> <string name="title_advanced_addresses">Show address details by default</string>