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); with_attachments);
} }
String getTitle() { String getTitle(Context context) {
return query + List<String> flags = new ArrayList<>();
(with_unseen ? " ?" : "") + if (with_unseen)
(with_flagged ? " ★" : "") + flags.add(context.getString(R.string.title_search_flag_unseen));
(with_hidden ? " ∅" : "") + if (with_flagged)
(with_encrypted ? " ✗" : "") + flags.add(context.getString(R.string.title_search_flag_flagged));
(with_attachments ? " &" : ""); 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 @Override

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

@ -916,6 +916,12 @@
<string name="title_search_with_hidden">Hidden (on device only)</string> <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_encrypted">Encrypted (on device only)</string>
<string name="title_search_with_attachments">With attachments (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"> <string name="title_search_hint">
Searching will initially look at messages stored on your device. Searching will initially look at messages stored on your device.
To search the server too, tap on the "search again" button. To search the server too, tap on the "search again" button.

Loading…
Cancel
Save