Added option to disable quick actions

pull/211/head
M66B 2 years ago
parent aa519d0b6c
commit bfed7f9a53

@ -360,6 +360,7 @@ public class FragmentMessages extends FragmentBase
private boolean quick_scroll;
private boolean addresses;
private boolean swipe_reply;
private boolean quick_actions;
private int colorPrimary;
private int colorAccent;
@ -503,6 +504,7 @@ public class FragmentMessages extends FragmentBase
quick_scroll = prefs.getBoolean("quick_scroll", true);
addresses = prefs.getBoolean("addresses", false);
swipe_reply = prefs.getBoolean("swipe_reply", false);
quick_actions = prefs.getBoolean("quick_actions", true);
colorPrimary = Helper.resolveColor(getContext(), R.attr.colorPrimary);
colorAccent = Helper.resolveColor(getContext(), R.attr.colorAccent);
@ -6275,6 +6277,7 @@ public class FragmentMessages extends FragmentBase
tvSelectedCount.setCompoundDrawablesRelative(null, null, null, null);
tvSelectedCount.setVisibility(View.VISIBLE);
if (quick_actions) {
Bundle args = new Bundle();
args.putLongArray("ids", selection);
args.putBoolean("threading", threading);
@ -6406,6 +6409,7 @@ public class FragmentMessages extends FragmentBase
Log.unexpectedError(getParentFragmentManager(), ex);
}
}.serial().setId("messages:" + FragmentMessages.this.hashCode()).execute(this, args, "quickactions");
}
} else {
fabMore.hide();
tvSelectedCount.setVisibility(View.GONE);

@ -149,7 +149,7 @@ public class FragmentOptions extends FragmentBase {
"autoscroll", "swipenav", "reversed", "swipe_close", "swipe_move", "autoexpand", "autoclose", "onclose",
"swipe_reply",
"language_detection",
"quick_filter", "quick_scroll",
"quick_filter", "quick_scroll", "quick_actions",
"experiments", "debug", "log_level", "test1", "test2", "test3", "test4", "test5",
"webview_legacy", "browser_zoom", "fake_dark",
"show_recent",

@ -72,6 +72,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
private SwitchCompat swAutoScroll;
private SwitchCompat swQuickFilter;
private SwitchCompat swQuickScroll;
private SwitchCompat swQuickActions;
private Button btnSwipes;
private SeekBar sbSwipeSensitivity;
private SwitchCompat swFolderNav;
@ -107,7 +108,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
private final static String[] RESET_OPTIONS = new String[]{
"restore_on_launch", "sync_on_launch", "double_back", "conversation_actions", "conversation_actions_replies", "language_detection",
"photo_picker", "default_snooze",
"pull", "autoscroll", "quick_filter", "quick_scroll", "swipe_sensitivity", "foldernav",
"pull", "autoscroll", "quick_filter", "quick_scroll", "quick_actions", "swipe_sensitivity", "foldernav",
"doubletap", "swipenav", "volumenav", "reversed", "swipe_close", "swipe_move",
"autoexpand", "expand_first", "expand_all", "expand_one", "collapse_multiple",
"autoclose", "onclose", "autoclose_unseen", "collapse_marked",
@ -140,6 +141,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
swAutoScroll = view.findViewById(R.id.swAutoScroll);
swQuickFilter = view.findViewById(R.id.swQuickFilter);
swQuickScroll = view.findViewById(R.id.swQuickScroll);
swQuickActions = view.findViewById(R.id.swQuickActions);
btnSwipes = view.findViewById(R.id.btnSwipes);
sbSwipeSensitivity = view.findViewById(R.id.sbSwipeSensitivity);
swFolderNav = view.findViewById(R.id.swFolderNav);
@ -289,6 +291,13 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
}
});
swQuickActions.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("quick_actions", checked).apply();
}
});
btnSwipes.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -574,6 +583,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
swAutoScroll.setChecked(prefs.getBoolean("autoscroll", false));
swQuickFilter.setChecked(prefs.getBoolean("quick_filter", false));
swQuickScroll.setChecked(prefs.getBoolean("quick_scroll", true));
swQuickActions.setChecked(prefs.getBoolean("quick_actions", true));
int swipe_sensitivity = prefs.getInt("swipe_sensitivity", DEFAULT_SWIPE_SENSITIVITY);
sbSwipeSensitivity.setProgress(swipe_sensitivity);

@ -296,6 +296,18 @@
app:layout_constraintTop_toBottomOf="@id/swQuickFilter"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swQuickActions"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:enabled="true"
android:text="@string/title_advanced_quick_actions"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swQuickScroll"
app:switchPadding="12dp" />
<Button
android:id="@+id/btnSwipes"
style="?android:attr/buttonStyleSmall"
@ -307,7 +319,7 @@
android:tag="disable"
android:text="@string/title_advanced_swipe_actions"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swQuickScroll" />
app:layout_constraintTop_toBottomOf="@id/swQuickActions" />
<TextView
android:id="@+id/tvSwipeSensitivity"

@ -639,6 +639,7 @@
<string name="title_advanced_undo">Undo timeout</string>
<string name="title_advanced_quick_filter">Show non-obtrusive quick filter icons</string>
<string name="title_advanced_quick_scroll">Show non-obtrusive quick scroll up/down icons</string>
<string name="title_advanced_quick_actions">Show quick actions when messages are selected</string>
<string name="title_advanced_folder_nav">Always go back to the folder list from a message list</string>
<string name="title_advanced_autoread">Automatically mark messages read on moving messages</string>
<string name="title_advanced_star_snoozed">Automatically add star on snoozing messages</string>

Loading…
Cancel
Save