Skip to content

Commit 98c70fa

Browse files
committed
reset search results more reliably on close
1 parent 53334fa commit 98c70fa

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ android {
6464
}
6565

6666
dependencies {
67-
implementation 'com.github.SimpleMobileTools:Simple-Commons:4cfef38454'
67+
implementation 'com.github.SimpleMobileTools:Simple-Commons:7f3e880dc5'
6868
implementation 'com.github.tibbi:AndroidPdfViewer:da57ff410e'
6969
implementation 'com.github.Stericson:RootTools:df729dcb13'
7070
implementation 'com.github.Stericson:RootShell:1.6'

app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MainActivity.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -396,11 +396,7 @@ class MainActivity : SimpleActivity() {
396396
main_view_pager.offscreenPageLimit = 2
397397

398398
main_view_pager.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
399-
override fun onPageScrollStateChanged(state: Int) {
400-
if (state == ViewPager.SCROLL_STATE_SETTLING) {
401-
closeSearch()
402-
}
403-
}
399+
override fun onPageScrollStateChanged(state: Int) {}
404400

405401
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {}
406402

app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/ItemsFragment.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF
3737
private var zoomListener: MyRecyclerView.MyZoomListener? = null
3838

3939
private var storedItems = ArrayList<ListItem>()
40+
private var itemsIgnoringSearch = ArrayList<ListItem>()
4041

4142
override fun setupFragment(activity: SimpleActivity) {
4243
if (this.activity == null) {
@@ -49,7 +50,6 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF
4950

5051
override fun onResume(textColor: Int) {
5152
context!!.updateTextColors(this)
52-
storedItems = ArrayList()
5353
getRecyclerAdapter()?.apply {
5454
updatePrimaryColor()
5555
updateTextColor(textColor)
@@ -113,6 +113,7 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF
113113
}
114114
}
115115

116+
itemsIgnoringSearch = listItems
116117
activity?.runOnUiThread {
117118
activity?.invalidateOptionsMenu()
118119
addItems(listItems, forceRefresh)
@@ -294,7 +295,7 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF
294295
when {
295296
searchText.isEmpty() -> {
296297
items_fastscroller.beVisible()
297-
getRecyclerAdapter()?.updateItems(storedItems)
298+
getRecyclerAdapter()?.updateItems(itemsIgnoringSearch)
298299
items_placeholder.beGone()
299300
items_placeholder_2.beGone()
300301
search_progress.hide()

0 commit comments

Comments
 (0)