Add preview for NotificationAction having just one label

This commit is contained in:
tobigr committed 2026-11-15 20:34:14 +01:00
1 parent 33954fa1f7
commit f04aecfc2d
1 file changed
+14 -1
@@ -41,6 +41,7 @@ import net.newpipe.app.preview.ThemePreviewProvider
import newpipe.shared.generated.resources.Res
import newpipe.shared.generated.resources.cancel
import newpipe.shared.generated.resources.notification_action_0_title
import newpipe.shared.generated.resources.notification_action_3_title
import org.jetbrains.compose.resources.painterResource
import org.jetbrains.compose.resources.stringResource
@@ -149,7 +150,7 @@ private fun NotificationAction.title(): String = labels
@PreviewWrapper(ThemePreviewProvider::class)
@PreviewLightDark
@Composable
private fun NotificationActionSlotPreview() {
private fun NotificationActionSlotPreviewWithMultipleLabels() {
NotificationActionSlot(
title = stringResource(Res.string.notification_action_0_title),
action = NotificationAction.SMART_REWIND_PREVIOUS,
@@ -157,3 +158,15 @@ private fun NotificationActionSlotPreview() {
compact = true
)
}
@PreviewWrapper(ThemePreviewProvider::class)
@PreviewLightDark
@Composable
private fun NotificationActionSlotPreviewWithSingleLabel() {
NotificationActionSlot(
title = stringResource(Res.string.notification_action_3_title),
action = NotificationAction.REPEAT,
onActionChange = {},
compact = false
)
}