@@ -30,8 +30,6 @@ import java.io.File
3030class ItemsFragment (context : Context , attributeSet : AttributeSet ) : MyViewPagerFragment(context, attributeSet), ItemOperationsListener,
3131 Breadcrumbs .BreadcrumbsListener {
3232 private var showHidden = false
33- private var skipItemUpdating = false
34- private var isSearchOpen = false
3533 private var lastSearchedText = " "
3634 private var scrollStates = HashMap <String , Parcelable >()
3735 private var zoomListener: MyRecyclerView .MyZoomListener ? = null
@@ -134,7 +132,6 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF
134132 }
135133
136134 private fun addItems (items : ArrayList <ListItem >, forceRefresh : Boolean = false) {
137- skipItemUpdating = false
138135 activity?.runOnUiThread {
139136 items_swipe_refresh?.isRefreshing = false
140137 breadcrumbs.setBreadcrumb(currentPath)
@@ -173,7 +170,6 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF
173170
174171 @SuppressLint(" NewApi" )
175172 private fun getItems (path : String , callback : (originalPath: String , items: ArrayList <ListItem >) -> Unit ) {
176- skipItemUpdating = false
177173 ensureBackgroundThread {
178174 if (activity?.isDestroyed == false && activity?.isFinishing == false ) {
179175 val config = context!! .config
@@ -288,7 +284,6 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF
288284
289285 private fun openDirectory (path : String ) {
290286 (activity as ? MainActivity )?.apply {
291- skipItemUpdating = isSearchOpen
292287 openedDirectory()
293288 }
294289 openPath(path)
@@ -394,20 +389,8 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF
394389 return files
395390 }
396391
397- fun searchOpened () {
398- isSearchOpen = true
392+ private fun searchClosed () {
399393 lastSearchedText = " "
400- }
401-
402- fun searchClosed () {
403- isSearchOpen = false
404- if (! skipItemUpdating) {
405- getRecyclerAdapter()?.updateItems(storedItems)
406- }
407-
408- skipItemUpdating = false
409- lastSearchedText = " "
410-
411394 items_swipe_refresh.isEnabled = activity?.config?.enablePullToRefresh != false
412395 items_fastscroller.beVisible()
413396 items_placeholder.beGone()
0 commit comments