moving searchQueryChanged to MyViewPagerFragment

This commit is contained in:
tibbi 2023-01-05 13:18:24 +01:00
parent ebd65dd134
commit 989e68227a
5 changed files with 9 additions and 5 deletions

View File

@ -209,12 +209,12 @@ class MainActivity : SimpleActivity() {
main_menu.onSearchClosedListener = { main_menu.onSearchClosedListener = {
getAllFragments().forEach { getAllFragments().forEach {
(it as? ItemOperationsListener)?.searchQueryChanged("") it?.searchQueryChanged("")
} }
} }
main_menu.onSearchTextChangedListener = { text -> main_menu.onSearchTextChangedListener = { text ->
(getCurrentFragment() as? ItemOperationsListener)?.searchQueryChanged(text) getCurrentFragment()?.searchQueryChanged(text)
} }
main_menu.getToolbar().setOnMenuItemClickListener { menuItem -> main_menu.getToolbar().setOnMenuItemClickListener { menuItem ->

View File

@ -123,7 +123,7 @@ class MimeTypesActivity : SimpleActivity(), ItemOperationsListener {
override fun selectedPaths(paths: ArrayList<String>) {} override fun selectedPaths(paths: ArrayList<String>) {}
override fun searchQueryChanged(text: String) { fun searchQueryChanged(text: String) {
val searchText = text.trim() val searchText = text.trim()
lastSearchedText = searchText lastSearchedText = searchText
when { when {

View File

@ -66,4 +66,6 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet)
abstract fun onResume(textColor: Int) abstract fun onResume(textColor: Int)
abstract fun refreshFragment() abstract fun refreshFragment()
abstract fun searchQueryChanged(text: String)
} }

View File

@ -221,4 +221,8 @@ class StorageFragment(context: Context, attributeSet: AttributeSet) : MyViewPage
} }
} }
} }
override fun searchQueryChanged(text: String) {
}
} }

View File

@ -9,8 +9,6 @@ interface ItemOperationsListener {
fun selectedPaths(paths: ArrayList<String>) fun selectedPaths(paths: ArrayList<String>)
fun searchQueryChanged(text: String)
fun setupDateTimeFormat() fun setupDateTimeFormat()
fun setupFontSize() fun setupFontSize()