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() {

View file

@ -35,10 +35,9 @@
android:id="@+id/config_image_holder"
android:layout_width="110dp"
android:layout_height="110dp"
android:layout_below="@+id/folder_picker_holder"
android:padding="@dimen/activity_margin">
android:layout_below="@+id/folder_picker_holder">
<ImageView
<com.simplemobiletools.gallery.pro.views.MySquareImageView
android:id="@+id/config_image"
android:layout_width="match_parent"
android:layout_height="match_parent"/>