Removed options for message action button

This commit is contained in:
M66B 2020-06-24 20:28:16 +02:00
parent 3767cd121d
commit 813e193b64
5 changed files with 11 additions and 79 deletions

2
FAQ.md
View File

@ -2623,7 +2623,7 @@ Reformatting and displaying such messages will take too long. You can try to use
<a name="faq125"></a>
**(125) What are the current experimental features?**
* ~~Custom rendering of reformatted messages~~
* Showing an icon button to create a rule for a message
<br />

View File

@ -1530,29 +1530,27 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
message.uid == null || message.accountProtocol == EntityAccount.TYPE_POP);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean button_archive_trash = prefs.getBoolean("button_archive_trash", true);
boolean button_move = prefs.getBoolean("button_move", true);
boolean button_rule = prefs.getBoolean("button_rule", false);
boolean experiments = prefs.getBoolean("experiments", false);
boolean expand_all = prefs.getBoolean("expand_all", false);
boolean expand_one = prefs.getBoolean("expand_one", true);
boolean tools = prefs.getBoolean("message_tools", true);
ibTrash.setTag(delete);
ibRule.setVisibility(tools && button_rule && !outbox &&
ibRule.setVisibility(tools && experiments && !outbox &&
message.accountProtocol == EntityAccount.TYPE_IMAP ? View.VISIBLE : View.GONE);
ibUnsubscribe.setVisibility(!tools || message.unsubscribe == null ? View.GONE : View.VISIBLE);
ibAnswer.setVisibility(!tools || outbox || (!expand_all && expand_one) ? View.GONE : View.VISIBLE);
ibMove.setVisibility(tools && move && button_move ? View.VISIBLE : View.GONE);
ibArchive.setVisibility(tools && archive && button_archive_trash ? View.VISIBLE : View.GONE);
ibTrash.setVisibility(tools && trash && button_archive_trash ? View.VISIBLE : View.GONE);
ibMove.setVisibility(tools && move ? View.VISIBLE : View.GONE);
ibArchive.setVisibility(tools && archive ? View.VISIBLE : View.GONE);
ibTrash.setVisibility(tools && trash ? View.VISIBLE : View.GONE);
ibJunk.setVisibility(tools && junk ? View.VISIBLE : View.GONE);
ibInbox.setVisibility(tools && inbox ? View.VISIBLE : View.GONE);
ibTools.setImageLevel(tools ? 0 : 1);
ibTools.setVisibility(View.VISIBLE);
ibTrashBottom.setVisibility(tools && trash && button_archive_trash ? View.VISIBLE : View.GONE);
ibArchiveBottom.setVisibility(tools && archive && button_archive_trash ? View.VISIBLE : View.GONE);
ibTrashBottom.setVisibility(tools && trash ? View.VISIBLE : View.GONE);
ibArchiveBottom.setVisibility(tools && archive ? View.VISIBLE : View.GONE);
if (bind)
bindBody(message, scroll);

View File

@ -84,7 +84,7 @@ public class FragmentOptions extends FragmentBase {
"name_email", "prefer_contact", "distinguish_contacts", "show_recipients", "authentication",
"subject_top", "font_size_sender", "font_size_subject", "subject_italic", "highlight_subject", "subject_ellipsize",
"keywords_header", "flags", "flags_background", "preview", "preview_italic", "preview_lines",
"addresses", "button_archive_trash", "button_move", "button_rule", "attachments_alt",
"addresses", "attachments_alt",
"contrast", "monospaced", "text_color", "text_size",
"inline_images", "collapse_quotes", "seekbar", "actionbar", "actionbar_color", "navbar_colorize",
"autoscroll", "swipenav", "autoexpand", "autoclose", "onclose",

View File

@ -102,9 +102,6 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private Spinner spPreviewLines;
private SwitchCompat swAddresses;
private SwitchCompat swArchiveTrash;
private SwitchCompat swMove;
private SwitchCompat swRule;
private SwitchCompat swContrast;
private SwitchCompat swMonospaced;
@ -127,7 +124,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
"subject_top", "font_size_sender", "font_size_subject", "subject_italic", "highlight_subject", "subject_ellipsize",
"keywords_header", "flags", "flags_background",
"preview", "preview_italic", "preview_lines",
"addresses", "button_archive_trash", "button_move", "button_rule",
"addresses",
"contrast", "monospaced", "text_color", "text_size", "text_align",
"inline_images", "collapse_quotes", "attachments_alt",
"parse_classes", "authentication"
@ -189,9 +186,6 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swPreviewItalic = view.findViewById(R.id.swPreviewItalic);
spPreviewLines = view.findViewById(R.id.spPreviewLines);
swAddresses = view.findViewById(R.id.swAddresses);
swArchiveTrash = view.findViewById(R.id.swArchiveTrash);
swMove = view.findViewById(R.id.swMove);
swRule = view.findViewById(R.id.swRule);
swContrast = view.findViewById(R.id.swContrast);
swMonospaced = view.findViewById(R.id.swMonospaced);
swTextColor = view.findViewById(R.id.swTextColor);
@ -584,27 +578,6 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}
});
swArchiveTrash.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("button_archive_trash", checked).apply();
}
});
swMove.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("button_move", checked).apply();
}
});
swRule.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("button_rule", checked).apply();
}
});
swContrast.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -811,9 +784,6 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
spPreviewLines.setSelection(prefs.getInt("preview_lines", 2) - 1);
spPreviewLines.setEnabled(swPreview.isChecked());
swAddresses.setChecked(prefs.getBoolean("addresses", false));
swArchiveTrash.setChecked(prefs.getBoolean("button_archive_trash", true));
swMove.setChecked(prefs.getBoolean("button_move", true));
swRule.setChecked(prefs.getBoolean("button_rule", false));
swContrast.setChecked(prefs.getBoolean("contrast", false));
swMonospaced.setChecked(prefs.getBoolean("monospaced", false));
swTextColor.setChecked(prefs.getBoolean("text_color", true));

View File

@ -776,42 +776,6 @@
app:layout_constraintTop_toBottomOf="@id/tvCaptionBody"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swArchiveTrash"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_archive_trash"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swAddresses"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swMove"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_move"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swArchiveTrash"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swRule"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_create_rule"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swMove"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swContrast"
android:layout_width="0dp"
@ -820,7 +784,7 @@
android:text="@string/title_advanced_contrast"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swRule"
app:layout_constraintTop_toBottomOf="@id/swAddresses"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat