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(
modifier = modifier
.fillMaxWidth()
.wrapContentHeight()
.background(color = backgroundColor),
.wrapContentHeight(),
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()) {
title?.let {
@@ -85,7 +85,6 @@ fun ExpandableContentCard(
modifier = modifier
.fillMaxWidth()
.wrapContentHeight()
.background(color = backgroundColor)
.animateContentSize(
animationSpec = tween(
durationMillis = 300,
@@ -93,7 +92,8 @@ fun ExpandableContentCard(
)
),
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()) {
title()

View File

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