Several UI changes (#171)

## Changes:
- Hopefully finally fixes next up card image issues
- Remove the slider wraparound behavior in settings
- Removes the shadows/blurry effect on movie & person titles
- Adds the official rating to the home page
- Consistently order the official rating on home, movie, & series pages
- Add 1.75x speed for playback
- Don't time out the audio track selection/playback speed/video scale
dialogs


## Issues
Closes #166 
Closes #168
Closes #169
Related to #162
Follow up to #167
This commit is contained in:
damontecres 2025-11-07 10:51:31 -05:00 committed by GitHub
parent 18556b5058
commit 44825d0c25
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 14 additions and 29 deletions

View file

@ -33,6 +33,7 @@ fun SliderBar(
min: Long,
max: Long,
onChange: (Long) -> Unit,
enableWrapAround: Boolean,
modifier: Modifier = Modifier,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
interval: Int = 1,
@ -52,7 +53,7 @@ fun SliderBar(
onChange(currentValue)
},
onLeft = {
if (currentValue <= min) {
if (enableWrapAround && currentValue <= min) {
currentValue = max
} else {
currentValue = (currentValue - interval).coerceAtLeast(min)
@ -60,7 +61,7 @@ fun SliderBar(
onChange(currentValue)
},
onRight = {
if (currentValue >= max) {
if (enableWrapAround && currentValue >= max) {
currentValue = min
} else {
currentValue = (currentValue + interval).coerceAtMost(max)

View file

@ -357,15 +357,7 @@ fun PersonHeader(
Text(
text = name,
color = MaterialTheme.colorScheme.onSurface,
style =
MaterialTheme.typography.displaySmall.copy(
shadow =
Shadow(
color = Color.DarkGray,
offset = Offset(5f, 2f),
blurRadius = 2f,
),
),
style = MaterialTheme.typography.displaySmall,
maxLines = 2,
overflow = TextOverflow.Ellipsis,
modifier = Modifier.padding(bottom = 8.dp),

View file

@ -16,9 +16,6 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Shadow
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextOverflow
@ -64,15 +61,7 @@ fun MovieDetailsHeader(
Text(
text = movie.name ?: "",
color = MaterialTheme.colorScheme.onSurface,
style =
MaterialTheme.typography.displayMedium.copy(
shadow =
Shadow(
color = Color.DarkGray,
offset = Offset(5f, 2f),
blurRadius = 2f,
),
),
style = MaterialTheme.typography.displayMedium,
maxLines = 2,
overflow = TextOverflow.Ellipsis,
)

View file

@ -55,8 +55,8 @@ fun FocusedEpisodeHeader(
?.let {
add(it)
}
dto.timeRemaining?.roundMinutes?.let { add("$it left") }
dto.officialRating?.let(::add)
dto.timeRemaining?.roundMinutes?.let { add("$it left") }
}
DotSeparatedRow(
texts = details,

View file

@ -263,7 +263,7 @@ fun HomePageContent(
}
Column(modifier = Modifier.fillMaxSize()) {
MainPageHeader(
HomePageHeader(
item = focusedItem,
modifier =
Modifier
@ -357,7 +357,7 @@ fun HomePageContent(
}
@Composable
fun MainPageHeader(
fun HomePageHeader(
item: BaseItem?,
modifier: Modifier = Modifier,
) {
@ -396,6 +396,7 @@ fun MainPageHeader(
dto.timeRemaining?.roundMinutes?.let {
add("$it left")
}
dto.officialRating?.let(::add)
}
title?.let {
Text(

View file

@ -143,12 +143,12 @@ fun NextUpCard(
onClick = onClick,
interactionSource = interactionSource,
) {
Box(modifier = Modifier) {
Box(modifier = Modifier.fillMaxSize()) {
AsyncImage(
model = imageUrl,
contentDescription = null,
contentScale = ContentScale.Fit,
modifier = Modifier,
modifier = Modifier.fillMaxSize(),
)
Box(

View file

@ -352,7 +352,7 @@ fun LeftPlaybackButtons(
}
}
private val speedOptions = listOf(".25", ".5", ".75", "1.0", "1.25", "1.5", "2.0")
private val speedOptions = listOf(".25", ".5", ".75", "1.0", "1.25", "1.5", "1.75", "2.0")
@Composable
fun RightPlaybackButtons(
@ -456,6 +456,7 @@ fun RightPlaybackButtons(
showOptionsDialog = false
},
onSelectChoice = { index, _ ->
onControllerInteractionForDialog.invoke()
when (index) {
0 -> showAudioDialog = true
1 -> showSpeedDialog = true

View file

@ -78,6 +78,7 @@ fun SliderPreference(
interval = preference.interval,
onChange = onChange,
color = MaterialTheme.colorScheme.border,
enableWrapAround = false,
interactionSource = interactionSource,
modifier = Modifier.weight(1f),
)