Milan Jurkulak пре 3 година
родитељ
комит
da506971f9
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      app/src/main/kotlin/org/mjdev/tvapp/ui/screens/DetailScreen.kt

+ 3 - 1
app/src/main/kotlin/org/mjdev/tvapp/ui/screens/DetailScreen.kt

@@ -40,6 +40,7 @@ import org.mjdev.tvapp.viewmodel.DetailViewModel
 import org.mjdev.tvlib.annotations.TvPreview
 import org.mjdev.tvlib.extensions.HiltExt.appViewModel
 import org.mjdev.tvlib.extensions.StringExt.asException
+import org.mjdev.tvlib.interfaces.ItemPhoto
 import org.mjdev.tvlib.interfaces.ItemWithBackground
 import org.mjdev.tvlib.interfaces.ItemWithDescription
 import org.mjdev.tvlib.interfaces.ItemWithImage
@@ -82,6 +83,7 @@ class DetailScreen : Screen() {
             viewModel.detailsLoadingState(data)
         }.collectAsState()
 
+        val photo = (data as? ItemPhoto)?.uri
         val backgroundImage = (data as? ItemWithBackground<*>)?.background
         val image = (data as? ItemWithImage<*>)?.image
         val title = (data as? ItemWithTitle<*>)?.title
@@ -104,7 +106,7 @@ class DetailScreen : Screen() {
                     contentAlignment = Alignment.BottomStart,
                 ) {
                     ImageAny(
-                        src = backgroundImage ?: image,
+                        src = photo ?: backgroundImage ?: image,
                         contentDescription = null,
                         contentScale = ContentScale.Crop,
                         modifier = Modifier.fillMaxSize()