Added quick snooze

pull/207/head
M66B 2 years ago
parent 9530ee0533
commit 157708e19f

@ -294,6 +294,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
private ImageButton ibLowImportance;
private ImageButton ibBatchSeen;
private ImageButton ibBatchFlag;
private ImageButton ibBatchSnooze;
private ImageButton ibInbox;
private ImageButton ibArchive;
private ImageButton ibJunk;
@ -566,6 +567,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
ibLowImportance = view.findViewById(R.id.ibLowImportance);
ibBatchSeen = view.findViewById(R.id.ibBatchSeen);
ibBatchFlag = view.findViewById(R.id.ibBatchFlag);
ibBatchSnooze = view.findViewById(R.id.ibBatchSnooze);
ibInbox = view.findViewById(R.id.ibInbox);
ibArchive = view.findViewById(R.id.ibArchive);
ibJunk = view.findViewById(R.id.ibJunk);
@ -1318,6 +1320,13 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
}
});
ibBatchSnooze.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onActionSnoozeSelection();
}
});
ibInbox.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
@ -1358,6 +1367,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
.setChecked(prefs.getBoolean("more_seen", false));
popupMenu.getMenu().findItem(R.id.menu_flag)
.setChecked(prefs.getBoolean("more_flag", false));
popupMenu.getMenu().findItem(R.id.menu_snooze)
.setChecked(prefs.getBoolean("more_snooze", false));
popupMenu.getMenu().findItem(R.id.menu_inbox)
.setChecked(prefs.getBoolean("more_inbox", true));
popupMenu.getMenu().findItem(R.id.menu_archive)
@ -1380,6 +1391,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
key = "more_seen";
else if (itemId == R.id.menu_flag)
key = "more_flag";
else if (itemId == R.id.menu_snooze)
key = "more_snooze";
else if (itemId == R.id.menu_inbox)
key = "more_inbox";
else if (itemId == R.id.menu_archive)
@ -5833,6 +5846,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
!EntityMessage.PRIORITIY_LOW.equals(result.importance));
boolean seen = (prefs.getBoolean("more_seen", false) && result.unseen);
boolean flag = (prefs.getBoolean("more_flag", false) && result.unflagged);
boolean snooze = (prefs.getBoolean("more_snooze", false));
boolean inbox = (prefs.getBoolean("more_inbox", true) && result.canInbox());
boolean archive = (prefs.getBoolean("more_archive", true) && result.canArchive());
boolean junk = (prefs.getBoolean("more_junk", true) && result.canJunk());
@ -5841,6 +5855,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
ibLowImportance.setVisibility(importance ? View.VISIBLE : View.GONE);
ibBatchSeen.setVisibility(seen ? View.VISIBLE : View.GONE);
ibBatchFlag.setVisibility(flag ? View.VISIBLE : View.GONE);
ibBatchSnooze.setVisibility(snooze ? View.VISIBLE : View.GONE);
ibInbox.setVisibility(inbox ? View.VISIBLE : View.GONE);
ibArchive.setVisibility(archive ? View.VISIBLE : View.GONE);
ibJunk.setVisibility(junk ? View.VISIBLE : View.GONE);

@ -558,6 +558,20 @@
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/twotone_star_24" />
<eu.faircode.email.FixedImageButton
android:id="@+id/ibBatchSnooze"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_snooze_now"
android:padding="6dp"
android:scaleType="fitCenter"
android:tint="@color/action_foreground"
android:tooltipText="@string/title_snooze_now"
app:layout_constraintEnd_toStartOf="@+id/ibBatchFlag"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/twotone_timelapse_24" />
<eu.faircode.email.FixedImageButton
android:id="@+id/ibInbox"
android:layout_width="48dp"
@ -568,7 +582,7 @@
android:scaleType="fitCenter"
android:tint="@color/action_foreground"
android:tooltipText="@string/title_folder_inbox"
app:layout_constraintEnd_toStartOf="@id/ibBatchFlag"
app:layout_constraintEnd_toStartOf="@id/ibBatchSnooze"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/twotone_inbox_24" />

@ -18,6 +18,12 @@
android:icon="@drawable/twotone_star_24"
android:title="@string/title_flag" />
<item
android:id="@+id/menu_snooze"
android:checkable="true"
android:icon="@drawable/twotone_timelapse_24"
android:title="@string/title_snooze_now" />
<item
android:id="@+id/menu_inbox"
android:checkable="true"

Loading…
Cancel
Save