Improve emoji search results.

This commit is contained in:
Greyson Parrelli
2022-08-03 11:51:50 -04:00
parent 18eac51576
commit 907abf72d3
3 changed files with 109 additions and 85 deletions

View File

@@ -26,7 +26,7 @@ class EmojiSearchRepository(private val context: Context) {
fun submitQuery(query: String, limit: Int = EMOJI_SEARCH_LIMIT): Single<List<String>> {
val result = if (query.length >= MINIMUM_INLINE_QUERY_THRESHOLD && NOT_PUNCTUATION.matches(query.substring(query.lastIndex))) {
Single.fromCallable<List<String>> { emojiSearchDatabase.query(query, limit) }
Single.fromCallable { emojiSearchDatabase.query(query, limit) }
} else {
Single.just(emptyList())
}