1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-27 02:07:12 +00:00

Small improvement

This commit is contained in:
M66B 2020-03-19 10:22:34 +01:00
parent 058c52470c
commit 40eeec5eba

View file

@ -2032,11 +2032,18 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ZonedDateTime dt = new Date(message.received)
.toInstant()
.atZone(ZoneId.systemDefault());
Set<String> included = Collections.unmodifiableSet(
new HashSet<>(Arrays.asList(
ConversationAction.TYPE_TEXT_REPLY
)));
Set<String> excluded = Collections.unmodifiableSet(
new HashSet<>(Arrays.asList(
ConversationAction.TYPE_OPEN_URL,
ConversationAction.TYPE_SEND_EMAIL
)));
List<String> hints = Collections.unmodifiableList(Arrays.asList(
ConversationActions.Request.HINT_FOR_IN_APP
));
ConversationActions.Message cmessage =
new ConversationActions.Message.Builder(person)
.setReferenceTime(dt)
@ -2044,11 +2051,15 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
.build();
TextClassifier.EntityConfig config =
new TextClassifier.EntityConfig.Builder()
//.setIncludedTypes(included)
.setExcludedTypes(excluded)
//.includeTypesFromTextClassifier(false)
//.setHints(included)
.build();
ConversationActions.Request crequest =
new ConversationActions.Request.Builder(Arrays.asList(cmessage))
.setTypeConfig(config)
.setHints(hints)
.build();
return tcm.getTextClassifier().suggestConversationActions(crequest);