mirror of
https://github.com/owenlejeune/TVTime.git
synced 2025-11-22 11:40:54 -05:00
add tagline to details
This commit is contained in:
@@ -1,26 +1,27 @@
|
||||
package com.owenlejeune.tvtime.api.tmdb.model
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import com.owenlejeune.tvtime.R
|
||||
|
||||
enum class Status {
|
||||
enum class Status(val stringRes: Int) {
|
||||
@SerializedName("Rumoured")
|
||||
RUMOURED,
|
||||
RUMOURED(R.string.status_rumoured),
|
||||
@SerializedName("Planned")
|
||||
PLANNED,
|
||||
PLANNED(R.string.status_planned),
|
||||
@SerializedName("In Production")
|
||||
IN_PRODUCTION,
|
||||
IN_PRODUCTION(R.string.status_in_production),
|
||||
@SerializedName("Post Production")
|
||||
POST_PRODUCTION,
|
||||
POST_PRODUCTION(R.string.status_post_production),
|
||||
@SerializedName("Released")
|
||||
RELEASED,
|
||||
RELEASED(R.string.status_released),
|
||||
@SerializedName("Canceled")
|
||||
CANCELED,
|
||||
CANCELED(R.string.status_canceled),
|
||||
@SerializedName("Returning Series")
|
||||
RETURNING_SERIES,
|
||||
RETURNING_SERIES(R.string.status_returning_series),
|
||||
@SerializedName("Ended")
|
||||
ENDED,
|
||||
ENDED(R.string.status_ended),
|
||||
@SerializedName("Pilot")
|
||||
PILOT,
|
||||
PILOT(R.string.status_pilot),
|
||||
@SerializedName("Active")
|
||||
ACTIVE
|
||||
ACTIVE(R.string.status_active)
|
||||
}
|
||||
@@ -20,6 +20,7 @@ import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.ColorFilter
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.font.FontStyle
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
@@ -412,8 +413,8 @@ private fun ContentColumn(
|
||||
MiscTvDetails(mediaItem = mediaItem, service as TvService)
|
||||
}
|
||||
|
||||
if (mediaItem.value?.overview?.isNotEmpty() == true) {
|
||||
OverviewCard(itemId = itemId!!, mediaItem.value!!.overview!!, service)
|
||||
if (itemId != null && mediaItem.value != null) {
|
||||
OverviewCard(itemId = itemId, mediaItem.value!!, service)
|
||||
}
|
||||
|
||||
CastCard(itemId = itemId, service = service, appNavController = appNavController)
|
||||
@@ -664,41 +665,51 @@ private fun RatingDialog(showDialog: MutableState<Boolean>, onValueConfirmed: (F
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun OverviewCard(itemId: Int, overview: String, service: DetailService, modifier: Modifier = Modifier) {
|
||||
private fun OverviewCard(itemId: Int, mediaItem: DetailedItem, service: DetailService, modifier: Modifier = Modifier) {
|
||||
val keywordResponse = remember { mutableStateOf<KeywordsResponse?>(null) }
|
||||
if (keywordResponse.value == null) {
|
||||
fetchKeywords(itemId, service, keywordResponse)
|
||||
}
|
||||
val context = LocalContext.current
|
||||
|
||||
ContentCard(
|
||||
modifier = modifier
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.wrapContentHeight()
|
||||
.padding(vertical = 12.dp, horizontal = 16.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp)
|
||||
mediaItem.overview?.let { overview ->
|
||||
ContentCard(
|
||||
modifier = modifier
|
||||
) {
|
||||
Text(
|
||||
text = overview,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
)
|
||||
|
||||
|
||||
keywordResponse.value?.keywords?.let { keywords ->
|
||||
val names = keywords.map { it.name }
|
||||
ChipGroup(
|
||||
chips = names,
|
||||
chipStyle = ChipStyle.Rounded,
|
||||
onSelectedChanged = { chip ->
|
||||
if (service is MoviesService) {
|
||||
// Toast.makeText(context, chip, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.wrapContentHeight()
|
||||
.padding(vertical = 12.dp, horizontal = 16.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp)
|
||||
) {
|
||||
mediaItem.tagline?.let { tagline ->
|
||||
Text(
|
||||
text = tagline,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
fontStyle = FontStyle.Italic
|
||||
)
|
||||
}
|
||||
Text(
|
||||
text = overview,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
)
|
||||
|
||||
|
||||
keywordResponse.value?.keywords?.let { keywords ->
|
||||
val names = keywords.map { it.name }
|
||||
ChipGroup(
|
||||
chips = names,
|
||||
chipStyle = ChipStyle.Rounded,
|
||||
onSelectedChanged = { chip ->
|
||||
if (service is MoviesService) {
|
||||
// Toast.makeText(context, chip, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user