mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 12:44:42 +00:00
Added search flags
This commit is contained in:
parent
440832ff22
commit
b55442cc8d
3 changed files with 22 additions and 8 deletions
|
@ -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…
Reference in a new issue