diff --git a/common/compose/src/main/kotlin/team/duckie/app/android/common/compose/ui/temp/TempFlexiblePrimaryLargeButton.kt b/common/compose/src/main/kotlin/team/duckie/app/android/common/compose/ui/temp/TempFlexiblePrimaryLargeButton.kt deleted file mode 100644 index 03dce6e9e..000000000 --- a/common/compose/src/main/kotlin/team/duckie/app/android/common/compose/ui/temp/TempFlexiblePrimaryLargeButton.kt +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Designed and developed by Duckie Team, 2022 - * - * Licensed under the MIT. - * Please see full license: https://github.com/duckie-team/duckie-android/blob/develop/LICENSE - */ - -package team.duckie.app.android.common.compose.ui.temp - -import androidx.compose.foundation.background -import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.heightIn -import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment -import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip -import androidx.compose.ui.unit.dp -import team.duckie.quackquack.material.QuackColor -import team.duckie.quackquack.material.QuackTypography -import team.duckie.quackquack.ui.QuackText -import team.duckie.quackquack.ui.modifier.quackClickable - -/** - * QuackPrimaryLargeButton의 크키가 조정되지 않는 오류를 대처하기 위한 임시 버튼 - * - * TODO(limsaehyun): 추후 QuackQuackV2 로 대체되어야 함 - */ -@Composable -fun TempFlexiblePrimaryLargeButton( - modifier: Modifier = Modifier, - text: String, - enabled: Boolean = true, - onClick: () -> Unit, -) { - Box( - modifier = modifier - .heightIn(44.dp) - .clip(RoundedCornerShape(8.dp)) - .background(backgroundFor(enabled)) - .quackClickable(onClick = onClickFor(enabled, onClick)), - contentAlignment = Alignment.Center, - ) { - QuackText( - text = text, - typography = QuackTypography.Subtitle.change( - color = QuackColor.White, - ), - ) - } -} - -private fun backgroundFor(enabled: Boolean) = if (enabled) { - QuackColor.DuckieOrange.value -} else { - QuackColor.Gray2.value -} - -private fun onClickFor( - enabled: Boolean, - onClick: () -> Unit, -) = if (enabled) { - onClick -} else { - null -} diff --git a/common/compose/src/main/kotlin/team/duckie/app/android/common/compose/ui/temp/TempFlexibleSecondaryLargButton.kt b/common/compose/src/main/kotlin/team/duckie/app/android/common/compose/ui/temp/TempFlexibleSecondaryLargButton.kt deleted file mode 100644 index 860c79e5e..000000000 --- a/common/compose/src/main/kotlin/team/duckie/app/android/common/compose/ui/temp/TempFlexibleSecondaryLargButton.kt +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Designed and developed by Duckie Team, 2022 - * - * Licensed under the MIT. - * Please see full license: https://github.com/duckie-team/duckie-android/blob/develop/LICENSE - */ - -package team.duckie.app.android.common.compose.ui.temp - -import androidx.compose.foundation.background -import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.heightIn -import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment -import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip -import androidx.compose.ui.unit.dp -import team.duckie.quackquack.material.QuackBorder -import team.duckie.quackquack.material.QuackColor -import team.duckie.quackquack.material.QuackTypography -import team.duckie.quackquack.material.quackBorder -import team.duckie.quackquack.ui.QuackText -import team.duckie.quackquack.ui.modifier.quackClickable - -/** - * QuackPrimaryLargeButton의 크키가 조정되지 않는 오류를 대처하기 위한 임시 버튼 - * - * TODO(limsaehyun): 추후 QuackQuackV2 로 대체되어야 함 - */ -@Composable -fun TempFlexibleSecondaryLargeButton( - modifier: Modifier = Modifier, - text: String, - onClick: () -> Unit, -) { - Box( - modifier = modifier - .heightIn(44.dp) - .quackBorder( - border = QuackBorder(color = QuackColor.Gray3), - shape = RoundedCornerShape(8.dp), - ) - .clip(RoundedCornerShape(8.dp)) - .background(QuackColor.White.value) - .quackClickable(onClick = onClick), - contentAlignment = Alignment.Center, - ) { - QuackText( - text = text, - typography = QuackTypography.Subtitle.change( - color = QuackColor.Black, - ), - ) - } -} diff --git a/feature/exam-result/src/main/java/team/duckie/app/android/feature/exam/result/common/ResultBottomBar.kt b/feature/exam-result/src/main/java/team/duckie/app/android/feature/exam/result/common/ResultBottomBar.kt index de40e41fe..0dbad2e7e 100644 --- a/feature/exam-result/src/main/java/team/duckie/app/android/feature/exam/result/common/ResultBottomBar.kt +++ b/feature/exam-result/src/main/java/team/duckie/app/android/feature/exam/result/common/ResultBottomBar.kt @@ -22,9 +22,9 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import team.duckie.app.android.common.compose.ui.quack.todo.QuackSurface -import team.duckie.app.android.common.compose.ui.temp.TempFlexiblePrimaryLargeButton import team.duckie.app.android.feature.exam.result.R import team.duckie.quackquack.material.QuackColor +import team.duckie.quackquack.ui.sugar.QuackPrimaryLargeButton import team.duckie.quackquack.ui.sugar.QuackSubtitle import team.duckie.quackquack.ui.util.ExperimentalQuackQuackApi @@ -53,7 +53,7 @@ internal fun ResultBottomBar( onClick = onClickRetryButton, ) } - TempFlexiblePrimaryLargeButton( + QuackPrimaryLargeButton( modifier = Modifier.weight(1f), text = stringResource(id = R.string.exam_result_exit_exam), onClick = onClickExitButton, diff --git a/feature/home/src/main/kotlin/team/duckie/app/android/feature/home/screen/guide/HomeGuideScreen.kt b/feature/home/src/main/kotlin/team/duckie/app/android/feature/home/screen/guide/HomeGuideScreen.kt index c16a63376..5a9c20909 100644 --- a/feature/home/src/main/kotlin/team/duckie/app/android/feature/home/screen/guide/HomeGuideScreen.kt +++ b/feature/home/src/main/kotlin/team/duckie/app/android/feature/home/screen/guide/HomeGuideScreen.kt @@ -37,7 +37,6 @@ import kotlinx.coroutines.launch import org.orbitmvi.orbit.compose.collectAsState import team.duckie.app.android.common.compose.activityViewModel import team.duckie.app.android.common.compose.ui.Spacer -import team.duckie.app.android.common.compose.ui.temp.TempFlexiblePrimaryLargeButton import team.duckie.app.android.feature.home.R import team.duckie.app.android.feature.home.constants.GuideStep import team.duckie.app.android.feature.home.viewmodel.guide.HomeGuideViewModel @@ -45,6 +44,7 @@ import team.duckie.quackquack.material.QuackColor import team.duckie.quackquack.material.QuackTypography import team.duckie.quackquack.material.quackClickable import team.duckie.quackquack.ui.QuackText +import team.duckie.quackquack.ui.sugar.QuackPrimaryLargeButton import team.duckie.quackquack.ui.util.ExperimentalQuackQuackApi @Composable @@ -148,7 +148,7 @@ private fun HomeGuideStartScreen( ), ) Spacer(space = 20.dp) - TempFlexiblePrimaryLargeButton( + QuackPrimaryLargeButton( text = stringResource(id = R.string.guide_start_accept_message), modifier = Modifier.size(118.dp, 44.dp), enabled = true, diff --git a/feature/home/src/main/kotlin/team/duckie/app/android/feature/home/screen/home/HomeRecommendScreen.kt b/feature/home/src/main/kotlin/team/duckie/app/android/feature/home/screen/home/HomeRecommendScreen.kt index 17c402798..b73f3adbf 100644 --- a/feature/home/src/main/kotlin/team/duckie/app/android/feature/home/screen/home/HomeRecommendScreen.kt +++ b/feature/home/src/main/kotlin/team/duckie/app/android/feature/home/screen/home/HomeRecommendScreen.kt @@ -63,7 +63,6 @@ import team.duckie.app.android.common.compose.ui.DuckTestCoverItem import team.duckie.app.android.common.compose.ui.DuckieHorizontalPagerIndicator import team.duckie.app.android.common.compose.ui.quack.todo.QuackAnnotatedText import team.duckie.app.android.common.compose.ui.skeleton -import team.duckie.app.android.common.compose.ui.temp.TempFlexiblePrimaryLargeButton import team.duckie.app.android.common.kotlin.addHashTag import team.duckie.app.android.domain.exam.model.Exam import team.duckie.app.android.domain.recommendation.model.ExamType @@ -76,6 +75,7 @@ import team.duckie.quackquack.material.QuackTypography import team.duckie.quackquack.ui.QuackText import team.duckie.quackquack.ui.sugar.QuackBody3 import team.duckie.quackquack.ui.sugar.QuackLarge1 +import team.duckie.quackquack.ui.sugar.QuackPrimaryLargeButton import team.duckie.quackquack.ui.util.ExperimentalQuackQuackApi private val HomeHorizontalPadding = PaddingValues(horizontal = 16.dp) @@ -240,7 +240,7 @@ private fun HomeRecommendJumbotronLayout( ) Spacer(modifier = Modifier.height(24.dp)) - TempFlexiblePrimaryLargeButton( + QuackPrimaryLargeButton( modifier = Modifier .fillMaxWidth() .skeleton(isLoading), diff --git a/feature/onboard/src/main/kotlin/team/duckie/app/android/feature/onboard/screen/1_ProfileScreen.kt b/feature/onboard/src/main/kotlin/team/duckie/app/android/feature/onboard/screen/1_ProfileScreen.kt index cc3098cd8..6850c9a6a 100644 --- a/feature/onboard/src/main/kotlin/team/duckie/app/android/feature/onboard/screen/1_ProfileScreen.kt +++ b/feature/onboard/src/main/kotlin/team/duckie/app/android/feature/onboard/screen/1_ProfileScreen.kt @@ -70,7 +70,6 @@ import team.duckie.app.android.common.compose.ui.Spacer import team.duckie.app.android.common.compose.ui.constant.SharedIcon import team.duckie.app.android.common.compose.ui.quack.todo.QuackErrorableTextField import team.duckie.app.android.common.compose.ui.quack.todo.QuackErrorableTextFieldState -import team.duckie.app.android.common.compose.ui.temp.TempFlexiblePrimaryLargeButton import team.duckie.app.android.common.kotlin.runIf import team.duckie.app.android.feature.onboard.R import team.duckie.app.android.feature.onboard.common.OnboardTopAppBar @@ -83,6 +82,7 @@ import team.duckie.quackquack.material.quackClickable import team.duckie.quackquack.material.shape.SquircleShape import team.duckie.quackquack.ui.QuackImage import team.duckie.quackquack.ui.optin.ExperimentalDesignToken +import team.duckie.quackquack.ui.sugar.QuackPrimaryLargeButton import team.duckie.quackquack.ui.util.ExperimentalQuackQuackApi private val currentStep = OnboardStep.Profile @@ -229,7 +229,7 @@ internal fun ProfileScreen(vm: OnboardViewModel = activityViewModel()) { ) Spacer(weight = 1f) - TempFlexiblePrimaryLargeButton( + QuackPrimaryLargeButton( modifier = Modifier.fillMaxWidth(), text = stringResource(R.string.button_next), enabled = profileScreenState == ProfileScreenState.Valid && diff --git a/feature/onboard/src/main/kotlin/team/duckie/app/android/feature/onboard/screen/2_CategoryScreen.kt b/feature/onboard/src/main/kotlin/team/duckie/app/android/feature/onboard/screen/2_CategoryScreen.kt index 6eca2de60..62bed48ab 100644 --- a/feature/onboard/src/main/kotlin/team/duckie/app/android/feature/onboard/screen/2_CategoryScreen.kt +++ b/feature/onboard/src/main/kotlin/team/duckie/app/android/feature/onboard/screen/2_CategoryScreen.kt @@ -6,6 +6,7 @@ */ @file:Suppress("ConstPropertyName", "PrivatePropertyName") +@file:OptIn(ExperimentalQuackQuackApi::class) package team.duckie.app.android.feature.onboard.screen @@ -35,7 +36,6 @@ import team.duckie.app.android.common.compose.systemBarPaddings import team.duckie.app.android.common.compose.ui.quack.todo.QuackGridLayout import team.duckie.app.android.common.compose.ui.quack.todo.QuackSelectableImage import team.duckie.app.android.common.compose.ui.quack.todo.QuackSelectableImageType -import team.duckie.app.android.common.compose.ui.temp.TempFlexiblePrimaryLargeButton import team.duckie.app.android.common.kotlin.fastAny import team.duckie.app.android.common.kotlin.fastFirstOrNull import team.duckie.app.android.common.kotlin.fastMapIndexedNotNull @@ -45,7 +45,9 @@ import team.duckie.app.android.feature.onboard.common.OnboardTopAppBar import team.duckie.app.android.feature.onboard.common.TitleAndDescription import team.duckie.app.android.feature.onboard.constant.OnboardStep import team.duckie.app.android.feature.onboard.viewmodel.OnboardViewModel +import team.duckie.quackquack.ui.sugar.QuackPrimaryLargeButton import team.duckie.quackquack.ui.sugar.QuackTitle2 +import team.duckie.quackquack.ui.util.ExperimentalQuackQuackApi private val currentStep = OnboardStep.Category @@ -157,7 +159,7 @@ internal fun CategoryScreen(vm: OnboardViewModel = activityViewModel()) { ) } } - TempFlexiblePrimaryLargeButton( + QuackPrimaryLargeButton( modifier = Modifier .layoutId(CategoryScreenNextButtonLayoutId) .fillMaxWidth() diff --git a/feature/onboard/src/main/kotlin/team/duckie/app/android/feature/onboard/screen/3_TagScreen.kt b/feature/onboard/src/main/kotlin/team/duckie/app/android/feature/onboard/screen/3_TagScreen.kt index 29b1d0b3b..1f78b827c 100644 --- a/feature/onboard/src/main/kotlin/team/duckie/app/android/feature/onboard/screen/3_TagScreen.kt +++ b/feature/onboard/src/main/kotlin/team/duckie/app/android/feature/onboard/screen/3_TagScreen.kt @@ -60,7 +60,6 @@ import team.duckie.app.android.common.compose.systemBarPaddings import team.duckie.app.android.common.compose.ui.domain.DuckieTagAddBottomSheet import team.duckie.app.android.common.compose.ui.quack.todo.QuackCircleTag import team.duckie.app.android.common.compose.ui.quack.todo.QuackOutLinedSingeLazyRowTag -import team.duckie.app.android.common.compose.ui.temp.TempFlexiblePrimaryLargeButton import team.duckie.app.android.common.kotlin.AllowMagicNumber import team.duckie.app.android.common.kotlin.fastAny import team.duckie.app.android.common.kotlin.fastFirstOrNull @@ -79,6 +78,7 @@ import team.duckie.quackquack.material.QuackColor import team.duckie.quackquack.material.QuackTypography import team.duckie.quackquack.material.quackClickable import team.duckie.quackquack.ui.QuackText +import team.duckie.quackquack.ui.sugar.QuackPrimaryLargeButton import team.duckie.quackquack.ui.sugar.QuackTitle2 import team.duckie.quackquack.ui.util.ExperimentalQuackQuackApi @@ -179,10 +179,8 @@ internal fun TagScreen(vm: OnboardViewModel = activityViewModel()) { }, ) - // TODO(riflockle7): 문제 있으므로 꽥꽥 이슈 해결할 때까지 주석 제거하지 않음 - // type = QuackLargeButtonType.Fill, // isLoading = isLoadingToFinish, - TempFlexiblePrimaryLargeButton( + QuackPrimaryLargeButton( modifier = Modifier .layoutId(TagScreenQuackLargeButtonLayoutId) .fillMaxWidth() diff --git a/feature/profile/src/main/kotlin/team/duckie/app/android/feature/profile/screen/MyProfileScreen.kt b/feature/profile/src/main/kotlin/team/duckie/app/android/feature/profile/screen/MyProfileScreen.kt index 370a3c823..093c8ca93 100644 --- a/feature/profile/src/main/kotlin/team/duckie/app/android/feature/profile/screen/MyProfileScreen.kt +++ b/feature/profile/src/main/kotlin/team/duckie/app/android/feature/profile/screen/MyProfileScreen.kt @@ -24,7 +24,6 @@ import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.toImmutableList import team.duckie.app.android.common.compose.ui.BackPressedHeadLineTopAppBar import team.duckie.app.android.common.compose.ui.DuckTestCoverItem -import team.duckie.app.android.common.compose.ui.temp.TempFlexibleSecondaryLargeButton import team.duckie.app.android.common.kotlin.FriendsType import team.duckie.app.android.domain.exam.model.ProfileExam import team.duckie.app.android.domain.user.model.UserProfile @@ -43,6 +42,7 @@ import team.duckie.quackquack.material.icon.quackicon.outlined.Notice import team.duckie.quackquack.material.icon.quackicon.outlined.Setting import team.duckie.quackquack.material.quackClickable import team.duckie.quackquack.ui.QuackIcon +import team.duckie.quackquack.ui.sugar.QuackSecondaryLargeButton import team.duckie.quackquack.ui.util.ExperimentalQuackQuackApi @Suppress("UnusedPrivateMember") // 시험 생성하기를 추후에 다시 활용하기 위함 @@ -120,7 +120,7 @@ fun MyProfileScreen( title = stringResource(id = R.string.my_favorite_tag), tags = tags, emptySection = { - TempFlexibleSecondaryLargeButton( + QuackSecondaryLargeButton( modifier = Modifier.fillMaxWidth(), text = stringResource(id = R.string.add_favorite_tag), onClick = onClickEditTag, diff --git a/feature/start-exam/src/main/java/team/duckie/app/android/feature/start/exam/screen/exam/StartExamInputScreen.kt b/feature/start-exam/src/main/java/team/duckie/app/android/feature/start/exam/screen/exam/StartExamInputScreen.kt index 07afd8d11..bed3b0361 100644 --- a/feature/start-exam/src/main/java/team/duckie/app/android/feature/start/exam/screen/exam/StartExamInputScreen.kt +++ b/feature/start-exam/src/main/java/team/duckie/app/android/feature/start/exam/screen/exam/StartExamInputScreen.kt @@ -27,7 +27,6 @@ import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle import team.duckie.app.android.common.compose.ui.BackPressedTopAppBar import team.duckie.app.android.common.compose.ui.ImeSpacer -import team.duckie.app.android.common.compose.ui.temp.TempFlexiblePrimaryLargeButton import team.duckie.app.android.feature.start.exam.R import team.duckie.app.android.feature.start.exam.screen.StartExamScreen import team.duckie.app.android.feature.start.exam.viewmodel.StartExamState @@ -36,6 +35,7 @@ import team.duckie.quackquack.material.QuackColor import team.duckie.quackquack.material.QuackTypography import team.duckie.quackquack.ui.QuackText import team.duckie.quackquack.ui.sugar.QuackHeadLine1 +import team.duckie.quackquack.ui.sugar.QuackPrimaryLargeButton import team.duckie.quackquack.ui.util.ExperimentalQuackQuackApi /** @@ -84,7 +84,8 @@ internal fun StartExamInputScreen(modifier: Modifier, viewModel: StartExamViewMo Spacer(modifier = Modifier.weight(1f)) // 시험시작 버튼 - TempFlexiblePrimaryLargeButton( + QuackPrimaryLargeButton( + modifier = Modifier .fillMaxWidth() .padding( diff --git a/feature/start-exam/src/main/java/team/duckie/app/android/feature/start/exam/screen/quiz/StartQuizInputScreen.kt b/feature/start-exam/src/main/java/team/duckie/app/android/feature/start/exam/screen/quiz/StartQuizInputScreen.kt index dcfd5f47e..e2611c015 100644 --- a/feature/start-exam/src/main/java/team/duckie/app/android/feature/start/exam/screen/quiz/StartQuizInputScreen.kt +++ b/feature/start-exam/src/main/java/team/duckie/app/android/feature/start/exam/screen/quiz/StartQuizInputScreen.kt @@ -41,7 +41,6 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import team.duckie.app.android.common.compose.ui.BackPressedTopAppBar import team.duckie.app.android.common.compose.ui.ImeSpacer import team.duckie.app.android.common.compose.ui.Spacer -import team.duckie.app.android.common.compose.ui.temp.TempFlexiblePrimaryLargeButton import team.duckie.app.android.common.compose.util.rememberUserInputState import team.duckie.app.android.feature.start.exam.R import team.duckie.app.android.feature.start.exam.screen.exam.StartExamTextField @@ -52,6 +51,7 @@ import team.duckie.quackquack.material.QuackTypography import team.duckie.quackquack.ui.optin.ExperimentalDesignToken import team.duckie.quackquack.ui.sugar.QuackBody2 import team.duckie.quackquack.ui.sugar.QuackHeadLine1 +import team.duckie.quackquack.ui.sugar.QuackPrimaryLargeButton import team.duckie.quackquack.ui.sugar.QuackTitle2 import team.duckie.quackquack.ui.util.ExperimentalQuackQuackApi @@ -107,7 +107,7 @@ internal fun StartQuizInputScreen(modifier: Modifier, viewModel: StartExamViewMo ) } Spacer(modifier = Modifier.weight(1f)) - TempFlexiblePrimaryLargeButton( + QuackPrimaryLargeButton( modifier = Modifier .fillMaxWidth() .padding( @@ -118,6 +118,17 @@ internal fun StartQuizInputScreen(modifier: Modifier, viewModel: StartExamViewMo onClick = viewModel::startSolveProblem, enabled = certifyingStatementText.isNotEmpty(), ) +// TempFlexiblePrimaryLargeButton( +// modifier = Modifier +// .fillMaxWidth() +// .padding( +// vertical = 12.dp, +// horizontal = 16.dp, +// ), +// text = stringResource(id = R.string.start_exam_quiz_start_button), +// onClick = viewModel::startSolveProblem, +// enabled = certifyingStatementText.isNotEmpty(), +// ) ImeSpacer() } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b7bfffcc6..46a741841 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -114,7 +114,7 @@ quack-lint-compose = "1.0.2" # TODO(sungbin): quack-lint-writing # quack v2 -quack-v2-ui = "2.0.0-alpha14" +quack-v2-ui = "2.0.0-alpha15" quack-v2-ui-plugin-interceptor-textfield ="2.0.0-alpha01" # test