From 8fe315c3547fa391c0ddc1b61f999ba59ee0d692 Mon Sep 17 00:00:00 2001 From: mpm11011 Date: Wed, 26 Aug 2020 21:46:36 -0400 Subject: [PATCH] Set query hint, clean up code smell. --- .../settingssearch/SettingsSearchController.kt | 3 +++ .../settingssearch/SettingsSearchPresenter.kt | 14 -------------- app/src/main/res/values/strings.xml | 1 + 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/settingssearch/SettingsSearchController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/settingssearch/SettingsSearchController.kt index 7227bd8b9..44b06597e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/settingssearch/SettingsSearchController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/settingssearch/SettingsSearchController.kt @@ -75,6 +75,9 @@ open class SettingsSearchController( val searchView = searchItem.actionView as SearchView searchView.maxWidth = Int.MAX_VALUE + // Change hint to show "search settings." + searchView.queryHint = applicationContext?.getString(R.string.action_search_settings) + searchItem.expandActionView() setItems(getResultSet()) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/settingssearch/SettingsSearchPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/settingssearch/SettingsSearchPresenter.kt index 8fd1a5259..8be02aea1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/settingssearch/SettingsSearchPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/settingssearch/SettingsSearchPresenter.kt @@ -1,16 +1,13 @@ package eu.kanade.tachiyomi.ui.setting.settingssearch import android.os.Bundle -import androidx.preference.Preference import eu.kanade.tachiyomi.data.database.DatabaseHelper import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.extension.ExtensionManager -import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.ui.base.presenter.BasePresenter import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourcePresenter import rx.Subscription -import rx.subjects.PublishSubject import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import uy.kohesive.injekt.injectLazy @@ -42,11 +39,6 @@ open class SettingsSearchPresenter( */ private var fetchSourcesSubscription: Subscription? = null - /** - * Subject which fetches image of given manga. - */ - private val fetchImageSubject = PublishSubject.create, Source>>() - /** * Subscription for fetching images of manga. */ @@ -61,8 +53,6 @@ open class SettingsSearchPresenter( extensionFilter = savedState?.getString(SettingsSearchPresenter::extensionFilter.name) ?: initialExtensionFilter - - // TODO - Perform a search with previous or initial state } override fun onDestroy() { @@ -76,8 +66,4 @@ open class SettingsSearchPresenter( state.putString(SettingsSearchPresenter::extensionFilter.name, extensionFilter) super.onSave(state) } - - fun search(toString: String) { - // TODO - My ignorance of kotlin pattern is showing here... why would the search logic take place in the Presenter? - } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3f0e8822f..f1d38f72b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -44,6 +44,7 @@ Latest chapter Date added Search + Search settings Global search Select all Select inverse