mirror of
https://github.com/owenlejeune/TVTime.git
synced 2025-11-19 18:21:19 -05:00
add tagline to details
This commit is contained in:
@@ -1,26 +1,27 @@
|
|||||||
package com.owenlejeune.tvtime.api.tmdb.model
|
package com.owenlejeune.tvtime.api.tmdb.model
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
|
import com.owenlejeune.tvtime.R
|
||||||
|
|
||||||
enum class Status {
|
enum class Status(val stringRes: Int) {
|
||||||
@SerializedName("Rumoured")
|
@SerializedName("Rumoured")
|
||||||
RUMOURED,
|
RUMOURED(R.string.status_rumoured),
|
||||||
@SerializedName("Planned")
|
@SerializedName("Planned")
|
||||||
PLANNED,
|
PLANNED(R.string.status_planned),
|
||||||
@SerializedName("In Production")
|
@SerializedName("In Production")
|
||||||
IN_PRODUCTION,
|
IN_PRODUCTION(R.string.status_in_production),
|
||||||
@SerializedName("Post Production")
|
@SerializedName("Post Production")
|
||||||
POST_PRODUCTION,
|
POST_PRODUCTION(R.string.status_post_production),
|
||||||
@SerializedName("Released")
|
@SerializedName("Released")
|
||||||
RELEASED,
|
RELEASED(R.string.status_released),
|
||||||
@SerializedName("Canceled")
|
@SerializedName("Canceled")
|
||||||
CANCELED,
|
CANCELED(R.string.status_canceled),
|
||||||
@SerializedName("Returning Series")
|
@SerializedName("Returning Series")
|
||||||
RETURNING_SERIES,
|
RETURNING_SERIES(R.string.status_returning_series),
|
||||||
@SerializedName("Ended")
|
@SerializedName("Ended")
|
||||||
ENDED,
|
ENDED(R.string.status_ended),
|
||||||
@SerializedName("Pilot")
|
@SerializedName("Pilot")
|
||||||
PILOT,
|
PILOT(R.string.status_pilot),
|
||||||
@SerializedName("Active")
|
@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.graphics.ColorFilter
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.stringResource
|
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.font.FontWeight
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
import androidx.compose.ui.text.style.TextOverflow
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
@@ -412,8 +413,8 @@ private fun ContentColumn(
|
|||||||
MiscTvDetails(mediaItem = mediaItem, service as TvService)
|
MiscTvDetails(mediaItem = mediaItem, service as TvService)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mediaItem.value?.overview?.isNotEmpty() == true) {
|
if (itemId != null && mediaItem.value != null) {
|
||||||
OverviewCard(itemId = itemId!!, mediaItem.value!!.overview!!, service)
|
OverviewCard(itemId = itemId, mediaItem.value!!, service)
|
||||||
}
|
}
|
||||||
|
|
||||||
CastCard(itemId = itemId, service = service, appNavController = appNavController)
|
CastCard(itemId = itemId, service = service, appNavController = appNavController)
|
||||||
@@ -664,41 +665,51 @@ private fun RatingDialog(showDialog: MutableState<Boolean>, onValueConfirmed: (F
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@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) }
|
val keywordResponse = remember { mutableStateOf<KeywordsResponse?>(null) }
|
||||||
if (keywordResponse.value == null) {
|
if (keywordResponse.value == null) {
|
||||||
fetchKeywords(itemId, service, keywordResponse)
|
fetchKeywords(itemId, service, keywordResponse)
|
||||||
}
|
}
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
|
|
||||||
ContentCard(
|
mediaItem.overview?.let { overview ->
|
||||||
modifier = modifier
|
ContentCard(
|
||||||
) {
|
modifier = modifier
|
||||||
Column(
|
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.wrapContentHeight()
|
|
||||||
.padding(vertical = 12.dp, horizontal = 16.dp),
|
|
||||||
verticalArrangement = Arrangement.spacedBy(8.dp)
|
|
||||||
) {
|
) {
|
||||||
Text(
|
Column(
|
||||||
text = overview,
|
modifier = Modifier
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
.fillMaxWidth()
|
||||||
style = MaterialTheme.typography.bodyMedium
|
.wrapContentHeight()
|
||||||
)
|
.padding(vertical = 12.dp, horizontal = 16.dp),
|
||||||
|
verticalArrangement = Arrangement.spacedBy(8.dp)
|
||||||
|
) {
|
||||||
keywordResponse.value?.keywords?.let { keywords ->
|
mediaItem.tagline?.let { tagline ->
|
||||||
val names = keywords.map { it.name }
|
Text(
|
||||||
ChipGroup(
|
text = tagline,
|
||||||
chips = names,
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
chipStyle = ChipStyle.Rounded,
|
style = MaterialTheme.typography.bodyLarge,
|
||||||
onSelectedChanged = { chip ->
|
fontStyle = FontStyle.Italic
|
||||||
if (service is MoviesService) {
|
)
|
||||||
// Toast.makeText(context, chip, Toast.LENGTH_SHORT).show()
|
}
|
||||||
}
|
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_upcoming_title">Upcoming</string>
|
||||||
<string name="nav_tv_airing_today_title">Airing Today</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_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="cast_label">Cast</string>
|
||||||
<string name="recommended_label">Recommended</string>
|
<string name="recommended_label">Recommended</string>
|
||||||
<string name="videos_label">Videos</string>
|
<string name="videos_label">Videos</string>
|
||||||
@@ -48,14 +53,24 @@
|
|||||||
<string name="video_type_teaser">Teasers</string>
|
<string name="video_type_teaser">Teasers</string>
|
||||||
<string name="video_type_behind_the_scenes">Behind the Scenes</string>
|
<string name="video_type_behind_the_scenes">Behind the Scenes</string>
|
||||||
<string name="video_type_featureette">Featurettes</string>
|
<string name="video_type_featureette">Featurettes</string>
|
||||||
|
|
||||||
<string name="content_description_back_button">Back</string>
|
<string name="content_description_back_button">Back</string>
|
||||||
<string name="search_icon_content_descriptor">Search Icon</string>
|
<string name="search_icon_content_descriptor">Search Icon</string>
|
||||||
|
|
||||||
<string name="rating_dialog_title">Add a Rating</string>
|
<string name="rating_dialog_title">Add a Rating</string>
|
||||||
<string name="rating_dialog_confirm">Submit rating</string>
|
<string name="rating_dialog_confirm">Submit rating</string>
|
||||||
|
|
||||||
<string name="action_cancel">Cancel</string>
|
<string name="action_cancel">Cancel</string>
|
||||||
<string name="nav_account_title">Account</string>
|
|
||||||
<string name="nav_rated_movies_title">Rated Movies</string>
|
<!-- status -->
|
||||||
<string name="nav_rated_shows_title">Rated TV Shows</string>
|
<string name="status_rumoured">Rumoured</string>
|
||||||
<string name="nav_rated_episodes_title">Rated TV Episodes</string>
|
<string name="status_planned">Planned</string>
|
||||||
<string name="nav_people_title">People</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>
|
</resources>
|
||||||
Reference in New Issue
Block a user