mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 14:37:59 +01:00
refresh media thumbnails instantly after changing sorting or filtering
This commit is contained in:
parent
8af103d98c
commit
7f17aeda71
1 changed files with 4 additions and 3 deletions
|
@ -274,7 +274,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
||||||
val filtered = mMedia.filter { it.name.contains(text, true) } as ArrayList
|
val filtered = mMedia.filter { it.name.contains(text, true) } as ArrayList
|
||||||
filtered.sortBy { !it.name.startsWith(text, true) }
|
filtered.sortBy { !it.name.startsWith(text, true) }
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
(media_grid.adapter as? MediaAdapter)?.updateMedia(filtered)
|
getMediaAdapter()?.updateMedia(filtered)
|
||||||
}
|
}
|
||||||
}.start()
|
}.start()
|
||||||
}
|
}
|
||||||
|
@ -367,12 +367,14 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
||||||
|
|
||||||
private fun showSortingDialog() {
|
private fun showSortingDialog() {
|
||||||
ChangeSortingDialog(this, false, !config.showAll, mPath) {
|
ChangeSortingDialog(this, false, !config.showAll, mPath) {
|
||||||
|
mLoadedInitialPhotos = false
|
||||||
getMedia()
|
getMedia()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showFilterMediaDialog() {
|
private fun showFilterMediaDialog() {
|
||||||
FilterMediaDialog(this) {
|
FilterMediaDialog(this) {
|
||||||
|
mLoadedInitialPhotos = false
|
||||||
media_refresh_layout.isRefreshing = true
|
media_refresh_layout.isRefreshing = true
|
||||||
getMedia()
|
getMedia()
|
||||||
}
|
}
|
||||||
|
@ -380,8 +382,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
||||||
|
|
||||||
private fun toggleFilenameVisibility() {
|
private fun toggleFilenameVisibility() {
|
||||||
config.displayFileNames = !config.displayFileNames
|
config.displayFileNames = !config.displayFileNames
|
||||||
if (media_grid.adapter != null)
|
getMediaAdapter()?.updateDisplayFilenames(config.displayFileNames)
|
||||||
getMediaAdapter()?.updateDisplayFilenames(config.displayFileNames)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun switchToFolderView() {
|
private fun switchToFolderView() {
|
||||||
|
|
Loading…
Reference in a new issue