Added option to disable stars

pull/152/head
M66B 6 years ago
parent d97c7fcc05
commit e71f6d5db1

@ -238,6 +238,7 @@ In the display section of the advanced settings you can enable or disable:
* *Conversation threading*: to disable conversation threading and to show individual messages instead
* *Show contact photos*: to hide contact photos
* *Show identicons*: to show generated contact avatars
* *Show stars*: to hide stars (favorites)
* *Show message preview*: to show two lines of the message text
* *Show address details by default*: to collapse the addresses section by default
* *Conversation action bar*: to disable the bottom navigation bar

@ -143,6 +143,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private boolean contacts;
private boolean search;
private boolean avatars;
private boolean flags;
private boolean preview;
private boolean autohtml;
private boolean autoimages;
@ -693,7 +694,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
int flagged = (message.count - message.unflagged);
ivFlagged.setImageResource(flagged > 0 ? R.drawable.baseline_star_24 : R.drawable.baseline_star_border_24);
ivFlagged.setImageTintList(ColorStateList.valueOf(flagged > 0 ? colorAccent : textColorSecondary));
ivFlagged.setVisibility(message.uid == null ? View.INVISIBLE : View.VISIBLE);
ivFlagged.setVisibility(flags ? (message.uid == null ? View.INVISIBLE : View.VISIBLE) : View.GONE);
}
private void bindContactInfo(ContactInfo info, TupleMessageEx message) {
@ -2667,6 +2668,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
PackageManager.COMPONENT_ENABLED_STATE_ENABLED);
this.avatars = (prefs.getBoolean("avatars", true) ||
prefs.getBoolean("identicons", false));
this.flags = prefs.getBoolean("flags", true);
this.preview = prefs.getBoolean("preview", false);
this.autohtml = prefs.getBoolean("autohtml", false);
this.autoimages = (!this.autohtml && prefs.getBoolean("autoimages", false));

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

@ -339,6 +339,31 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swNameEmail" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swFlags"
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_flags"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvNameEmailHint"
app:switchPadding="12dp" />
<TextView
android:id="@+id/tvFlagsHint"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginEnd="60dp"
android:text="@string/title_advanced_flags_hint"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swFlags" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swPreview"
android:layout_width="match_parent"
@ -348,7 +373,7 @@
android:layout_marginEnd="12dp"
android:text="@string/title_advanced_preview"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvNameEmailHint"
app:layout_constraintTop_toBottomOf="@id/tvFlagsHint"
app:switchPadding="12dp" />
<TextView

@ -157,6 +157,7 @@
<string name="title_advanced_avatars">Show contact photos</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_flags">Show stars (favorites)</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_html">Automatically show original message for known contacts</string>
@ -188,6 +189,7 @@
<string name="title_advanced_unified_hint">Show unified inbox folders or unified inbox messages</string>
<string name="title_advanced_threading_hint">Group messages related to each other</string>
<string name="title_advanced_name_email_hint">When disabled only names will be shown when available</string>
<string name="title_advanced_flags_hint">Note that starred messages will always be kept locally</string>
<string name="title_advanced_autoexpand_hint">Automatically open message when there is just one message or just one unread message in a conversation</string>
<string name="title_advanced_autocollapse_hint">Multiple expanded messages will always be closed on \'back\'</string>
<string name="title_advanced_autoclose_hint">Automatically close conversations when all messages are archived, sent or trashed</string>

Loading…
Cancel
Save