do not cache media while temporarily showing hidden is enabled

This commit is contained in:
tibbi 2017-05-28 23:09:00 +02:00
parent 1b53acd096
commit e3f0d7ea56
2 changed files with 9 additions and 5 deletions

View file

@ -342,8 +342,10 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
} }
private fun storeDirectories() { private fun storeDirectories() {
val directories = Gson().toJson(mDirs) if (!config.temporarilyShowHidden) {
config.directories = directories val directories = Gson().toJson(mDirs)
config.directories = directories
}
} }
private fun setupAdapter() { private fun setupAdapter() {

View file

@ -399,9 +399,11 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
} }
private fun storeFolder() { private fun storeFolder() {
val subList = mMedia.subList(0, Math.min(SAVE_MEDIA_CNT, mMedia.size)) if (!config.temporarilyShowHidden) {
val json = Gson().toJson(subList) val subList = mMedia.subList(0, Math.min(SAVE_MEDIA_CNT, mMedia.size))
config.saveFolderMedia(mPath, json) val json = Gson().toJson(subList)
config.saveFolderMedia(mPath, json)
}
} }
override fun deleteFiles(files: ArrayList<File>) { override fun deleteFiles(files: ArrayList<File>) {