Skip to content

Commit

Permalink
fix: naming of playlist localization
Browse files Browse the repository at this point in the history
  • Loading branch information
Malopieds committed Jun 28, 2024
1 parent 4cf2445 commit fedad12
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 18 deletions.
47 changes: 30 additions & 17 deletions app/src/main/java/com/malopieds/innertune/ui/component/Items.kt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.pluralStringResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
Expand Down Expand Up @@ -112,15 +113,15 @@ inline fun ListItem(
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = if (isActive)
modifier
.height(ListItemHeight)
.padding(horizontal = 8.dp)
.clip(RoundedCornerShape(8.dp))
.background(color = MaterialTheme.colorScheme.secondaryContainer)
modifier
.height(ListItemHeight)
.padding(horizontal = 8.dp)
.clip(RoundedCornerShape(8.dp))
.background(color = MaterialTheme.colorScheme.secondaryContainer)
else
modifier
.height(ListItemHeight)
.padding(horizontal = 8.dp)
modifier
.height(ListItemHeight)
.padding(horizontal = 8.dp)
) {
Box(
modifier = Modifier.padding(6.dp),
Expand Down Expand Up @@ -905,16 +906,22 @@ fun PlaylistListItem(
playlist: Playlist,
modifier: Modifier = Modifier,
trailingContent: @Composable RowScope.() -> Unit = {},
autoPlaylist: Boolean = true,
autoPlaylist: Boolean = false,
) = ListItem(
title = playlist.playlist.name,
subtitle = if (autoPlaylist) "" else pluralStringResource(R.plurals.n_song, playlist.songCount, playlist.songCount),
thumbnailContent = {
val painter = when (playlist.playlist.name) {
"Liked" -> R.drawable.favorite
"Offline" -> R.drawable.offline
"My Top 50" -> R.drawable.trending_up
else -> R.drawable.queue_music
stringResource(R.string.liked) -> R.drawable.favorite
stringResource(R.string.offline) -> R.drawable.offline
else -> {
println(playlist.playlist.name + " " + autoPlaylist)
if (autoPlaylist){
R.drawable.trending_up
} else {
R.drawable.queue_music
}
}
}
when (playlist.thumbnails.size) {
0 -> Icon(
Expand Down Expand Up @@ -972,10 +979,16 @@ fun PlaylistGridItem(
badges = badges,
thumbnailContent = {
val painter = when (playlist.playlist.name) {
"Liked" -> R.drawable.favorite
"Offline" -> R.drawable.offline
"My Top 50" -> R.drawable.trending_up
else -> R.drawable.queue_music
stringResource(R.string.liked) -> R.drawable.favorite
stringResource(R.string.offline) -> R.drawable.offline
else -> {
println(playlist.playlist.name + " " + autoPlaylist)
if (autoPlaylist){
R.drawable.trending_up
} else {
R.drawable.queue_music
}
}
}
val width = maxWidth
when (playlist.thumbnails.size) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ fun LibraryPlaylistsScreen(
)

val topPlaylist = Playlist(
playlist = PlaylistEntity(id = UUID.randomUUID().toString(), name = stringResource(R.string.liked) + " $topSize"),
playlist = PlaylistEntity(id = UUID.randomUUID().toString(), name = stringResource(R.string.my_top) + " $topSize"),
songCount = 0,
thumbnails = emptyList()
)
Expand Down

0 comments on commit fedad12

Please sign in to comment.