diff --git a/app/src/main/java/hu/bbara/purefin/app/HomePageViewModel.kt b/app/src/main/java/hu/bbara/purefin/app/HomePageViewModel.kt index df75268..2378f78 100644 --- a/app/src/main/java/hu/bbara/purefin/app/HomePageViewModel.kt +++ b/app/src/main/java/hu/bbara/purefin/app/HomePageViewModel.kt @@ -49,7 +49,7 @@ class HomePageViewModel @Inject constructor( id = it.id, primaryText = it.seriesName!!, secondaryText = it.name!!, - progress = it.userData!!.playedPercentage!!.toFloat(), + progress = it.userData!!.playedPercentage!!, colors = listOf(Color.Red, Color.Green), ) } else { @@ -58,7 +58,7 @@ class HomePageViewModel @Inject constructor( primaryText = it.name!!, secondaryText = it.premiereDate!!.format(DateTimeFormatter.ofLocalizedDate( FormatStyle.MEDIUM)), - progress = it.userData!!.playedPercentage!!.toFloat(), + progress = it.userData!!.playedPercentage!!, colors = listOf(Color.Red, Color.Green) ) } diff --git a/app/src/main/java/hu/bbara/purefin/app/home/HomeModels.kt b/app/src/main/java/hu/bbara/purefin/app/home/HomeModels.kt index 32fbc98..37cd8e8 100644 --- a/app/src/main/java/hu/bbara/purefin/app/home/HomeModels.kt +++ b/app/src/main/java/hu/bbara/purefin/app/home/HomeModels.kt @@ -8,7 +8,7 @@ data class ContinueWatchingItem( val id: UUID, val primaryText: String, val secondaryText: String, - val progress: Float, + val progress: Double, val colors: List ) diff --git a/app/src/main/java/hu/bbara/purefin/app/home/HomeSections.kt b/app/src/main/java/hu/bbara/purefin/app/home/HomeSections.kt index 9a6d244..b642231 100644 --- a/app/src/main/java/hu/bbara/purefin/app/home/HomeSections.kt +++ b/app/src/main/java/hu/bbara/purefin/app/home/HomeSections.kt @@ -33,6 +33,7 @@ import androidx.compose.ui.unit.sp import coil3.compose.AsyncImage import hu.bbara.purefin.image.JellyfinImageHelper import org.jellyfin.sdk.model.api.ImageType +import kotlin.math.nextUp @Composable fun ContinueWatchingSection( @@ -105,7 +106,7 @@ fun ContinueWatchingCard( Box( modifier = Modifier .fillMaxHeight() - .fillMaxWidth(item.progress) + .fillMaxWidth(item.progress.toFloat().nextUp().div(100)) .background(colors.primary) ) }