limit the cached folders size to 60 just to be sure

This commit is contained in:
tibbi 2018-03-15 21:28:30 +01:00
parent e62971d25a
commit 42bd31f38b
3 changed files with 4 additions and 2 deletions

View file

@ -602,7 +602,8 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
private fun storeDirectories() {
if (!config.temporarilyShowHidden && config.tempFolderPath.isEmpty()) {
val directories = Gson().toJson(mDirs)
val subList = mDirs.subList(0, Math.min(SAVE_DIRS_CNT, mDirs.size))
val directories = Gson().toJson(subList)
config.directories = directories
}
}

View file

@ -45,7 +45,6 @@ import java.io.File
import java.io.IOException
class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
private val SAVE_MEDIA_CNT = 80
private val LAST_MEDIA_CHECK_PERIOD = 3000L
private var mPath = ""

View file

@ -65,6 +65,8 @@ const val MAX_COLUMN_COUNT = 20
const val SHOW_TEMP_HIDDEN_DURATION = 600000L
const val CLICK_MAX_DURATION = 150
const val DRAG_THRESHOLD = 8
const val SAVE_DIRS_CNT = 60
const val SAVE_MEDIA_CNT = 80
const val DIRECTORY = "directory"
const val MEDIUM = "medium"