Added search flags

pull/178/head
M66B 5 years ago
parent 440832ff22
commit b55442cc8d

@ -631,13 +631,21 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
with_attachments);
}
String getTitle() {
return query +
(with_unseen ? " ?" : "") +
(with_flagged ? " ★" : "") +
(with_hidden ? " ∅" : "") +
(with_encrypted ? " ✗" : "") +
(with_attachments ? " &" : "");
String getTitle(Context context) {
List<String> flags = new ArrayList<>();
if (with_unseen)
flags.add(context.getString(R.string.title_search_flag_unseen));
if (with_flagged)
flags.add(context.getString(R.string.title_search_flag_flagged));
if (with_hidden)
flags.add(context.getString(R.string.title_search_flag_hidden));
if (with_encrypted)
flags.add(context.getString(R.string.title_search_flag_encrypted));
if (with_attachments)
flags.add(context.getString(R.string.title_search_flag_attachments));
return (query == null ? "" : query)
+ (flags.size() > 0 ? " +" : "")
+ TextUtils.join(",", flags);
}
@Override

@ -3080,7 +3080,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
break;
case SEARCH:
setSubtitle(criteria.getTitle());
setSubtitle(criteria.getTitle(getContext()));
break;
}

@ -916,6 +916,12 @@
<string name="title_search_with_hidden">Hidden (on device only)</string>
<string name="title_search_with_encrypted">Encrypted (on device only)</string>
<string name="title_search_with_attachments">With attachments (on device only)</string>
<string name="title_search_flag_unseen">unread</string>
<string name="title_search_flag_flagged">starred</string>
<string name="title_search_flag_hidden">hidden</string>
<string name="title_search_flag_encrypted">encrypted</string>
<string name="title_search_flag_attachments">attachments</string>
<string name="title_search_hint">
Searching will initially look at messages stored on your device.
To search the server too, tap on the "search again" button.

Loading…
Cancel
Save