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,
|
id = it.id,
|
||||||
primaryText = it.seriesName!!,
|
primaryText = it.seriesName!!,
|
||||||
secondaryText = it.name!!,
|
secondaryText = it.name!!,
|
||||||
progress = it.userData!!.playedPercentage!!.toFloat(),
|
progress = it.userData!!.playedPercentage!!,
|
||||||
colors = listOf(Color.Red, Color.Green),
|
colors = listOf(Color.Red, Color.Green),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
@@ -58,7 +58,7 @@ class HomePageViewModel @Inject constructor(
|
|||||||
primaryText = it.name!!,
|
primaryText = it.name!!,
|
||||||
secondaryText = it.premiereDate!!.format(DateTimeFormatter.ofLocalizedDate(
|
secondaryText = it.premiereDate!!.format(DateTimeFormatter.ofLocalizedDate(
|
||||||
FormatStyle.MEDIUM)),
|
FormatStyle.MEDIUM)),
|
||||||
progress = it.userData!!.playedPercentage!!.toFloat(),
|
progress = it.userData!!.playedPercentage!!,
|
||||||
colors = listOf(Color.Red, Color.Green)
|
colors = listOf(Color.Red, Color.Green)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ data class ContinueWatchingItem(
|
|||||||
val id: UUID,
|
val id: UUID,
|
||||||
val primaryText: String,
|
val primaryText: String,
|
||||||
val secondaryText: String,
|
val secondaryText: String,
|
||||||
val progress: Float,
|
val progress: Double,
|
||||||
val colors: List<Color>
|
val colors: List<Color>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import androidx.compose.ui.unit.sp
|
|||||||
import coil3.compose.AsyncImage
|
import coil3.compose.AsyncImage
|
||||||
import hu.bbara.purefin.image.JellyfinImageHelper
|
import hu.bbara.purefin.image.JellyfinImageHelper
|
||||||
import org.jellyfin.sdk.model.api.ImageType
|
import org.jellyfin.sdk.model.api.ImageType
|
||||||
|
import kotlin.math.nextUp
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun ContinueWatchingSection(
|
fun ContinueWatchingSection(
|
||||||
@@ -105,7 +106,7 @@ fun ContinueWatchingCard(
|
|||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxHeight()
|
.fillMaxHeight()
|
||||||
.fillMaxWidth(item.progress)
|
.fillMaxWidth(item.progress.toFloat().nextUp().div(100))
|
||||||
.background(colors.primary)
|
.background(colors.primary)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user