mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-21 23:32:51 +00:00
Keyword improvements
This commit is contained in:
parent
11da34bff4
commit
1d1f087b7a
2 changed files with 14 additions and 2 deletions
|
@ -86,9 +86,11 @@ public class FragmentDialogKeywordManage extends FragmentDialogBase {
|
|||
String global = prefs.getString("global_keywords", null);
|
||||
if (global != null) {
|
||||
List<String> available = new ArrayList<>();
|
||||
available.addAll(Arrays.asList(global.split(" ")));
|
||||
if (data.available != null)
|
||||
available.addAll(Arrays.asList(data.available));
|
||||
for (String kw : global.split(" "))
|
||||
if (!available.contains(kw))
|
||||
available.add(kw);
|
||||
data.available = available.toArray(new String[0]);
|
||||
}
|
||||
|
||||
|
|
|
@ -5229,7 +5229,17 @@ public class FragmentMessages extends FragmentBase
|
|||
available.add(kw);
|
||||
}
|
||||
|
||||
Collections.sort(available);
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
String global = prefs.getString("global_keywords", null);
|
||||
if (global != null)
|
||||
for (String kw : global.split(" "))
|
||||
if (!available.contains(kw))
|
||||
available.add(kw);
|
||||
|
||||
final Collator collator = Collator.getInstance(Locale.getDefault());
|
||||
collator.setStrength(Collator.SECONDARY); // Case insensitive, process accents etc
|
||||
|
||||
Collections.sort(available, collator);
|
||||
|
||||
return new Pair<>(selected, available);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue