mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-30 00:17:58 +01:00
make sure the directory placeholder is visible only when appropriate
This commit is contained in:
parent
ddfbdaa275
commit
cb17ab5b97
1 changed files with 8 additions and 3 deletions
|
@ -554,9 +554,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
|
||||||
var isPlaceholderVisible = dirs.isEmpty()
|
var isPlaceholderVisible = dirs.isEmpty()
|
||||||
|
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
directories_empty_text_label.beVisibleIf(dirs.isEmpty() && config.appRunCount > 1)
|
checkPlaceholderVisibility(dirs)
|
||||||
directories_empty_text.beVisibleIf(dirs.isEmpty() && config.appRunCount > 1)
|
|
||||||
directories_grid.beVisibleIf(directories_empty_text_label.isGone())
|
|
||||||
|
|
||||||
val allowHorizontalScroll = config.scrollHorizontally && config.viewTypeFiles == VIEW_TYPE_GRID
|
val allowHorizontalScroll = config.scrollHorizontally && config.viewTypeFiles == VIEW_TYPE_GRID
|
||||||
directories_vertical_fastscroller.beVisibleIf(directories_grid.isVisible() && !allowHorizontalScroll)
|
directories_vertical_fastscroller.beVisibleIf(directories_grid.isVisible() && !allowHorizontalScroll)
|
||||||
|
@ -646,10 +644,17 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
directories_refresh_layout.isRefreshing = false
|
directories_refresh_layout.isRefreshing = false
|
||||||
directories_vertical_fastscroller.measureRecyclerView()
|
directories_vertical_fastscroller.measureRecyclerView()
|
||||||
|
checkPlaceholderVisibility(dirs)
|
||||||
}
|
}
|
||||||
}.start()
|
}.start()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun checkPlaceholderVisibility(dirs: ArrayList<Directory>) {
|
||||||
|
directories_empty_text_label.beVisibleIf(dirs.isEmpty() && mLoadedInitialPhotos)
|
||||||
|
directories_empty_text.beVisibleIf(dirs.isEmpty() && mLoadedInitialPhotos)
|
||||||
|
directories_grid.beVisibleIf(directories_empty_text_label.isGone())
|
||||||
|
}
|
||||||
|
|
||||||
private fun showSortedDirs(dirs: ArrayList<Directory>) {
|
private fun showSortedDirs(dirs: ArrayList<Directory>) {
|
||||||
val sortedDirs = getSortedDirectories(dirs).clone() as ArrayList<Directory>
|
val sortedDirs = getSortedDirectories(dirs).clone() as ArrayList<Directory>
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
|
|
Loading…
Reference in a new issue