From 4f484d9bec5256f7f37f265f61cb435e37e5856b Mon Sep 17 00:00:00 2001 From: maniac103 Date: Fri, 16 Aug 2024 16:18:02 +0200 Subject: [PATCH] Fix MjpegVideoViewHolder instantiation (#3803) This broke in #3787 Fixes #3802 Signed-off-by: Danny Baumann --- mobile/src/main/java/org/openhab/habdroid/ui/WidgetAdapter.kt | 2 +- .../src/main/java/org/openhab/habdroid/util/MjpegStreamer.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mobile/src/main/java/org/openhab/habdroid/ui/WidgetAdapter.kt b/mobile/src/main/java/org/openhab/habdroid/ui/WidgetAdapter.kt index dbc5ffc4b6..d7ad966589 100644 --- a/mobile/src/main/java/org/openhab/habdroid/ui/WidgetAdapter.kt +++ b/mobile/src/main/java/org/openhab/habdroid/ui/WidgetAdapter.kt @@ -1704,7 +1704,7 @@ class WidgetAdapter( class MjpegVideoViewHolder internal constructor(initData: ViewHolderInitData) : HeavyDataViewHolder(initData, R.layout.widgetlist_videomjpegitem) { - private val imageView = widgetContentView as ImageView + private val imageView = widgetContentView as WidgetImageView private var streamer: MjpegStreamer? = null override fun bindAfterDataSaverCheck(widget: Widget) { diff --git a/mobile/src/main/java/org/openhab/habdroid/util/MjpegStreamer.kt b/mobile/src/main/java/org/openhab/habdroid/util/MjpegStreamer.kt index c94f47d7db..c8c26c0f4b 100644 --- a/mobile/src/main/java/org/openhab/habdroid/util/MjpegStreamer.kt +++ b/mobile/src/main/java/org/openhab/habdroid/util/MjpegStreamer.kt @@ -14,7 +14,6 @@ package org.openhab.habdroid.util import android.util.Log -import android.widget.ImageView import java.io.IOException import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -23,8 +22,9 @@ import kotlinx.coroutines.isActive import kotlinx.coroutines.launch import kotlinx.coroutines.withContext import org.openhab.habdroid.core.connection.Connection +import org.openhab.habdroid.ui.widget.WidgetImageView -class MjpegStreamer(private val view: ImageView, connection: Connection, private val url: String) { +class MjpegStreamer(private val view: WidgetImageView, connection: Connection, private val url: String) { private val httpClient = connection.httpClient private var job: Job? = null