mirror of
https://github.com/bbara04/Purefin.git
synced 2026-04-01 01:30:08 +02:00
Fix progress bar
This commit is contained in:
@@ -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)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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<Color>
|
||||
)
|
||||
|
||||
|
||||
@@ -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)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user