diff --git a/app/build.gradle b/app/build.gradle index 2fe5b50a..eaa1a5b3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -64,7 +64,7 @@ android { } dependencies { - implementation 'com.github.SimpleMobileTools:Simple-Commons:4cfef38454' + implementation 'com.github.SimpleMobileTools:Simple-Commons:7f3e880dc5' implementation 'com.github.tibbi:AndroidPdfViewer:da57ff410e' implementation 'com.github.Stericson:RootTools:df729dcb13' implementation 'com.github.Stericson:RootShell:1.6' 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 c6e117a1..3c16516c 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 @@ -396,11 +396,7 @@ class MainActivity : SimpleActivity() { main_view_pager.offscreenPageLimit = 2 main_view_pager.addOnPageChangeListener(object : ViewPager.OnPageChangeListener { - override fun onPageScrollStateChanged(state: Int) { - if (state == ViewPager.SCROLL_STATE_SETTLING) { - closeSearch() - } - } + override fun onPageScrollStateChanged(state: Int) {} override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {} diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/ItemsFragment.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/ItemsFragment.kt index 1e54d042..f3716e13 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/ItemsFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/ItemsFragment.kt @@ -37,6 +37,7 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF private var zoomListener: MyRecyclerView.MyZoomListener? = null private var storedItems = ArrayList() + private var itemsIgnoringSearch = ArrayList() override fun setupFragment(activity: SimpleActivity) { if (this.activity == null) { @@ -49,7 +50,6 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF override fun onResume(textColor: Int) { context!!.updateTextColors(this) - storedItems = ArrayList() getRecyclerAdapter()?.apply { updatePrimaryColor() updateTextColor(textColor) @@ -113,6 +113,7 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF } } + itemsIgnoringSearch = listItems activity?.runOnUiThread { activity?.invalidateOptionsMenu() addItems(listItems, forceRefresh) @@ -294,7 +295,7 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF when { searchText.isEmpty() -> { items_fastscroller.beVisible() - getRecyclerAdapter()?.updateItems(storedItems) + getRecyclerAdapter()?.updateItems(itemsIgnoringSearch) items_placeholder.beGone() items_placeholder_2.beGone() search_progress.hide()