Use subject for conversation actrions

pull/177/head
M66B 5 years ago
parent adb892cfc2
commit 9ca688b35f

@ -2054,6 +2054,17 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ZonedDateTime dt = new Date(message.received) ZonedDateTime dt = new Date(message.received)
.toInstant() .toInstant()
.atZone(ZoneId.systemDefault()); .atZone(ZoneId.systemDefault());
List<ConversationActions.Message> input = new ArrayList<>();
if (!TextUtils.isEmpty(message.subject))
input.add(new ConversationActions.Message.Builder(person)
.setReferenceTime(dt)
.setText(message.subject)
.build());
input.add(new ConversationActions.Message.Builder(person)
.setReferenceTime(dt)
.setText(document.text())
.build());
Set<String> included = Collections.unmodifiableSet( Set<String> included = Collections.unmodifiableSet(
new HashSet<>(Arrays.asList( new HashSet<>(Arrays.asList(
ConversationAction.TYPE_TEXT_REPLY ConversationAction.TYPE_TEXT_REPLY
@ -2063,14 +2074,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ConversationAction.TYPE_OPEN_URL, ConversationAction.TYPE_OPEN_URL,
ConversationAction.TYPE_SEND_EMAIL 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)
.setText(document.text())
.build();
TextClassifier.EntityConfig config = TextClassifier.EntityConfig config =
new TextClassifier.EntityConfig.Builder() new TextClassifier.EntityConfig.Builder()
//.setIncludedTypes(included) //.setIncludedTypes(included)
@ -2078,8 +2081,13 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
//.includeTypesFromTextClassifier(false) //.includeTypesFromTextClassifier(false)
//.setHints(included) //.setHints(included)
.build(); .build();
List<String> hints = Collections.unmodifiableList(Arrays.asList(
ConversationActions.Request.HINT_FOR_IN_APP
));
ConversationActions.Request crequest = ConversationActions.Request crequest =
new ConversationActions.Request.Builder(Arrays.asList(cmessage)) new ConversationActions.Request.Builder(input)
.setTypeConfig(config) .setTypeConfig(config)
.setHints(hints) .setHints(hints)
.build(); .build();

Loading…
Cancel
Save