Skip to content

Commit

Permalink
Replace ThemePreviews with @PreviewLightDark.
Browse files Browse the repository at this point in the history
  • Loading branch information
ychescale9 committed Dec 1, 2023
1 parent 785be05 commit b4bf0c2
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.PreviewLightDark
import androidx.compose.ui.unit.dp
import coil.compose.AsyncImage
import io.github.reactivecircus.kstreamlined.android.designsystem.ThemePreviews
import io.github.reactivecircus.kstreamlined.android.designsystem.component.IconButton
import io.github.reactivecircus.kstreamlined.android.designsystem.component.Surface
import io.github.reactivecircus.kstreamlined.android.designsystem.component.Text
Expand Down Expand Up @@ -91,7 +91,7 @@ public fun KotlinBlogCard(
private val ImageHeight = 200.dp

@Composable
@ThemePreviews
@PreviewLightDark
private fun PreviewKotlinBlogCard_unsaved() {
KSTheme {
Surface {
Expand All @@ -113,7 +113,7 @@ private fun PreviewKotlinBlogCard_unsaved() {
}

@Composable
@ThemePreviews
@PreviewLightDark
private fun PreviewKotlinBlogCard_saved() {
KSTheme {
Surface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import androidx.compose.ui.geometry.CornerRadius
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.PreviewLightDark
import androidx.compose.ui.unit.dp
import io.github.reactivecircus.kstreamlined.android.designsystem.ThemePreviews
import io.github.reactivecircus.kstreamlined.android.designsystem.component.IconButton
import io.github.reactivecircus.kstreamlined.android.designsystem.component.Surface
import io.github.reactivecircus.kstreamlined.android.designsystem.component.Text
Expand Down Expand Up @@ -88,7 +88,7 @@ public fun KotlinWeeklyCard(
}

@Composable
@ThemePreviews
@PreviewLightDark
private fun PreviewKotlinWeeklyCard_unsaved() {
KSTheme {
Surface {
Expand All @@ -109,7 +109,7 @@ private fun PreviewKotlinWeeklyCard_unsaved() {
}

@Composable
@ThemePreviews
@PreviewLightDark
private fun PreviewKotlinWeeklyCard_saved() {
KSTheme {
Surface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.PreviewLightDark
import androidx.compose.ui.unit.dp
import coil.compose.AsyncImage
import io.github.reactivecircus.kstreamlined.android.designsystem.ThemePreviews
import io.github.reactivecircus.kstreamlined.android.designsystem.component.Icon
import io.github.reactivecircus.kstreamlined.android.designsystem.component.IconButton
import io.github.reactivecircus.kstreamlined.android.designsystem.component.Surface
Expand Down Expand Up @@ -139,7 +139,7 @@ private fun PlayIconOverlay(
private val ImageHeight = 200.dp

@Composable
@ThemePreviews
@PreviewLightDark
private fun PreviewKotlinYouTubeCard_unsaved() {
KSTheme {
Surface {
Expand All @@ -162,7 +162,7 @@ private fun PreviewKotlinYouTubeCard_unsaved() {
}

@Composable
@ThemePreviews
@PreviewLightDark
private fun PreviewKotlinYouTubeCard_saved() {
KSTheme {
Surface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.PreviewLightDark
import androidx.compose.ui.unit.dp
import coil.compose.AsyncImage
import io.github.reactivecircus.kstreamlined.android.designsystem.ThemePreviews
import io.github.reactivecircus.kstreamlined.android.designsystem.component.IconButton
import io.github.reactivecircus.kstreamlined.android.designsystem.component.Surface
import io.github.reactivecircus.kstreamlined.android.designsystem.component.Text
Expand Down Expand Up @@ -89,7 +89,7 @@ public fun TalkingKotlinCard(
}

@Composable
@ThemePreviews
@PreviewLightDark
private fun PreviewTalkingKotlinCard_unsaved() {
KSTheme {
Surface {
Expand All @@ -111,7 +111,7 @@ private fun PreviewTalkingKotlinCard_unsaved() {
}

@Composable
@ThemePreviews
@PreviewLightDark
private fun PreviewTalkingKotlinCard_saved() {
KSTheme {
Surface {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.PreviewLightDark
import androidx.compose.ui.unit.dp
import io.github.reactivecircus.kstreamlined.android.designsystem.ThemePreviews
import io.github.reactivecircus.kstreamlined.android.designsystem.foundation.KSTheme
import io.github.reactivecircus.kstreamlined.android.designsystem.foundation.icon.KSIcons

Expand Down Expand Up @@ -44,7 +44,7 @@ public fun Chip(
}

@Composable
@ThemePreviews
@PreviewLightDark
private fun PreviewChip() {
KSTheme {
Surface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import androidx.compose.runtime.NonRestartableComposable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.PreviewLightDark
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import io.github.reactivecircus.kstreamlined.android.designsystem.ThemePreviews
import io.github.reactivecircus.kstreamlined.android.designsystem.foundation.KSTheme
import androidx.compose.material3.HorizontalDivider as MaterialHorizontalDivider
import androidx.compose.material3.VerticalDivider as MaterialVerticalDivider
Expand Down Expand Up @@ -47,7 +47,7 @@ public fun VerticalDivider(
}

@Composable
@ThemePreviews
@PreviewLightDark
private fun PreviewHorizontalDivider() {
KSTheme {
Surface {
Expand All @@ -67,7 +67,7 @@ private fun PreviewHorizontalDivider() {
}

@Composable
@ThemePreviews
@PreviewLightDark
private fun PreviewVerticalDivider() {
KSTheme {
Surface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.semantics.Role
import androidx.compose.ui.semantics.role
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.tooling.preview.PreviewLightDark
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import io.github.reactivecircus.kstreamlined.android.designsystem.ThemePreviews
import io.github.reactivecircus.kstreamlined.android.designsystem.foundation.KSTheme
import io.github.reactivecircus.kstreamlined.android.designsystem.foundation.color.LocalContentColor
import io.github.reactivecircus.kstreamlined.android.designsystem.foundation.icon.BookmarkAdd
Expand Down Expand Up @@ -155,7 +155,7 @@ private val LargeIconSize = 32.dp
private val LargeContainerSize = 48.dp

@Composable
@ThemePreviews
@PreviewLightDark
private fun PreviewIconButton() {
KSTheme {
Surface {
Expand All @@ -170,7 +170,7 @@ private fun PreviewIconButton() {
}

@Composable
@ThemePreviews
@PreviewLightDark
private fun PreviewLargeIconButton() {
KSTheme {
Surface {
Expand All @@ -185,7 +185,7 @@ private fun PreviewLargeIconButton() {
}

@Composable
@ThemePreviews
@PreviewLightDark
private fun PreviewFilledIconButton() {
KSTheme {
Surface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import androidx.compose.ui.graphics.Shader
import androidx.compose.ui.graphics.ShaderBrush
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.PreviewLightDark
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import io.github.reactivecircus.kstreamlined.android.designsystem.ThemePreviews
import io.github.reactivecircus.kstreamlined.android.designsystem.foundation.KSTheme
import io.github.reactivecircus.kstreamlined.android.designsystem.foundation.icon.KSIcons

Expand Down Expand Up @@ -118,7 +118,7 @@ private fun GradientTitle(
private const val GradientHorizontalScale = 1.3f

@Composable
@ThemePreviews
@PreviewLightDark
private fun PreviewTopNavBar() {
KSTheme {
Surface {
Expand All @@ -137,7 +137,7 @@ private fun PreviewTopNavBar() {
}

@Composable
@ThemePreviews
@PreviewLightDark
private fun PreviewTopNavBar_withBottomRow() {
KSTheme {
Surface {
Expand Down Expand Up @@ -171,7 +171,7 @@ private fun PreviewTopNavBar_withBottomRow() {
}

@Composable
@ThemePreviews
@PreviewLightDark
private fun PreviewTopNavBar_withNavigationIcon() {
KSTheme {
Surface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.PreviewLightDark
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import io.github.reactivecircus.kstreamlined.android.designsystem.ThemePreviews
import io.github.reactivecircus.kstreamlined.android.designsystem.component.Chip
import io.github.reactivecircus.kstreamlined.android.designsystem.component.Icon
import io.github.reactivecircus.kstreamlined.android.designsystem.component.Surface
Expand Down Expand Up @@ -39,7 +39,7 @@ internal fun FeedFilterChip(
}

@Composable
@ThemePreviews
@PreviewLightDark
private fun PreviewFeedFilterChip() {
KSTheme {
Surface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.rotate
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.PreviewLightDark
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import io.github.reactivecircus.kstreamlined.android.designsystem.ThemePreviews
import io.github.reactivecircus.kstreamlined.android.designsystem.component.Chip
import io.github.reactivecircus.kstreamlined.android.designsystem.component.Icon
import io.github.reactivecircus.kstreamlined.android.designsystem.component.Surface
Expand Down Expand Up @@ -84,7 +84,7 @@ internal fun SyncButton(
private const val AnimationDurationMillis = 1000

@Composable
@ThemePreviews
@PreviewLightDark
private fun PreviewSyncButton() {
KSTheme {
Surface {
Expand Down
2 changes: 1 addition & 1 deletion detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ style:
UnusedPrivateMember:
ignoreAnnotated:
- Preview
- ThemePreviews
- PreviewLightDark

0 comments on commit b4bf0c2

Please sign in to comment.