mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 23:51:21 +02:00
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:
parent
18556b5058
commit
44825d0c25
8 changed files with 14 additions and 29 deletions
|
|
@ -33,6 +33,7 @@ fun SliderBar(
|
||||||
min: Long,
|
min: Long,
|
||||||
max: Long,
|
max: Long,
|
||||||
onChange: (Long) -> Unit,
|
onChange: (Long) -> Unit,
|
||||||
|
enableWrapAround: Boolean,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
|
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
|
||||||
interval: Int = 1,
|
interval: Int = 1,
|
||||||
|
|
@ -52,7 +53,7 @@ fun SliderBar(
|
||||||
onChange(currentValue)
|
onChange(currentValue)
|
||||||
},
|
},
|
||||||
onLeft = {
|
onLeft = {
|
||||||
if (currentValue <= min) {
|
if (enableWrapAround && currentValue <= min) {
|
||||||
currentValue = max
|
currentValue = max
|
||||||
} else {
|
} else {
|
||||||
currentValue = (currentValue - interval).coerceAtLeast(min)
|
currentValue = (currentValue - interval).coerceAtLeast(min)
|
||||||
|
|
@ -60,7 +61,7 @@ fun SliderBar(
|
||||||
onChange(currentValue)
|
onChange(currentValue)
|
||||||
},
|
},
|
||||||
onRight = {
|
onRight = {
|
||||||
if (currentValue >= max) {
|
if (enableWrapAround && currentValue >= max) {
|
||||||
currentValue = min
|
currentValue = min
|
||||||
} else {
|
} else {
|
||||||
currentValue = (currentValue + interval).coerceAtMost(max)
|
currentValue = (currentValue + interval).coerceAtMost(max)
|
||||||
|
|
|
||||||
|
|
@ -357,15 +357,7 @@ fun PersonHeader(
|
||||||
Text(
|
Text(
|
||||||
text = name,
|
text = name,
|
||||||
color = MaterialTheme.colorScheme.onSurface,
|
color = MaterialTheme.colorScheme.onSurface,
|
||||||
style =
|
style = MaterialTheme.typography.displaySmall,
|
||||||
MaterialTheme.typography.displaySmall.copy(
|
|
||||||
shadow =
|
|
||||||
Shadow(
|
|
||||||
color = Color.DarkGray,
|
|
||||||
offset = Offset(5f, 2f),
|
|
||||||
blurRadius = 2f,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
maxLines = 2,
|
maxLines = 2,
|
||||||
overflow = TextOverflow.Ellipsis,
|
overflow = TextOverflow.Ellipsis,
|
||||||
modifier = Modifier.padding(bottom = 8.dp),
|
modifier = Modifier.padding(bottom = 8.dp),
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,6 @@ import androidx.compose.runtime.remember
|
||||||
import androidx.compose.runtime.rememberCoroutineScope
|
import androidx.compose.runtime.rememberCoroutineScope
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.alpha
|
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.platform.LocalContext
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.style.TextOverflow
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
|
|
@ -64,15 +61,7 @@ fun MovieDetailsHeader(
|
||||||
Text(
|
Text(
|
||||||
text = movie.name ?: "",
|
text = movie.name ?: "",
|
||||||
color = MaterialTheme.colorScheme.onSurface,
|
color = MaterialTheme.colorScheme.onSurface,
|
||||||
style =
|
style = MaterialTheme.typography.displayMedium,
|
||||||
MaterialTheme.typography.displayMedium.copy(
|
|
||||||
shadow =
|
|
||||||
Shadow(
|
|
||||||
color = Color.DarkGray,
|
|
||||||
offset = Offset(5f, 2f),
|
|
||||||
blurRadius = 2f,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
maxLines = 2,
|
maxLines = 2,
|
||||||
overflow = TextOverflow.Ellipsis,
|
overflow = TextOverflow.Ellipsis,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -55,8 +55,8 @@ fun FocusedEpisodeHeader(
|
||||||
?.let {
|
?.let {
|
||||||
add(it)
|
add(it)
|
||||||
}
|
}
|
||||||
dto.timeRemaining?.roundMinutes?.let { add("$it left") }
|
|
||||||
dto.officialRating?.let(::add)
|
dto.officialRating?.let(::add)
|
||||||
|
dto.timeRemaining?.roundMinutes?.let { add("$it left") }
|
||||||
}
|
}
|
||||||
DotSeparatedRow(
|
DotSeparatedRow(
|
||||||
texts = details,
|
texts = details,
|
||||||
|
|
|
||||||
|
|
@ -263,7 +263,7 @@ fun HomePageContent(
|
||||||
}
|
}
|
||||||
|
|
||||||
Column(modifier = Modifier.fillMaxSize()) {
|
Column(modifier = Modifier.fillMaxSize()) {
|
||||||
MainPageHeader(
|
HomePageHeader(
|
||||||
item = focusedItem,
|
item = focusedItem,
|
||||||
modifier =
|
modifier =
|
||||||
Modifier
|
Modifier
|
||||||
|
|
@ -357,7 +357,7 @@ fun HomePageContent(
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun MainPageHeader(
|
fun HomePageHeader(
|
||||||
item: BaseItem?,
|
item: BaseItem?,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
) {
|
) {
|
||||||
|
|
@ -396,6 +396,7 @@ fun MainPageHeader(
|
||||||
dto.timeRemaining?.roundMinutes?.let {
|
dto.timeRemaining?.roundMinutes?.let {
|
||||||
add("$it left")
|
add("$it left")
|
||||||
}
|
}
|
||||||
|
dto.officialRating?.let(::add)
|
||||||
}
|
}
|
||||||
title?.let {
|
title?.let {
|
||||||
Text(
|
Text(
|
||||||
|
|
|
||||||
|
|
@ -143,12 +143,12 @@ fun NextUpCard(
|
||||||
onClick = onClick,
|
onClick = onClick,
|
||||||
interactionSource = interactionSource,
|
interactionSource = interactionSource,
|
||||||
) {
|
) {
|
||||||
Box(modifier = Modifier) {
|
Box(modifier = Modifier.fillMaxSize()) {
|
||||||
AsyncImage(
|
AsyncImage(
|
||||||
model = imageUrl,
|
model = imageUrl,
|
||||||
contentDescription = null,
|
contentDescription = null,
|
||||||
contentScale = ContentScale.Fit,
|
contentScale = ContentScale.Fit,
|
||||||
modifier = Modifier,
|
modifier = Modifier.fillMaxSize(),
|
||||||
)
|
)
|
||||||
|
|
||||||
Box(
|
Box(
|
||||||
|
|
|
||||||
|
|
@ -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
|
@Composable
|
||||||
fun RightPlaybackButtons(
|
fun RightPlaybackButtons(
|
||||||
|
|
@ -456,6 +456,7 @@ fun RightPlaybackButtons(
|
||||||
showOptionsDialog = false
|
showOptionsDialog = false
|
||||||
},
|
},
|
||||||
onSelectChoice = { index, _ ->
|
onSelectChoice = { index, _ ->
|
||||||
|
onControllerInteractionForDialog.invoke()
|
||||||
when (index) {
|
when (index) {
|
||||||
0 -> showAudioDialog = true
|
0 -> showAudioDialog = true
|
||||||
1 -> showSpeedDialog = true
|
1 -> showSpeedDialog = true
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,7 @@ fun SliderPreference(
|
||||||
interval = preference.interval,
|
interval = preference.interval,
|
||||||
onChange = onChange,
|
onChange = onChange,
|
||||||
color = MaterialTheme.colorScheme.border,
|
color = MaterialTheme.colorScheme.border,
|
||||||
|
enableWrapAround = false,
|
||||||
interactionSource = interactionSource,
|
interactionSource = interactionSource,
|
||||||
modifier = Modifier.weight(1f),
|
modifier = Modifier.weight(1f),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue