Set query hint, clean up code smell.

This commit is contained in:
mpm11011 2020-08-26 21:46:36 -04:00
parent b10b13a339
commit 8fe315c354
3 changed files with 4 additions and 14 deletions

View File

@ -75,6 +75,9 @@ open class SettingsSearchController(
val searchView = searchItem.actionView as SearchView val searchView = searchItem.actionView as SearchView
searchView.maxWidth = Int.MAX_VALUE searchView.maxWidth = Int.MAX_VALUE
// Change hint to show "search settings."
searchView.queryHint = applicationContext?.getString(R.string.action_search_settings)
searchItem.expandActionView() searchItem.expandActionView()
setItems(getResultSet()) setItems(getResultSet())

View File

@ -1,16 +1,13 @@
package eu.kanade.tachiyomi.ui.setting.settingssearch package eu.kanade.tachiyomi.ui.setting.settingssearch
import android.os.Bundle import android.os.Bundle
import androidx.preference.Preference
import eu.kanade.tachiyomi.data.database.DatabaseHelper import eu.kanade.tachiyomi.data.database.DatabaseHelper
import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.PreferencesHelper
import eu.kanade.tachiyomi.extension.ExtensionManager import eu.kanade.tachiyomi.extension.ExtensionManager
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.source.SourceManager
import eu.kanade.tachiyomi.ui.base.presenter.BasePresenter import eu.kanade.tachiyomi.ui.base.presenter.BasePresenter
import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourcePresenter import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourcePresenter
import rx.Subscription import rx.Subscription
import rx.subjects.PublishSubject
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
import uy.kohesive.injekt.injectLazy import uy.kohesive.injekt.injectLazy
@ -42,11 +39,6 @@ open class SettingsSearchPresenter(
*/ */
private var fetchSourcesSubscription: Subscription? = null private var fetchSourcesSubscription: Subscription? = null
/**
* Subject which fetches image of given manga.
*/
private val fetchImageSubject = PublishSubject.create<Pair<List<Preference>, Source>>()
/** /**
* Subscription for fetching images of manga. * Subscription for fetching images of manga.
*/ */
@ -61,8 +53,6 @@ open class SettingsSearchPresenter(
extensionFilter = savedState?.getString(SettingsSearchPresenter::extensionFilter.name) extensionFilter = savedState?.getString(SettingsSearchPresenter::extensionFilter.name)
?: initialExtensionFilter ?: initialExtensionFilter
// TODO - Perform a search with previous or initial state
} }
override fun onDestroy() { override fun onDestroy() {
@ -76,8 +66,4 @@ open class SettingsSearchPresenter(
state.putString(SettingsSearchPresenter::extensionFilter.name, extensionFilter) state.putString(SettingsSearchPresenter::extensionFilter.name, extensionFilter)
super.onSave(state) 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?
}
} }

View File

@ -44,6 +44,7 @@
<string name="action_sort_latest_chapter">Latest chapter</string> <string name="action_sort_latest_chapter">Latest chapter</string>
<string name="action_sort_date_added">Date added</string> <string name="action_sort_date_added">Date added</string>
<string name="action_search">Search</string> <string name="action_search">Search</string>
<string name="action_search_settings">Search settings</string>
<string name="action_global_search">Global search</string> <string name="action_global_search">Global search</string>
<string name="action_select_all">Select all</string> <string name="action_select_all">Select all</string>
<string name="action_select_inverse">Select inverse</string> <string name="action_select_inverse">Select inverse</string>