show proper media counts at the Pick Directory dialog
This commit is contained in:
parent
5f10bebb19
commit
69f6599f8d
|
@ -16,7 +16,7 @@ import com.simplemobiletools.gallery.pro.helpers.VIEW_TYPE_GRID
|
||||||
import com.simplemobiletools.gallery.pro.models.Directory
|
import com.simplemobiletools.gallery.pro.models.Directory
|
||||||
import kotlinx.android.synthetic.main.dialog_directory_picker.view.*
|
import kotlinx.android.synthetic.main.dialog_directory_picker.view.*
|
||||||
|
|
||||||
class PickDirectoryDialog(val activity: BaseSimpleActivity, val sourcePath: String, val showOtherFolderButton: Boolean, val callback: (path: String) -> Unit) {
|
class PickDirectoryDialog(val activity: BaseSimpleActivity, val sourcePath: String, showOtherFolderButton: Boolean, val callback: (path: String) -> Unit) {
|
||||||
var dialog: AlertDialog
|
var dialog: AlertDialog
|
||||||
var shownDirectories = ArrayList<Directory>()
|
var shownDirectories = ArrayList<Directory>()
|
||||||
var view = activity.layoutInflater.inflate(R.layout.dialog_directory_picker, null)
|
var view = activity.layoutInflater.inflate(R.layout.dialog_directory_picker, null)
|
||||||
|
@ -56,6 +56,10 @@ class PickDirectoryDialog(val activity: BaseSimpleActivity, val sourcePath: Stri
|
||||||
private fun fetchDirectories(forceShowHidden: Boolean) {
|
private fun fetchDirectories(forceShowHidden: Boolean) {
|
||||||
activity.getCachedDirectories(forceShowHidden = forceShowHidden) {
|
activity.getCachedDirectories(forceShowHidden = forceShowHidden) {
|
||||||
if (it.isNotEmpty()) {
|
if (it.isNotEmpty()) {
|
||||||
|
it.forEach {
|
||||||
|
it.subfoldersMediaCount = it.mediaCnt
|
||||||
|
}
|
||||||
|
|
||||||
activity.runOnUiThread {
|
activity.runOnUiThread {
|
||||||
gotDirectories(activity.addTempFolderIfNeeded(it))
|
gotDirectories(activity.addTempFolderIfNeeded(it))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue