@@ -58,8 +58,8 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF
5858
5959 val properPrimaryColor = context!! .getProperPrimaryColor()
6060 items_fastscroller.updateColors(properPrimaryColor)
61- search_progress .setIndicatorColor(properPrimaryColor)
62- search_progress .trackColor = properPrimaryColor.adjustAlpha(LOWER_ALPHA )
61+ progress_bar .setIndicatorColor(properPrimaryColor)
62+ progress_bar .trackColor = properPrimaryColor.adjustAlpha(LOWER_ALPHA )
6363
6464 if (currentPath != " " ) {
6565 breadcrumbs.updateColor(textColor)
@@ -95,6 +95,7 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF
9595 scrollStates[currentPath] = getScrollState()!!
9696 currentPath = realPath
9797 showHidden = context!! .config.shouldShowHidden
98+ showProgressBar()
9899 getItems(currentPath) { originalPath, listItems ->
99100 if (currentPath != originalPath) {
100101 return @getItems
@@ -120,6 +121,7 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF
120121 if (context != null && currentViewType != context!! .config.getFolderViewType(currentPath)) {
121122 setupLayoutManager()
122123 }
124+ hideProgressBar()
123125 }
124126 }
125127 }
@@ -298,16 +300,16 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF
298300 getRecyclerAdapter()?.updateItems(itemsIgnoringSearch)
299301 items_placeholder.beGone()
300302 items_placeholder_2.beGone()
301- search_progress.hide ()
303+ hideProgressBar ()
302304 }
303305 searchText.length == 1 -> {
304306 items_fastscroller.beGone()
305307 items_placeholder.beVisible()
306308 items_placeholder_2.beVisible()
307- search_progress.hide ()
309+ hideProgressBar ()
308310 }
309311 else -> {
310- search_progress.show ()
312+ showProgressBar ()
311313 ensureBackgroundThread {
312314 val files = searchFiles(searchText, currentPath)
313315 files.sortBy { it.getParentPath() }
@@ -343,7 +345,7 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF
343345 items_fastscroller.beVisibleIf(listItems.isNotEmpty())
344346 items_placeholder.beVisibleIf(listItems.isEmpty())
345347 items_placeholder_2.beGone()
346- search_progress.hide ()
348+ hideProgressBar ()
347349 }
348350 }
349351 }
@@ -404,7 +406,7 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF
404406 items_fastscroller.beVisible()
405407 items_placeholder.beGone()
406408 items_placeholder_2.beGone()
407- search_progress.hide ()
409+ hideProgressBar ()
408410 }
409411
410412 private fun createNewItem () {
@@ -498,6 +500,14 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF
498500 }
499501 }
500502
503+ private fun showProgressBar () {
504+ progress_bar.show()
505+ }
506+
507+ private fun hideProgressBar () {
508+ progress_bar.hide()
509+ }
510+
501511 override fun toggleFilenameVisibility () {
502512 getRecyclerAdapter()?.updateDisplayFilenamesInGrid()
503513 }
0 commit comments