diff --git a/mobile/src/main/java/org/openhab/habdroid/ui/widget/WidgetImageView.kt b/mobile/src/main/java/org/openhab/habdroid/ui/widget/WidgetImageView.kt index 68233d79d0..b2eaa2c8d0 100644 --- a/mobile/src/main/java/org/openhab/habdroid/ui/widget/WidgetImageView.kt +++ b/mobile/src/main/java/org/openhab/habdroid/ui/widget/WidgetImageView.kt @@ -23,9 +23,11 @@ import android.util.Base64 import android.util.Log import androidx.appcompat.widget.AppCompatImageView import com.faltenreich.skeletonlayout.Skeleton +import com.faltenreich.skeletonlayout.SkeletonConfig import com.faltenreich.skeletonlayout.SkeletonLayout import com.faltenreich.skeletonlayout.createSkeleton import kotlin.random.Random +import kotlin.time.Duration.Companion.seconds import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job @@ -42,6 +44,7 @@ import org.openhab.habdroid.util.ImageConversionPolicy import org.openhab.habdroid.util.getIconFallbackColor import org.openhab.habdroid.util.getPrefs import org.openhab.habdroid.util.isDebugModeEnabled +import org.openhab.habdroid.util.resolveThemedColor class WidgetImageView(context: Context, attrs: AttributeSet?) : AppCompatImageView(context, attrs) { private var scope: CoroutineScope? = null @@ -317,7 +320,9 @@ class WidgetImageView(context: Context, attrs: AttributeSet?) : AppCompatImageVi private fun applySkeleton() { if (skeleton == null) { - skeleton = createSkeleton() + val config = SkeletonConfig.default(context) + config.maskColor = context.resolveThemedColor(R.attr.colorOnSurfaceInverse, config.maskColor) + skeleton = createSkeleton(config) } skeleton?.showSkeleton() }