Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,13 @@ object NotificationHelper {
val inboxStyle =
NotificationCompat
.InboxStyle()
.setBigContentTitle(context.getString(R.string.notification_new_videos_from_subscriptions, videos.size))
.setBigContentTitle(
context.resources.getQuantityString(
R.plurals.notification_new_videos_from_subscriptions,
videos.size,
videos.size,
),
)
videos.take(6).forEach { v ->
inboxStyle.addLine("${v.channelName}: ${v.videoTitle}")
}
Expand All @@ -547,8 +553,13 @@ object NotificationHelper {
.Builder(context, CHANNEL_SUBSCRIPTIONS)
.setSmallIcon(R.drawable.ic_notification_logo)
.setContentTitle(context.getString(R.string.notification_new_videos))
.setContentText(context.getString(R.string.notification_new_videos_from_subscriptions, videos.size))
.setContentIntent(summaryPendingIntent)
.setContentText(
context.resources.getQuantityString(
R.plurals.notification_new_videos_from_subscriptions,
videos.size,
videos.size,
),
).setContentIntent(summaryPendingIntent)
.setAutoCancel(true)
.setOnlyAlertOnce(true)
.setPriority(NotificationCompat.PRIORITY_DEFAULT)
Expand Down Expand Up @@ -651,8 +662,13 @@ object NotificationHelper {
.Builder(context, CHANNEL_SUBSCRIPTIONS)
.setSmallIcon(R.drawable.ic_notification_logo)
.setContentTitle(context.getString(R.string.notification_new_videos))
.setContentText(context.getString(R.string.notification_new_videos_from_subscriptions, videoCount))
.setGroup("new_videos")
.setContentText(
context.resources.getQuantityString(
R.plurals.notification_new_videos_from_subscriptions,
videoCount,
videoCount,
),
).setGroup("new_videos")
.setGroupSummary(true)
.setAutoCancel(true)
.setPriority(NotificationCompat.PRIORITY_DEFAULT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ object BadgeIcon {
.background(MaterialTheme.colorScheme.surfaceVariant),
) {
Text(
text = "E",
text = stringResource(R.string.explicit_badge),
style = MaterialTheme.typography.labelSmall,
fontWeight = FontWeight.Bold,
fontSize = 9.sp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.res.pluralStringResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextLayoutResult
import androidx.compose.ui.text.font.FontWeight
Expand Down Expand Up @@ -724,7 +725,11 @@ fun FlowCommentItem(
R.string.hide_replies,
)
} else {
stringResource(R.string.view_replies_template, comment.replyCount)
pluralStringResource(
R.plurals.view_replies_template,
comment.replyCount,
comment.replyCount,
)
},
color = MaterialTheme.colorScheme.primary,
style = MaterialTheme.typography.labelMedium,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ fun FlowDescriptionBottomSheet(
)
VerticalHorizontalDivider()
StatItem(
value = formatViewCount(video.viewCount).replace(" views", ""),
value = formatViewCount(video.viewCount),
label = stringResource(R.string.views),
)
VerticalHorizontalDivider()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,12 @@ fun FlowPlaylistQueueBottomSheet(
overflow = TextOverflow.Ellipsis,
)
Text(
text = "${currentQueueIndex + 1} / ${queueVideos.size}",
text =
stringResource(
R.string.queue_position_template,
currentQueueIndex + 1,
queueVideos.size,
),
style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.blur
import androidx.compose.ui.draw.clip
import androidx.compose.ui.layout.ContentScale
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.TextOverflow
Expand Down Expand Up @@ -113,7 +114,7 @@ private fun PlaylistCardContent(
it,
stringResource(R.string.playlist),
)
} ?: stringResource(R.string.videos_count_template, videoCount)
} ?: pluralStringResource(R.plurals.videos_count_template, videoCount, videoCount)

if (layout == PlaylistCardLayout.SHELF) {
Column(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fun PlaylistQueueDock(
currentIndex: Int,
queueSize: Int,
onClick: () -> Unit,
modifier: Modifier = Modifier
modifier: Modifier = Modifier,
) {
val containerColor = MaterialTheme.colorScheme.surface.copy(alpha = 0.95f)
val contentColor = MaterialTheme.colorScheme.onSurface
Expand All @@ -43,88 +43,96 @@ fun PlaylistQueueDock(
shadowElevation = 4.dp,
shape = RoundedCornerShape(16.dp),
border = BorderStroke(1.dp, MaterialTheme.colorScheme.outlineVariant.copy(alpha = 0.55f)),
modifier = modifier
.fillMaxWidth()
.padding(horizontal = 12.dp)
.safeDrawingPadding()
.height(68.dp)
.clickable(onClick = onClick)
modifier =
modifier
.fillMaxWidth()
.padding(horizontal = 12.dp)
.safeDrawingPadding()
.height(68.dp)
.clickable(onClick = onClick),
) {
Row(
modifier = Modifier
.fillMaxSize()
.padding(start = 12.dp, end = 8.dp),
verticalAlignment = Alignment.CenterVertically
modifier =
Modifier
.fillMaxSize()
.padding(start = 12.dp, end = 8.dp),
verticalAlignment = Alignment.CenterVertically,
) {
Box(
modifier = Modifier
.size(42.dp)
.background(accentContainerColor, RoundedCornerShape(12.dp))
.border(
width = 1.dp,
color = MaterialTheme.colorScheme.primary.copy(alpha = 0.18f),
shape = RoundedCornerShape(12.dp)
),
contentAlignment = Alignment.Center
modifier =
Modifier
.size(42.dp)
.background(accentContainerColor, RoundedCornerShape(12.dp))
.border(
width = 1.dp,
color = MaterialTheme.colorScheme.primary.copy(alpha = 0.18f),
shape = RoundedCornerShape(12.dp),
),
contentAlignment = Alignment.Center,
) {
Icon(
imageVector = Icons.AutoMirrored.Outlined.PlaylistPlay,
contentDescription = null,
tint = accentContentColor,
modifier = Modifier.size(24.dp)
modifier = Modifier.size(24.dp),
)
}

Spacer(modifier = Modifier.width(12.dp))

Column(
modifier = Modifier.weight(1f),
verticalArrangement = Arrangement.Center
verticalArrangement = Arrangement.Center,
) {
Text(
text = if (nextVideoTitle != null) {
stringResource(R.string.next_up) + ": " + nextVideoTitle
} else {
stringResource(R.string.playlist_queue)
},
text =
if (nextVideoTitle != null) {
stringResource(
R.string.next_up_template,
stringResource(R.string.next_up),
nextVideoTitle,
)
} else {
stringResource(R.string.playlist_queue)
},
style = MaterialTheme.typography.bodyMedium,
fontWeight = FontWeight.Bold,
color = contentColor,
maxLines = 1,
overflow = TextOverflow.Ellipsis
overflow = TextOverflow.Ellipsis,
)

Spacer(modifier = Modifier.height(2.dp))

Row(verticalAlignment = Alignment.CenterVertically) {
Text(
text = playlistName,
style = MaterialTheme.typography.labelMedium,
color = secondaryContentColor,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
modifier = Modifier.weight(1f, fill = false)
modifier = Modifier.weight(1f, fill = false),
)

Text(
text = " • ",
style = MaterialTheme.typography.labelMedium,
color = secondaryContentColor
color = secondaryContentColor,
)

Text(
text = "${currentIndex + 1}/$queueSize",
style = MaterialTheme.typography.labelMedium,
color = secondaryContentColor
color = secondaryContentColor,
)
}
}

IconButton(onClick = onClick) {
Icon(
imageVector = Icons.Default.ExpandLess,
contentDescription = stringResource(R.string.playlist_queue),
tint = contentColor
tint = contentColor,
)
}
}
Expand Down
Loading