From 4d08fca9f174649023f0125c19c1cf3d6589ba41 Mon Sep 17 00:00:00 2001 From: boiledegg Date: Fri, 12 Jul 2024 16:31:30 +0900 Subject: [PATCH] =?UTF-8?q?[REFACTOR/#57]=20=EB=A6=AC=EB=B7=B0=20=EA=B8=B0?= =?UTF-8?q?=EB=B0=98=20=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/designsystem/component/item/ColorPalette.kt | 12 +++++++----- .../designsystem/component/item/RadioButtonGroups.kt | 1 - core/src/main/res/drawable/ic_color_check.xml | 9 +++++++++ 3 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 core/src/main/res/drawable/ic_color_check.xml diff --git a/core/src/main/java/com/terning/core/designsystem/component/item/ColorPalette.kt b/core/src/main/java/com/terning/core/designsystem/component/item/ColorPalette.kt index 420ff2656..14bbd3fae 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/item/ColorPalette.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/item/ColorPalette.kt @@ -1,6 +1,7 @@ package com.terning.core.designsystem.component.item import android.util.Log +import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.size @@ -12,8 +13,10 @@ 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.res.painterResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp +import com.terning.core.R import com.terning.core.designsystem.theme.CalBlue1 import com.terning.core.designsystem.theme.CalBlue2 import com.terning.core.designsystem.theme.CalGreen1 @@ -29,7 +32,7 @@ import com.terning.core.extension.noRippleClickable @Composable fun ColorPalette( modifier: Modifier = Modifier, - onColorSelected:() -> Unit = {} + onColorSelected:(Color) -> Unit = {} ) { val colorList = listOf( CalRed, @@ -49,7 +52,7 @@ fun ColorPalette( options = colorList, gridCellCount = 5, onOptionSelected = { color -> - Log.d("CalendarScreen","color: ${colorList.indexOf(color)}") + onColorSelected(color) }, buttonComposable = { color, isSelected, onOptionSelected -> @@ -81,9 +84,8 @@ internal fun ColorButton( contentAlignment = Alignment.Center ) { if (isSelected) { - Icon( - imageVector = Icons.Outlined.Check, - tint = Color.White, + Image( + painter = painterResource(id = R.drawable.ic_color_check), contentDescription = "" ) } diff --git a/core/src/main/java/com/terning/core/designsystem/component/item/RadioButtonGroups.kt b/core/src/main/java/com/terning/core/designsystem/component/item/RadioButtonGroups.kt index b52993138..3ed2d3919 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/item/RadioButtonGroups.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/item/RadioButtonGroups.kt @@ -30,7 +30,6 @@ fun RadioButtonGroups( verticalArrangement = Arrangement.spacedBy(verticalArrangementSpace), horizontalArrangement = Arrangement.spacedBy(horizontalArrangementSpace), modifier = modifier - //.padding(horizontal = 42.dp) ) { items(options) { option -> buttonComposable( diff --git a/core/src/main/res/drawable/ic_color_check.xml b/core/src/main/res/drawable/ic_color_check.xml new file mode 100644 index 000000000..7f91e1bdc --- /dev/null +++ b/core/src/main/res/drawable/ic_color_check.xml @@ -0,0 +1,9 @@ + + +