Skip to content

Commit

Permalink
fix: show english content names as fallback values when general name …
Browse files Browse the repository at this point in the history
…is blank
  • Loading branch information
urFate committed Jul 2, 2024
1 parent 37fd14c commit 6591dca
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ fun Resource(

Text(
modifier = Modifier.padding(16.dp, 0.dp),
text = content.name,
text = content.name.ifBlank { content.enName },
fontSize = 22.sp,
fontWeight = FontWeight.W800
)
Expand Down Expand Up @@ -578,7 +578,7 @@ fun Resource(
contentPadding = PaddingValues(16.dp)
) {
items(relations) {
ContentCard(
BaseCard(
modifier = Modifier.size(150.dp, 210.dp),
title = it.name.ifBlank { it.enName },
image = it.image,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,17 @@ fun SearchScreen() {
if (text.isEmpty()) {
items(searchHistory) {
if (it.isNotEmpty()) {
androidx.compose.material3.ListItem(modifier = Modifier.clickable {
androidx.compose.material3.ListItem(
modifier = Modifier.clickable {
text = it
}, headlineContent = {
Text(it)
}, leadingContent = {
Icon(imageVector = Icons.Default.History, contentDescription = null)
})
},
headlineContent = {
Text(it)
},
leadingContent = {
Icon(imageVector = Icons.Default.History, contentDescription = null)
},
)
}
}
return@LazyColumn
Expand Down Expand Up @@ -225,9 +229,16 @@ fun SearchScreen() {
ListItem(
headlineContent = {
Text(
text = it.name, fontWeight = FontWeight.Bold
text = it.name.ifBlank { it.enName }, fontWeight = FontWeight.Bold
)
},
supportingString = "${it.releaseYear}, ${
ValuesHelper.decodeKind(
it.kind,
context
)
}, supportingString = "${it.releaseYear}, ${ValuesHelper.decodeKind(it.kind, context)}", coverImage = it.image
}",
coverImage = it.image
) {
context.startActivity(Intent(
context, ResourceActivity::class.java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ internal fun TrendingFeed(
items(contents) {
BaseCard(
modifier = Modifier.size(cardWidth.dp, 220.dp),
title = it.name, image = it.image, type = it.type
title = it.name.ifBlank { it.enName }, image = it.image, type = it.type
) {
context.startActivity(
Intent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ fun History(
ListItem(
headlineContent = {
Text(
text = contentEntity.name,
text = contentEntity.name.ifBlank { contentEntity.enName },
fontWeight = FontWeight.Medium,
maxLines = 2,
overflow = TextOverflow.Ellipsis
Expand Down

0 comments on commit 6591dca

Please sign in to comment.