From 3a7ffe23846c9fb187384109ae20131d42451687 Mon Sep 17 00:00:00 2001 From: pengcon Date: Sat, 18 Jan 2025 11:09:13 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EC=BB=B4=ED=8F=AC=EB=84=8C?= =?UTF-8?q?=ED=8A=B8=EC=97=90=20PreviewKoLightDarkBackground=20=EC=96=B4?= =?UTF-8?q?=EB=85=B8=ED=85=8C=EC=9D=B4=EC=85=98=20=EC=A0=81=EC=9A=A9=20(#1?= =?UTF-8?q?96)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../course/quiz/component/QuizSolveTimeSlider.kt | 7 ++----- .../boostcamp_2024/course/quiz/component/QuizTopAppBar.kt | 7 ++----- .../course/quiz/component/RadioTextButton.kt | 4 ++-- .../course/quiz/component/RealTimeQuestion.kt | 7 ++----- .../course/quiz/component/RealTimeQuizGuideContent.kt | 7 ++----- 5 files changed, 10 insertions(+), 22 deletions(-) diff --git a/feature/quiz/src/main/java/kr/boostcamp_2024/course/quiz/component/QuizSolveTimeSlider.kt b/feature/quiz/src/main/java/kr/boostcamp_2024/course/quiz/component/QuizSolveTimeSlider.kt index 05e46464..59cdd951 100644 --- a/feature/quiz/src/main/java/kr/boostcamp_2024/course/quiz/component/QuizSolveTimeSlider.kt +++ b/feature/quiz/src/main/java/kr/boostcamp_2024/course/quiz/component/QuizSolveTimeSlider.kt @@ -1,7 +1,5 @@ package kr.boostcamp_2024.course.quiz.component -import android.content.res.Configuration.UI_MODE_NIGHT_YES -import android.content.res.Configuration.UI_MODE_TYPE_NORMAL import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.defaultMinSize @@ -15,8 +13,8 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.text.style.TextAlign -import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp +import kr.boostcamp_2024.course.designsystem.ui.annotation.PreviewKoLightDarkBackground @OptIn(ExperimentalMaterial3Api::class) @Composable @@ -50,8 +48,7 @@ internal fun QuizSolveTimeSlider( ) } -@Preview(showBackground = true, locale = "ko") -@Preview(uiMode = UI_MODE_NIGHT_YES or UI_MODE_TYPE_NORMAL, locale = "ko") +@PreviewKoLightDarkBackground @Composable private fun QuizSolveTimeSliderPreview() { QuizSolveTimeSlider( diff --git a/feature/quiz/src/main/java/kr/boostcamp_2024/course/quiz/component/QuizTopAppBar.kt b/feature/quiz/src/main/java/kr/boostcamp_2024/course/quiz/component/QuizTopAppBar.kt index 5ccfd733..0e27469b 100644 --- a/feature/quiz/src/main/java/kr/boostcamp_2024/course/quiz/component/QuizTopAppBar.kt +++ b/feature/quiz/src/main/java/kr/boostcamp_2024/course/quiz/component/QuizTopAppBar.kt @@ -1,7 +1,5 @@ package kr.boostcamp_2024.course.quiz.component -import android.content.res.Configuration.UI_MODE_NIGHT_YES -import android.content.res.Configuration.UI_MODE_TYPE_NORMAL import androidx.activity.compose.BackHandler import androidx.compose.foundation.background import androidx.compose.material.icons.Icons @@ -25,7 +23,7 @@ import androidx.compose.ui.graphics.Brush import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource -import androidx.compose.ui.tooling.preview.Preview +import kr.boostcamp_2024.course.designsystem.ui.annotation.PreviewKoLightDarkBackground import kr.boostcamp_2024.course.designsystem.ui.theme.component.WeQuizBaseDialog import kr.boostcamp_2024.course.domain.model.BaseQuiz import kr.boostcamp_2024.course.domain.model.Category @@ -132,8 +130,7 @@ internal fun QuizTopAppBar( } -@Preview(showBackground = true, locale = "ko") -@Preview(uiMode = UI_MODE_NIGHT_YES or UI_MODE_TYPE_NORMAL, locale = "ko") +@PreviewKoLightDarkBackground @Composable private fun QuizTopAppBarPreview() { QuizTopAppBar( diff --git a/feature/quiz/src/main/java/kr/boostcamp_2024/course/quiz/component/RadioTextButton.kt b/feature/quiz/src/main/java/kr/boostcamp_2024/course/quiz/component/RadioTextButton.kt index 0bbe16d5..649f3c7d 100644 --- a/feature/quiz/src/main/java/kr/boostcamp_2024/course/quiz/component/RadioTextButton.kt +++ b/feature/quiz/src/main/java/kr/boostcamp_2024/course/quiz/component/RadioTextButton.kt @@ -10,8 +10,8 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp +import kr.boostcamp_2024.course.designsystem.ui.annotation.PreviewKoLightDarkBackground @Composable internal fun RadioTextButton( @@ -44,7 +44,7 @@ internal fun RadioTextButton( -@Preview(showBackground = true, locale = "ko") +@PreviewKoLightDarkBackground @Composable private fun RadioTextButtonPreview() { RadioTextButton( diff --git a/feature/quiz/src/main/java/kr/boostcamp_2024/course/quiz/component/RealTimeQuestion.kt b/feature/quiz/src/main/java/kr/boostcamp_2024/course/quiz/component/RealTimeQuestion.kt index aeda4801..64477b6d 100644 --- a/feature/quiz/src/main/java/kr/boostcamp_2024/course/quiz/component/RealTimeQuestion.kt +++ b/feature/quiz/src/main/java/kr/boostcamp_2024/course/quiz/component/RealTimeQuestion.kt @@ -1,7 +1,5 @@ package kr.boostcamp_2024.course.quiz.component -import android.content.res.Configuration.UI_MODE_NIGHT_YES -import android.content.res.Configuration.UI_MODE_TYPE_NORMAL import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row @@ -13,8 +11,8 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp +import kr.boostcamp_2024.course.designsystem.ui.annotation.PreviewKoLightDarkBackground @Composable internal fun RealTimeQuestion( @@ -53,8 +51,7 @@ internal fun RealTimeQuestion( } } -@Preview(showBackground = true, locale = "ko") -@Preview(uiMode = UI_MODE_NIGHT_YES or UI_MODE_TYPE_NORMAL, locale = "ko") +@PreviewKoLightDarkBackground @Composable private fun RealTimeQuestionPreview() { RealTimeQuestion( diff --git a/feature/quiz/src/main/java/kr/boostcamp_2024/course/quiz/component/RealTimeQuizGuideContent.kt b/feature/quiz/src/main/java/kr/boostcamp_2024/course/quiz/component/RealTimeQuizGuideContent.kt index 9c644f8f..5697ab10 100644 --- a/feature/quiz/src/main/java/kr/boostcamp_2024/course/quiz/component/RealTimeQuizGuideContent.kt +++ b/feature/quiz/src/main/java/kr/boostcamp_2024/course/quiz/component/RealTimeQuizGuideContent.kt @@ -1,7 +1,5 @@ package kr.boostcamp_2024.course.quiz.component -import android.content.res.Configuration.UI_MODE_NIGHT_YES -import android.content.res.Configuration.UI_MODE_TYPE_NORMAL import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row @@ -13,8 +11,8 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource -import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp +import kr.boostcamp_2024.course.designsystem.ui.annotation.PreviewKoLightDarkBackground import kr.boostcamp_2024.course.designsystem.ui.theme.component.WeQuizLocalRoundedImage import kr.boostcamp_2024.course.designsystem.ui.theme.component.WeQuizRightChatBubble import kr.boostcamp_2024.course.quiz.R @@ -56,8 +54,7 @@ internal fun RealTimeQuizGuideContent( } } -@Preview(showBackground = true, locale = "ko") -@Preview(uiMode = UI_MODE_NIGHT_YES or UI_MODE_TYPE_NORMAL, locale = "ko") +@PreviewKoLightDarkBackground @Composable private fun RealTimeQuizGuideContentPreview() { RealTimeQuizGuideContent(