mirror of
https://github.com/owenlejeune/TVTime.git
synced 2025-11-19 10:11:13 -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()
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,8 +12,13 @@
|
||||
<string name="nav_upcoming_title">Upcoming</string>
|
||||
<string name="nav_tv_airing_today_title">Airing Today</string>
|
||||
<string name="nav_tv_on_the_air">On The Air</string>
|
||||
<string name="nav_account_title">Account</string>
|
||||
<string name="nav_rated_movies_title">Rated Movies</string>
|
||||
<string name="nav_rated_shows_title">Rated TV Shows</string>
|
||||
<string name="nav_rated_episodes_title">Rated TV Episodes</string>
|
||||
<string name="nav_people_title">People</string>
|
||||
|
||||
<!-- -->
|
||||
<!-- Headings -->
|
||||
<string name="cast_label">Cast</string>
|
||||
<string name="recommended_label">Recommended</string>
|
||||
<string name="videos_label">Videos</string>
|
||||
@@ -48,14 +53,24 @@
|
||||
<string name="video_type_teaser">Teasers</string>
|
||||
<string name="video_type_behind_the_scenes">Behind the Scenes</string>
|
||||
<string name="video_type_featureette">Featurettes</string>
|
||||
|
||||
<string name="content_description_back_button">Back</string>
|
||||
<string name="search_icon_content_descriptor">Search Icon</string>
|
||||
|
||||
<string name="rating_dialog_title">Add a Rating</string>
|
||||
<string name="rating_dialog_confirm">Submit rating</string>
|
||||
|
||||
<string name="action_cancel">Cancel</string>
|
||||
<string name="nav_account_title">Account</string>
|
||||
<string name="nav_rated_movies_title">Rated Movies</string>
|
||||
<string name="nav_rated_shows_title">Rated TV Shows</string>
|
||||
<string name="nav_rated_episodes_title">Rated TV Episodes</string>
|
||||
<string name="nav_people_title">People</string>
|
||||
|
||||
<!-- status -->
|
||||
<string name="status_rumoured">Rumoured</string>
|
||||
<string name="status_planned">Planned</string>
|
||||
<string name="status_in_production">In Production</string>
|
||||
<string name="status_post_production">Post Production</string>
|
||||
<string name="status_released">Released</string>
|
||||
<string name="status_canceled">Canceled</string>
|
||||
<string name="status_returning_series">Returning Series</string>
|
||||
<string name="status_ended">Ended</string>
|
||||
<string name="status_pilot">Pilot</string>
|
||||
<string name="status_active">Active</string>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user