load the first folders image at the widget config screen

This commit is contained in:
tibbi
2018-12-16 16:36:18 +01:00
parent 233b6e3b54
commit ba4b120dfe
2 changed files with 13 additions and 3 deletions

View File

@ -11,6 +11,8 @@ import com.simplemobiletools.commons.dialogs.ColorPickerDialog
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.gallery.pro.R
import com.simplemobiletools.gallery.pro.extensions.config
import com.simplemobiletools.gallery.pro.extensions.getCachedDirectories
import com.simplemobiletools.gallery.pro.extensions.loadJpg
import com.simplemobiletools.gallery.pro.extensions.widgetsDB
import com.simplemobiletools.gallery.pro.helpers.MyWidgetProvider
import com.simplemobiletools.gallery.pro.models.Widget
@ -40,6 +42,15 @@ class WidgetConfigureActivity : SimpleActivity() {
config_save.setTextColor(getAdjustedPrimaryColor())
updateTextColors(folder_picker_holder)
folder_picker_holder.background = ColorDrawable(config.backgroundColor)
getCachedDirectories(false, false) {
val path = it.firstOrNull()?.tmb
if (path != null) {
runOnUiThread {
loadJpg(path, config_image, true)
}
}
}
}
private fun initVariables() {