use of org.thoughtcrime.securesms.database.StickerDatabase.StickerRecordReader in project Signal-Android by WhisperSystems.
the class StickerSearchRepository method searchByEmoji.
public void searchByEmoji(@NonNull String emoji, @NonNull Callback<List<StickerRecord>> callback) {
SignalExecutors.BOUNDED.execute(() -> {
String searchEmoji = EmojiUtil.getCanonicalRepresentation(emoji);
List<StickerRecord> out = new ArrayList<>();
Set<String> possible = EmojiUtil.getAllRepresentations(searchEmoji);
for (String candidate : possible) {
try (StickerRecordReader reader = new StickerRecordReader(stickerDatabase.getStickersByEmoji(candidate))) {
StickerRecord record = null;
while ((record = reader.getNext()) != null) {
out.add(record);
}
}
}
callback.onResult(out);
});
}
use of org.thoughtcrime.securesms.database.StickerDatabase.StickerRecordReader in project Signal-Android by signalapp.
the class StickerSearchRepository method searchByEmoji.
public void searchByEmoji(@NonNull String emoji, @NonNull Callback<List<StickerRecord>> callback) {
SignalExecutors.BOUNDED.execute(() -> {
String searchEmoji = EmojiUtil.getCanonicalRepresentation(emoji);
List<StickerRecord> out = new ArrayList<>();
Set<String> possible = EmojiUtil.getAllRepresentations(searchEmoji);
for (String candidate : possible) {
try (StickerRecordReader reader = new StickerRecordReader(stickerDatabase.getStickersByEmoji(candidate))) {
StickerRecord record = null;
while ((record = reader.getNext()) != null) {
out.add(record);
}
}
}
callback.onResult(out);
});
}
Aggregations