Cleanup resources and code

This commit is contained in:
Koitharu
2022-03-08 18:58:15 +02:00
parent 148986b454
commit 57f3715128
65 changed files with 202 additions and 506 deletions

View File

@@ -11,6 +11,12 @@ import org.koitharu.kotatsu.core.model.MangaSource
import org.koitharu.kotatsu.search.domain.MangaSearchRepository
import org.koitharu.kotatsu.search.ui.suggestion.model.SearchSuggestionItem
private const val DEBOUNCE_TIMEOUT = 500L
private const val SEARCH_THRESHOLD = 3
private const val MAX_MANGA_ITEMS = 3
private const val MAX_QUERY_ITEMS = 120
private const val MAX_SUGGESTION_ITEMS = MAX_MANGA_ITEMS + MAX_QUERY_ITEMS + 1
class SearchSuggestionViewModel(
private val repository: MangaSearchRepository,
) : BaseViewModel() {
@@ -83,13 +89,4 @@ class SearchSuggestionViewModel(
suggestion.postValue(it)
}.launchIn(viewModelScope + Dispatchers.Default)
}
private companion object {
const val DEBOUNCE_TIMEOUT = 500L
const val SEARCH_THRESHOLD = 3
const val MAX_MANGA_ITEMS = 3
const val MAX_QUERY_ITEMS = 120
const val MAX_SUGGESTION_ITEMS = MAX_MANGA_ITEMS + MAX_QUERY_ITEMS + 1
}
}