load the first folders image at the widget config screen
This commit is contained in:
parent
233b6e3b54
commit
ba4b120dfe
2 changed files with 13 additions and 3 deletions
|
@ -11,6 +11,8 @@ import com.simplemobiletools.commons.dialogs.ColorPickerDialog
|
||||||
import com.simplemobiletools.commons.extensions.*
|
import com.simplemobiletools.commons.extensions.*
|
||||||
import com.simplemobiletools.gallery.pro.R
|
import com.simplemobiletools.gallery.pro.R
|
||||||
import com.simplemobiletools.gallery.pro.extensions.config
|
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.extensions.widgetsDB
|
||||||
import com.simplemobiletools.gallery.pro.helpers.MyWidgetProvider
|
import com.simplemobiletools.gallery.pro.helpers.MyWidgetProvider
|
||||||
import com.simplemobiletools.gallery.pro.models.Widget
|
import com.simplemobiletools.gallery.pro.models.Widget
|
||||||
|
@ -40,6 +42,15 @@ class WidgetConfigureActivity : SimpleActivity() {
|
||||||
config_save.setTextColor(getAdjustedPrimaryColor())
|
config_save.setTextColor(getAdjustedPrimaryColor())
|
||||||
updateTextColors(folder_picker_holder)
|
updateTextColors(folder_picker_holder)
|
||||||
folder_picker_holder.background = ColorDrawable(config.backgroundColor)
|
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() {
|
private fun initVariables() {
|
||||||
|
|
|
@ -35,10 +35,9 @@
|
||||||
android:id="@+id/config_image_holder"
|
android:id="@+id/config_image_holder"
|
||||||
android:layout_width="110dp"
|
android:layout_width="110dp"
|
||||||
android:layout_height="110dp"
|
android:layout_height="110dp"
|
||||||
android:layout_below="@+id/folder_picker_holder"
|
android:layout_below="@+id/folder_picker_holder">
|
||||||
android:padding="@dimen/activity_margin">
|
|
||||||
|
|
||||||
<ImageView
|
<com.simplemobiletools.gallery.pro.views.MySquareImageView
|
||||||
android:id="@+id/config_image"
|
android:id="@+id/config_image"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"/>
|
android:layout_height="match_parent"/>
|
||||||
|
|
Loading…
Reference in a new issue