sublist directories at background update
This commit is contained in:
parent
3fdce65fe0
commit
870b8c6837
1 changed files with 3 additions and 1 deletions
|
@ -6,11 +6,13 @@ import android.content.Intent
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import com.simplemobiletools.gallery.asynctasks.GetDirectoriesAsynctask
|
import com.simplemobiletools.gallery.asynctasks.GetDirectoriesAsynctask
|
||||||
import com.simplemobiletools.gallery.extensions.config
|
import com.simplemobiletools.gallery.extensions.config
|
||||||
|
import com.simplemobiletools.gallery.helpers.SAVE_DIRS_CNT
|
||||||
|
|
||||||
class RefreshMediaReceiver : BroadcastReceiver() {
|
class RefreshMediaReceiver : BroadcastReceiver() {
|
||||||
override fun onReceive(context: Context, intent: Intent) {
|
override fun onReceive(context: Context, intent: Intent) {
|
||||||
GetDirectoriesAsynctask(context, false, false) {
|
GetDirectoriesAsynctask(context, false, false) {
|
||||||
context.config.directories = Gson().toJson(it)
|
val subList = it.subList(0, Math.min(SAVE_DIRS_CNT, it.size))
|
||||||
|
context.config.directories = Gson().toJson(subList)
|
||||||
}.execute()
|
}.execute()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue