Added sort on size

pull/153/head
M66B 6 years ago
parent 13876c588c
commit ad1644bf68

@ -73,6 +73,7 @@ public interface DaoMessage {
" WHEN 'starred' = :sort THEN COUNT(message.id) - " + unflagged_unified + " = 0" +
" WHEN 'sender' = :sort THEN LOWER(message.sender)" +
" WHEN 'subject' = :sort THEN LOWER(message.subject)" +
" WHEN 'size' = :sort THEN -SUM(message.size)" +
" ELSE 0" +
" END, message.received DESC")
@SuppressWarnings(RoomWarnings.CURSOR_MISMATCH)
@ -115,6 +116,7 @@ public interface DaoMessage {
" WHEN 'starred' = :sort THEN COUNT(message.id) - " + unflagged_folder + " = 0" +
" WHEN 'sender' = :sort THEN LOWER(message.sender)" +
" WHEN 'subject' = :sort THEN LOWER(message.subject)" +
" WHEN 'size' = :sort THEN -SUM(message.size)" +
" ELSE 0" +
" END, message.received DESC")
@SuppressWarnings(RoomWarnings.CURSOR_MISMATCH)

@ -1949,6 +1949,8 @@ public class FragmentMessages extends FragmentBase {
menu.findItem(R.id.menu_sort_on_sender).setChecked(true);
else if ("subject".equals(sort))
menu.findItem(R.id.menu_sort_on_subject).setChecked(true);
else if ("size".equals(sort))
menu.findItem(R.id.menu_sort_on_size).setChecked(true);
menu.findItem(R.id.menu_zoom).setVisible(!selection);
@ -1998,6 +2000,11 @@ public class FragmentMessages extends FragmentBase {
onMenuSort("subject");
return true;
case R.id.menu_sort_on_size:
item.setChecked(true);
onMenuSort("size");
return true;
case R.id.menu_zoom:
onMenuZoom();
return true;

@ -37,6 +37,9 @@
<item
android:id="@+id/menu_sort_on_subject"
android:title="@string/title_sort_on_subject" />
<item
android:id="@+id/menu_sort_on_size"
android:title="@string/title_sort_on_size" />
</group>
</menu>
</item>

@ -432,6 +432,7 @@
<string name="title_sort_on_starred">Starred</string>
<string name="title_sort_on_sender">Sender</string>
<string name="title_sort_on_subject">Subject</string>
<string name="title_sort_on_size">Size</string>
<string name="title_compact">Compact view</string>
<string name="title_zoom">Text size</string>

Loading…
Cancel
Save