diff --git a/core/src/main/java/com/terning/core/designsystem/component/button/SortingButton.kt b/core/src/main/java/com/terning/core/designsystem/component/button/SortingButton.kt index 79c6c28f0..27693a251 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/button/SortingButton.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/button/SortingButton.kt @@ -39,7 +39,7 @@ fun SortingButton( ) ) Image( - painter = painterResource(id = R.drawable.ic_down), + painter = painterResource(id = R.drawable.ic_down_18), contentDescription = stringResource(id = R.string.sort_button_description), modifier = modifier .padding(vertical = 5.dp) diff --git a/core/src/main/java/com/terning/core/designsystem/component/dialog/ScrapDialogContent.kt b/core/src/main/java/com/terning/core/designsystem/component/dialog/ScrapDialogContent.kt new file mode 100644 index 000000000..222b11220 --- /dev/null +++ b/core/src/main/java/com/terning/core/designsystem/component/dialog/ScrapDialogContent.kt @@ -0,0 +1,259 @@ +package com.terning.core.designsystem.component.dialog + +import androidx.compose.foundation.Image +import androidx.compose.foundation.background +import androidx.compose.foundation.border +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.layout.wrapContentHeight +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.HorizontalDivider +import androidx.compose.material3.Icon +import androidx.compose.material3.IconButton +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.unit.dp +import com.terning.core.R +import com.terning.core.designsystem.component.button.RoundButton +import com.terning.core.designsystem.component.item.ColorPalette +import com.terning.core.designsystem.theme.CalBlue2 +import com.terning.core.designsystem.theme.CalGreen2 +import com.terning.core.designsystem.theme.CalRed +import com.terning.core.designsystem.theme.Grey200 +import com.terning.core.designsystem.theme.Grey300 +import com.terning.core.designsystem.theme.Grey350 +import com.terning.core.designsystem.theme.Grey500 +import com.terning.core.designsystem.theme.TerningMain +import com.terning.core.designsystem.theme.TerningTheme +import com.terning.core.designsystem.theme.White +import com.terning.core.extension.noRippleClickable + + +@Composable +fun ScrapDialogContent( + onDismissRequest: () -> Unit, + isScrapped: Boolean, + internInfoList: List>, +) { + var isColorChange by remember { mutableStateOf(false) } + var selectedColor by remember { mutableStateOf(CalRed) } + + Box( + modifier = Modifier + .fillMaxWidth() + .wrapContentHeight() + .padding(30.dp) + .background( + color = White, + shape = RoundedCornerShape(20.dp) + ), + ) { + Row( + modifier = Modifier.fillMaxWidth(), + horizontalArrangement = Arrangement.End + ) { + IconButton( + onClick = { onDismissRequest() }, + modifier = Modifier + .padding(6.dp) + ) { + Icon( + painter = painterResource(id = R.drawable.ic_dialog_x_32), + contentDescription = null, + tint = Grey300, + modifier = Modifier + .noRippleClickable { onDismissRequest() } + ) + } + } + Box( + modifier = Modifier + .fillMaxWidth() + .padding(top = 32.dp), + contentAlignment = Alignment.TopCenter + ) { + Column( + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = 11.dp), + horizontalAlignment = Alignment.CenterHorizontally + ) { + Row( + modifier = Modifier + .width(60.dp) + .height(60.dp) + .border( + width = 1.dp, + color = TerningMain, + shape = RoundedCornerShape(size = 15.dp) + ) + ) { + Image( + painter = painterResource( + id = R.drawable.ic_character1 + ), + modifier = Modifier + .fillMaxWidth() + .background( + Grey200, + shape = RoundedCornerShape(size = 15.dp) + ), + contentDescription = null, + contentScale = ContentScale.Fit, + alignment = Alignment.Center + ) + } + Text( + text = "[한양대학교 컬렉티브임팩트센터] /코이카 영프로페셔널(YP) 모집합니다", + textAlign = TextAlign.Center, + style = TerningTheme.typography.title4, + color = Grey500, + modifier = Modifier.padding(top = 20.dp) + ) + Text( + text = stringResource(id = R.string.dialog_content_scrap_sub_title), + style = TerningTheme.typography.body5, + color = Grey350, + modifier = Modifier.padding( + top = 4.dp, + bottom = 13.dp + ) + ) + Column( + horizontalAlignment = Alignment.Start, + verticalArrangement = Arrangement.Top, + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = 13.dp) + ) { + Row( + modifier = Modifier + .background( + color = if (selectedColor != CalRed) CalBlue2 else CalGreen2, + shape = RoundedCornerShape(14.dp) + ) + .noRippleClickable { + isColorChange = !isColorChange + }, + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.Start + ) { + Icon( + painter = painterResource( + id = if (isColorChange) R.drawable.ic_up_22 + else R.drawable.ic_down_22 + ), + contentDescription = stringResource( + id = R.string.dialog_content_color_button + ), + tint = White, + modifier = Modifier.padding( + start = 7.dp, + top = 2.dp, + bottom = 2.dp + ) + ) + Text( + text = stringResource(id = R.string.dialog_content_color_button), + style = TerningTheme.typography.body5, + color = White, + modifier = Modifier.padding(end = 13.dp) + ) + } + HorizontalDivider( + thickness = 1.dp, + color = Grey200, + modifier = Modifier.padding( + top = 11.dp, + bottom = 8.dp + ) + ) + if (isColorChange) { + Box( + modifier = Modifier + .fillMaxWidth() + .padding( + top = 12.dp, + bottom = 23.dp, + ), + contentAlignment = Alignment.Center + ) { + ColorPalette( + initialColor = CalRed, + onColorSelected = { selectedColor = it }) + } + } else { + Text( + text = stringResource(id = R.string.intern_item_d_day), + style = TerningTheme.typography.body5, + color = TerningMain, + modifier = Modifier.padding(bottom = 9.dp) + ) + Column( + modifier = Modifier.padding(bottom = 29.dp), + verticalArrangement = Arrangement.spacedBy( + 5.dp, + Alignment.CenterVertically + ), + horizontalAlignment = Alignment.Start, + ) { + internInfoList.forEach { (title, value) -> + InternInfoRow(title, value) + } + } + } + } + RoundButton( + style = TerningTheme.typography.button3, + paddingVertical = 12.dp, + cornerRadius = 8.dp, + text = if (isScrapped) { + if (isColorChange) + R.string.dialog_content_color_button + else R.string.dialog_scrap_button + } else { + R.string.dialog_scrap_button + }, + onButtonClick = { /*TODO*/ }, + modifier = Modifier.padding(bottom = 8.dp) + ) + } + } + } +} + +// TODO 삭제 +@Composable +fun InternInfoRow(title: String, value: String) { + Row( + horizontalArrangement = Arrangement.spacedBy(12.dp, Alignment.Start), + verticalAlignment = Alignment.Top, + ) { + Text( + text = title, + style = TerningTheme.typography.body2, + color = Grey350, + ) + Text( + text = value, + style = TerningTheme.typography.body3, + color = Grey500, + ) + } +} diff --git a/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningBasicDialog.kt b/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningBasicDialog.kt new file mode 100644 index 000000000..02cdf1e00 --- /dev/null +++ b/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningBasicDialog.kt @@ -0,0 +1,40 @@ +package com.terning.core.designsystem.component.dialog + +import androidx.compose.runtime.Composable +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.window.Dialog +import androidx.compose.ui.window.DialogProperties + +@Composable +fun TerningBasicDialog( + onDismissRequest: () -> Unit, + properties: DialogProperties = DialogProperties( + usePlatformDefaultWidth = false, + decorFitsSystemWindows = true, + dismissOnBackPress = true, + dismissOnClickOutside = true, + ), + content: @Composable () -> Unit, +) { + Dialog( + onDismissRequest = { onDismissRequest() }, + properties = properties, + ) { + content() + } +} + +@Preview(showBackground = true, showSystemUi = true) +@Composable +fun TerningBasicDialogPreview() { + TerningBasicDialog( + onDismissRequest = {}, + content = { + ScrapDialogContent( + onDismissRequest = {}, + isScrapped = false, + internInfoList = listOf() + ) + } + ) +} \ No newline at end of file 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 d263ad91d..663286fa1 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 @@ -4,8 +4,13 @@ import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.wrapContentSize import androidx.compose.foundation.shape.CircleShape import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color @@ -27,8 +32,8 @@ import com.terning.core.extension.noRippleClickable @Composable fun ColorPalette( - modifier: Modifier = Modifier, - onColorSelected:(Color) -> Unit = {} + initialColor: Color, + onColorSelected: (Color) -> Unit = {}, ) { val colorList = listOf( CalRed, @@ -43,22 +48,24 @@ fun ColorPalette( CalPink ) + var selectedColor by remember { mutableStateOf(initialColor) } + RadioButtonGroups( - modifier = modifier.size(251.dp, 84.dp), options = colorList, gridCellCount = 5, onOptionSelected = { color -> + selectedColor = color onColorSelected(color) }, - buttonComposable = { - color, isSelected, onOptionSelected -> + buttonComposable = { color, isSelected, onOptionSelected -> ColorButton( color = color, - isSelected = isSelected, - onColorSelected = onOptionSelected) + isSelected = selectedColor == color, + onColorSelected = onOptionSelected + ) }, verticalArrangementSpace = 6.dp, - horizontalArrangementSpace = 14.dp, + horizontalArrangementSpace = 0.dp, ) } @@ -67,13 +74,16 @@ internal fun ColorButton( modifier: Modifier = Modifier, color: Color, isSelected: Boolean, - onColorSelected: (Color) -> Unit + onColorSelected: (Color) -> Unit, ) { - Box(modifier = modifier.size(39.dp)) { + Box(modifier = modifier.wrapContentSize()) { Box( modifier = Modifier .size(39.dp) - .background(shape = CircleShape, color = color) + .background( + shape = CircleShape, + color = color + ) .noRippleClickable { onColorSelected(color) }, @@ -89,10 +99,8 @@ internal fun ColorButton( } } - @Preview(showBackground = true) @Composable fun ColorPalettePreview() { - ColorPalette() + ColorPalette(initialColor = CalRed) } - diff --git a/core/src/main/java/com/terning/core/designsystem/theme/Color.kt b/core/src/main/java/com/terning/core/designsystem/theme/Color.kt index 32839d476..fe3dc2140 100644 --- a/core/src/main/java/com/terning/core/designsystem/theme/Color.kt +++ b/core/src/main/java/com/terning/core/designsystem/theme/Color.kt @@ -27,6 +27,7 @@ val TerningSub5 = Color(0XFFF8FFFB) // Background val Back = Color(0xFFF8F8F8) val ToastGrey = Color(0XFF666666) +val BackgroundColor = Color(0x4C000000) // Calendar Color val CalRed = Color(0xFFED4E54) diff --git a/core/src/main/res/drawable/ic_dialog_x_32.xml b/core/src/main/res/drawable/ic_dialog_x_32.xml new file mode 100644 index 000000000..93d2fd06f --- /dev/null +++ b/core/src/main/res/drawable/ic_dialog_x_32.xml @@ -0,0 +1,13 @@ + + + + + + diff --git a/core/src/main/res/drawable/ic_down.xml b/core/src/main/res/drawable/ic_down_18.xml similarity index 100% rename from core/src/main/res/drawable/ic_down.xml rename to core/src/main/res/drawable/ic_down_18.xml diff --git a/core/src/main/res/drawable/ic_down_22.xml b/core/src/main/res/drawable/ic_down_22.xml new file mode 100644 index 000000000..504567d88 --- /dev/null +++ b/core/src/main/res/drawable/ic_down_22.xml @@ -0,0 +1,10 @@ + + + diff --git a/core/src/main/res/drawable/ic_up_22.xml b/core/src/main/res/drawable/ic_up_22.xml new file mode 100644 index 000000000..25e166749 --- /dev/null +++ b/core/src/main/res/drawable/ic_up_22.xml @@ -0,0 +1,10 @@ + + + diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index b9a310626..dd2adcd9c 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -36,4 +36,13 @@ 회원가입 바텀시트 저장하기 + + 공고를 캘린더에 스크랩하시겠어요? + 색상 + 내 캘린더에 스크랩하기 + + + 서류 마감 + 근무 기간 + 근무 시작 \ No newline at end of file diff --git a/feature/src/main/AndroidManifest.xml b/feature/src/main/AndroidManifest.xml index f136894fe..708160b1c 100644 --- a/feature/src/main/AndroidManifest.xml +++ b/feature/src/main/AndroidManifest.xml @@ -18,7 +18,8 @@ + android:exported="true" + android:windowSoftInputMode = "adjustResize" > diff --git a/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt b/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt index 2aae08178..eef3a7100 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt @@ -24,7 +24,6 @@ import androidx.navigation.NavHostController import com.terning.core.designsystem.theme.TerningPointTheme import com.terning.core.extension.toast import com.terning.feature.R -import com.terning.feature.home.home.navigation.navigateHome import com.terning.feature.onboarding.signin.component.KakaoButton import com.terning.feature.onboarding.signup.navigation.navigateSignUp