From 27abcadf025169cf0a7bcd9f3e525357e5065e9a Mon Sep 17 00:00:00 2001 From: easyhz Date: Fri, 19 Jul 2024 18:38:14 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20checkButton=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?=EC=82=AC=ED=95=AD=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/button/CheckButton.kt | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/core/design-system/src/main/java/com/easyhz/noffice/core/design_system/component/button/CheckButton.kt b/core/design-system/src/main/java/com/easyhz/noffice/core/design_system/component/button/CheckButton.kt index 0d176e31..4ce74ff5 100644 --- a/core/design-system/src/main/java/com/easyhz/noffice/core/design_system/component/button/CheckButton.kt +++ b/core/design-system/src/main/java/com/easyhz/noffice/core/design_system/component/button/CheckButton.kt @@ -52,7 +52,7 @@ fun CheckButton( .heightIn(min = 42.dp) .clip(RoundedCornerShape(8.dp)) .background(if (isComplete) color.completeContainerColor else color.incompleteContainerColor) - .padding(vertical = 10.dp) + .padding(vertical = 14.dp) .screenHorizonPadding(), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(10.dp) @@ -63,11 +63,11 @@ fun CheckButton( color = if(isComplete) color.completeContentColor else color.incompleteContentColor, style = Body14 ) - if (isComplete || color.incompleteIconColor != null) { + if ((isComplete && color.completeIconColor != null) || color.incompleteIconColor != null) { Icon( painter = painterResource(id = R.drawable.ic_check), contentDescription = "check", - tint = if (isComplete) color.completeIconColor else color.incompleteIconColor ?: color.completeIconColor + tint = (if (isComplete) color.completeIconColor else color.incompleteIconColor) ?: color.completeContentColor ) } } @@ -79,7 +79,7 @@ fun CheckButton( data class CheckButtonDefaults( val completeContainerColor: Color, val completeContentColor: Color, - val completeIconColor: Color, + val completeIconColor: Color?, val incompleteContainerColor: Color, val incompleteContentColor: Color, val incompleteIconColor: Color?, @@ -187,3 +187,24 @@ private fun CheckButtonOrganizationCompletePrev() { } +@Preview(group = "checkButton", name = "organization - complete") +@Composable +private fun CheckButtonOrganizationCompletePrev2() { + CheckButton( + modifier = Modifier.width(300.dp), + text = "CMC 15th", + isComplete = true, + color = CheckButtonDefaults( + completeContainerColor = Green100, + completeContentColor = Green700, + completeIconColor = null, + incompleteContainerColor = Grey50, + incompleteContentColor = Grey600, + incompleteIconColor = null + ) + ) { + + } +} + +