some tweaks to media details page

This commit is contained in:
Owen LeJeune
2023-05-30 21:43:37 -04:00
parent 269acf707e
commit 2e68e9fa68
2 changed files with 23 additions and 16 deletions

View File

@@ -49,10 +49,10 @@ fun ContentCard(
Card( Card(
modifier = modifier modifier = modifier
.fillMaxWidth() .fillMaxWidth()
.wrapContentHeight() .wrapContentHeight(),
.background(color = backgroundColor),
shape = RoundedCornerShape(10.dp), shape = RoundedCornerShape(10.dp),
elevation = CardDefaults.cardElevation(defaultElevation = 8.dp) elevation = CardDefaults.cardElevation(defaultElevation = 8.dp),
colors = CardDefaults.cardColors(containerColor = backgroundColor)
) { ) {
Column(modifier = Modifier.fillMaxSize()) { Column(modifier = Modifier.fillMaxSize()) {
title?.let { title?.let {
@@ -85,7 +85,6 @@ fun ExpandableContentCard(
modifier = modifier modifier = modifier
.fillMaxWidth() .fillMaxWidth()
.wrapContentHeight() .wrapContentHeight()
.background(color = backgroundColor)
.animateContentSize( .animateContentSize(
animationSpec = tween( animationSpec = tween(
durationMillis = 300, durationMillis = 300,
@@ -93,7 +92,8 @@ fun ExpandableContentCard(
) )
), ),
shape = RoundedCornerShape(10.dp), shape = RoundedCornerShape(10.dp),
elevation = CardDefaults.cardElevation(defaultElevation = 8.dp) elevation = CardDefaults.cardElevation(defaultElevation = 8.dp),
colors = CardDefaults.cardColors(containerColor = backgroundColor)
) { ) {
Column(modifier = Modifier.fillMaxSize()) { Column(modifier = Modifier.fillMaxSize()) {
title() title()

View File

@@ -619,7 +619,12 @@ private fun RatingDialog(showDialog: MutableState<Boolean>, rating: Float, onVal
} }
@Composable @Composable
private fun OverviewCard(itemId: Int?, mediaItem: MutableState<DetailedItem?>, service: DetailService, modifier: Modifier = Modifier) { private fun OverviewCard(
modifier: Modifier = Modifier,
itemId: Int?,
mediaItem: MutableState<DetailedItem?>,
service: DetailService
) {
val keywordResponse = remember { mutableStateOf<KeywordsResponse?>(null) } val keywordResponse = remember { mutableStateOf<KeywordsResponse?>(null) }
if (itemId != null) { if (itemId != null) {
if (keywordResponse.value == null) { if (keywordResponse.value == null) {
@@ -639,12 +644,14 @@ private fun OverviewCard(itemId: Int?, mediaItem: MutableState<DetailedItem?>, s
verticalArrangement = Arrangement.spacedBy(8.dp) verticalArrangement = Arrangement.spacedBy(8.dp)
) { ) {
mi.tagline?.let { tagline -> mi.tagline?.let { tagline ->
Text( if (tagline.isNotEmpty()) {
text = tagline, Text(
color = MaterialTheme.colorScheme.primary, text = tagline,
style = MaterialTheme.typography.bodyLarge, color = MaterialTheme.colorScheme.primary,
fontStyle = FontStyle.Italic, style = MaterialTheme.typography.bodyLarge,
) fontStyle = FontStyle.Italic,
)
}
} }
Text( Text(
text = mi.overview ?: "", text = mi.overview ?: "",
@@ -718,7 +725,7 @@ private fun AdditionalDetailsCard(
subtext = mi.productionCountries.joinToString(separator = ", ") { it.name }, subtext = mi.productionCountries.joinToString(separator = ", ") { it.name },
) )
if (type == MediaViewType.MOVIE) { if (type == MediaViewType.MOVIE) {
AdditionalTvItems(movie = mi as DetailedMovie) AdditionalMovieItems(movie = mi as DetailedMovie)
} else { } else {
AdditionalTvItems(tv = mi as DetailedTv) AdditionalTvItems(tv = mi as DetailedTv)
} }
@@ -728,16 +735,16 @@ private fun AdditionalDetailsCard(
} }
@Composable @Composable
private fun AdditionalTvItems( private fun AdditionalMovieItems(
movie: DetailedMovie movie: DetailedMovie
) { ) {
AdditionalDetailItem( AdditionalDetailItem(
title = stringResource(R.string.movie_budget_title), title = stringResource(R.string.movie_budget_title),
subtext = "$${movie.budget}" subtext = "$${"%,d".format(movie.budget)}"
) )
AdditionalDetailItem( AdditionalDetailItem(
title = stringResource(R.string.movie_revenue_title), title = stringResource(R.string.movie_revenue_title),
subtext = "$${movie.revenue}", subtext = "$${"%,d".format(movie.revenue)}",
includeDivider = movie.collection != null includeDivider = movie.collection != null
) )
movie.collection?.let { movie.collection?.let {