Merge pull request #1820 from kiwix/bugfix/macgills/1818-search-input

#1818 Input methods are broken in search - don't debounce or render t…
This commit is contained in:
Seán Mac Gillicuddy 2020-02-26 14:07:28 +00:00 committed by GitHub
commit df8152acc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 4 deletions

View File

@ -144,7 +144,6 @@ class SearchActivity : BaseActivity() {
}
private fun render(searchString: String) {
searchView.setQuery(searchString, false)
searchInTextMenuItem.isEnabled = searchString.isNotBlank()
}

View File

@ -53,7 +53,6 @@ import org.kiwix.kiwixmobile.core.search.viewmodel.effects.SearchIntentProcessin
import org.kiwix.kiwixmobile.core.search.viewmodel.effects.ShowDeleteSearchDialog
import org.kiwix.kiwixmobile.core.search.viewmodel.effects.ShowToast
import org.kiwix.kiwixmobile.core.search.viewmodel.effects.StartSpeechInput
import java.util.concurrent.TimeUnit.MILLISECONDS
import javax.inject.Inject
class SearchViewModel @Inject constructor(
@ -127,8 +126,7 @@ class SearchViewModel @Inject constructor(
searchResultsFromZimReader(),
filter,
Function3(this::reduce)
).debounce(100, MILLISECONDS)
.subscribe(state::postValue, Throwable::printStackTrace)
).subscribe(state::postValue, Throwable::printStackTrace)
private fun reduce(
recentSearchResults: List<SearchListItem>,