mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-23 04:57:59 +01:00
fix thumbnail grouping at Search
This commit is contained in:
parent
cd79467ff6
commit
b61e3b7d3d
1 changed files with 3 additions and 1 deletions
|
@ -274,6 +274,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
||||||
override fun onMenuItemActionCollapse(item: MenuItem?): Boolean {
|
override fun onMenuItemActionCollapse(item: MenuItem?): Boolean {
|
||||||
mIsSearchOpen = false
|
mIsSearchOpen = false
|
||||||
media_refresh_layout.isEnabled = config.enablePullToRefresh
|
media_refresh_layout.isEnabled = config.enablePullToRefresh
|
||||||
|
searchQueryChanged("")
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -283,8 +284,9 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
||||||
Thread {
|
Thread {
|
||||||
val filtered = mMedia.filter { it is Medium && it.name.contains(text, true) } as ArrayList
|
val filtered = mMedia.filter { it is Medium && it.name.contains(text, true) } as ArrayList
|
||||||
filtered.sortBy { it is Medium && !it.name.startsWith(text, true) }
|
filtered.sortBy { it is Medium && !it.name.startsWith(text, true) }
|
||||||
|
val grouped = MediaFetcher(applicationContext).groupMedia(filtered as ArrayList<Medium>, mPath)
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
getMediaAdapter()?.updateMedia(filtered)
|
getMediaAdapter()?.updateMedia(grouped)
|
||||||
}
|
}
|
||||||
}.start()
|
}.start()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue