mirror of
https://github.com/owenlejeune/TVTime.git
synced 2025-12-30 11:21:20 -05:00
some tweaks to media details page
This commit is contained in:
@@ -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()
|
||||||
|
|||||||
@@ -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,6 +644,7 @@ 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 ->
|
||||||
|
if (tagline.isNotEmpty()) {
|
||||||
Text(
|
Text(
|
||||||
text = tagline,
|
text = tagline,
|
||||||
color = MaterialTheme.colorScheme.primary,
|
color = MaterialTheme.colorScheme.primary,
|
||||||
@@ -646,6 +652,7 @@ private fun OverviewCard(itemId: Int?, mediaItem: MutableState<DetailedItem?>, s
|
|||||||
fontStyle = FontStyle.Italic,
|
fontStyle = FontStyle.Italic,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Text(
|
Text(
|
||||||
text = mi.overview ?: "",
|
text = mi.overview ?: "",
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user