diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MainActivity.kt index 02f56926..12472a67 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MainActivity.kt @@ -209,12 +209,12 @@ class MainActivity : SimpleActivity() { main_menu.onSearchClosedListener = { getAllFragments().forEach { - (it as? ItemOperationsListener)?.searchQueryChanged("") + it?.searchQueryChanged("") } } main_menu.onSearchTextChangedListener = { text -> - (getCurrentFragment() as? ItemOperationsListener)?.searchQueryChanged(text) + getCurrentFragment()?.searchQueryChanged(text) } main_menu.getToolbar().setOnMenuItemClickListener { menuItem -> diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MimeTypesActivity.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MimeTypesActivity.kt index e083dad1..9e41cee4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MimeTypesActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MimeTypesActivity.kt @@ -123,7 +123,7 @@ class MimeTypesActivity : SimpleActivity(), ItemOperationsListener { override fun selectedPaths(paths: ArrayList) {} - override fun searchQueryChanged(text: String) { + fun searchQueryChanged(text: String) { val searchText = text.trim() lastSearchedText = searchText when { diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/MyViewPagerFragment.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/MyViewPagerFragment.kt index 70095ab0..4528de6f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/MyViewPagerFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/MyViewPagerFragment.kt @@ -66,4 +66,6 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet) abstract fun onResume(textColor: Int) abstract fun refreshFragment() + + abstract fun searchQueryChanged(text: String) } diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/StorageFragment.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/StorageFragment.kt index eb835a57..96e32949 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/StorageFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/StorageFragment.kt @@ -221,4 +221,8 @@ class StorageFragment(context: Context, attributeSet: AttributeSet) : MyViewPage } } } + + override fun searchQueryChanged(text: String) { + + } } diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/interfaces/ItemOperationsListener.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/interfaces/ItemOperationsListener.kt index 10dcdbd9..55e599a0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/interfaces/ItemOperationsListener.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/interfaces/ItemOperationsListener.kt @@ -9,8 +9,6 @@ interface ItemOperationsListener { fun selectedPaths(paths: ArrayList) - fun searchQueryChanged(text: String) - fun setupDateTimeFormat() fun setupFontSize()