use of org.thoughtcrime.securesms.search.MessageResult in project Signal-Android by WhisperSystems.
the class ConversationListSearchAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(@NonNull SearchResultViewHolder holder, int position) {
ThreadRecord conversationResult = getConversationResult(position);
if (conversationResult != null) {
holder.bind(conversationResult, glideRequests, eventListener, locale, searchResult.getQuery());
return;
}
Recipient contactResult = getContactResult(position);
if (contactResult != null) {
holder.bind(contactResult, glideRequests, eventListener, locale, searchResult.getQuery());
return;
}
MessageResult messageResult = getMessageResult(position);
if (messageResult != null) {
holder.bind(messageResult, glideRequests, eventListener, locale, searchResult.getQuery());
}
}
use of org.thoughtcrime.securesms.search.MessageResult in project Signal-Android by WhisperSystems.
the class ConversationParentFragment method initializeSearchObserver.
private void initializeSearchObserver() {
ConversationSearchViewModel.Factory viewModelFactory = new ConversationSearchViewModel.Factory(getString(R.string.note_to_self));
searchViewModel = new ViewModelProvider(this, viewModelFactory).get(ConversationSearchViewModel.class);
searchViewModel.getSearchResults().observe(getViewLifecycleOwner(), result -> {
if (result == null)
return;
if (!result.getResults().isEmpty()) {
MessageResult messageResult = result.getResults().get(result.getPosition());
fragment.jumpToMessage(messageResult.getMessageRecipient().getId(), messageResult.getReceivedTimestampMs(), searchViewModel::onMissingResult);
}
searchNav.setData(result.getPosition(), result.getResults().size());
});
}
use of org.thoughtcrime.securesms.search.MessageResult in project Signal-Android by signalapp.
the class ConversationListSearchAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(@NonNull SearchResultViewHolder holder, int position) {
ThreadRecord conversationResult = getConversationResult(position);
if (conversationResult != null) {
holder.bind(conversationResult, glideRequests, eventListener, locale, searchResult.getQuery());
return;
}
Recipient contactResult = getContactResult(position);
if (contactResult != null) {
holder.bind(contactResult, glideRequests, eventListener, locale, searchResult.getQuery());
return;
}
MessageResult messageResult = getMessageResult(position);
if (messageResult != null) {
holder.bind(messageResult, glideRequests, eventListener, locale, searchResult.getQuery());
}
}
use of org.thoughtcrime.securesms.search.MessageResult in project Signal-Android by signalapp.
the class ConversationParentFragment method initializeSearchObserver.
private void initializeSearchObserver() {
ConversationSearchViewModel.Factory viewModelFactory = new ConversationSearchViewModel.Factory(getString(R.string.note_to_self));
searchViewModel = new ViewModelProvider(this, viewModelFactory).get(ConversationSearchViewModel.class);
searchViewModel.getSearchResults().observe(getViewLifecycleOwner(), result -> {
if (result == null)
return;
if (!result.getResults().isEmpty()) {
MessageResult messageResult = result.getResults().get(result.getPosition());
fragment.jumpToMessage(messageResult.getMessageRecipient().getId(), messageResult.getReceivedTimestampMs(), searchViewModel::onMissingResult);
}
searchNav.setData(result.getPosition(), result.getResults().size());
});
}
Aggregations