sublist directories at background update
This commit is contained in:
parent
3fdce65fe0
commit
870b8c6837
|
@ -6,11 +6,13 @@ import android.content.Intent
|
|||
import com.google.gson.Gson
|
||||
import com.simplemobiletools.gallery.asynctasks.GetDirectoriesAsynctask
|
||||
import com.simplemobiletools.gallery.extensions.config
|
||||
import com.simplemobiletools.gallery.helpers.SAVE_DIRS_CNT
|
||||
|
||||
class RefreshMediaReceiver : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
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()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue