display search progress bar

This commit is contained in:
Mysochenko Yuriy 2022-05-20 12:02:18 +03:00
parent 4c8629b4f7
commit a775d48644
2 changed files with 15 additions and 0 deletions

View File

@ -293,13 +293,16 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF
getRecyclerAdapter()?.updateItems(storedItems) getRecyclerAdapter()?.updateItems(storedItems)
items_placeholder.beGone() items_placeholder.beGone()
items_placeholder_2.beGone() items_placeholder_2.beGone()
search_progress.beGone()
} }
searchText.length == 1 -> { searchText.length == 1 -> {
items_fastscroller.beGone() items_fastscroller.beGone()
items_placeholder.beVisible() items_placeholder.beVisible()
items_placeholder_2.beVisible() items_placeholder_2.beVisible()
search_progress.beGone()
} }
else -> { else -> {
search_progress.beVisible()
ensureBackgroundThread { ensureBackgroundThread {
val files = searchFiles(searchText, currentPath) val files = searchFiles(searchText, currentPath)
files.sortBy { it.getParentPath() } files.sortBy { it.getParentPath() }
@ -335,6 +338,7 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF
items_fastscroller.beVisibleIf(listItems.isNotEmpty()) items_fastscroller.beVisibleIf(listItems.isNotEmpty())
items_placeholder.beVisibleIf(listItems.isEmpty()) items_placeholder.beVisibleIf(listItems.isEmpty())
items_placeholder_2.beGone() items_placeholder_2.beGone()
search_progress.beGone()
} }
} }
} }

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<com.simplemobiletools.filemanager.pro.fragments.ItemsFragment xmlns:android="http://schemas.android.com/apk/res/android" <com.simplemobiletools.filemanager.pro.fragments.ItemsFragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/items_fragment" android:id="@+id/items_fragment"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
@ -25,6 +26,16 @@
android:paddingEnd="@dimen/small_margin" android:paddingEnd="@dimen/small_margin"
android:paddingBottom="@dimen/small_margin" /> android:paddingBottom="@dimen/small_margin" />
<ProgressBar
android:id="@+id/search_progress"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:indeterminate="true"
android:visibility="gone"
tools:visibility="visible" />
<com.simplemobiletools.commons.views.MyTextView <com.simplemobiletools.commons.views.MyTextView
android:id="@+id/items_placeholder" android:id="@+id/items_placeholder"
android:layout_width="match_parent" android:layout_width="match_parent"