From dfcf58a11d3c3e8a88e8076209507bd4d38a03da Mon Sep 17 00:00:00 2001 From: MinseoShindor Date: Sun, 4 Feb 2024 08:40:36 +0900 Subject: [PATCH] =?UTF-8?q?[feat/#76]=20=EB=B2=84=ED=8A=BC=20=EC=BC=80?= =?UTF-8?q?=EC=9D=B4=EC=8A=A4=20UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/home/attend/AttendButton.kt | 84 +++++++++++++++++++ .../ui/home/attend/AttendScreen.kt | 37 +++++--- presentation/src/main/res/values/strings.xml | 5 ++ 3 files changed, 113 insertions(+), 13 deletions(-) create mode 100644 presentation/src/main/java/com/kusitms/presentation/ui/home/attend/AttendButton.kt diff --git a/presentation/src/main/java/com/kusitms/presentation/ui/home/attend/AttendButton.kt b/presentation/src/main/java/com/kusitms/presentation/ui/home/attend/AttendButton.kt new file mode 100644 index 0000000..7b756dc --- /dev/null +++ b/presentation/src/main/java/com/kusitms/presentation/ui/home/attend/AttendButton.kt @@ -0,0 +1,84 @@ +package com.kusitms.presentation.ui.home.attend + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.wrapContentWidth +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Text +import androidx.compose.material3.Button +import androidx.compose.material3.ButtonDefaults +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.kusitms.presentation.R +import com.kusitms.presentation.common.ui.theme.KusitmsColorPalette +import com.kusitms.presentation.common.ui.theme.KusitmsTypo + +@Composable +fun AttendBtnOn() { + Button( + modifier = Modifier + .wrapContentWidth() + .height(64.dp) , + colors = ButtonDefaults.buttonColors(containerColor = KusitmsColorPalette.current.Main600) , + shape = RoundedCornerShape(size = 12.dp), + onClick = { /*TODO*/ } + ) { + Text(text = stringResource(R.string.attend_btn_attend), style = KusitmsTypo.current.Text_Semibold, color = KusitmsColorPalette.current.White, maxLines = 1) + } +} + +@Composable +fun AttendBtnOff() { + Button( + modifier = Modifier + .wrapContentWidth() + .height(64.dp) , + colors = ButtonDefaults.buttonColors(containerColor = KusitmsColorPalette.current.Grey500) , + shape = RoundedCornerShape(size = 12.dp), + onClick = { }, + enabled = false + ) { + Column( + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.Center + ) { + Text(text = stringResource(R.string.attend_btn_attend_wait), style = KusitmsTypo.current.Text_Semibold, color = KusitmsColorPalette.current.Grey400) + Text(text = stringResource(R.string.attend_btn_attend_wait), style = KusitmsTypo.current.Text_Semibold, color = KusitmsColorPalette.current.Grey400) + } + } +} + +@Composable +fun AttendBtnFailure() { + Button( + modifier = Modifier + .wrapContentWidth() + .height(64.dp) , + colors = ButtonDefaults.buttonColors(containerColor = KusitmsColorPalette.current.Grey600) , + shape = RoundedCornerShape(size = 12.dp), + onClick = {}, + enabled = false + ) { + Text(text = stringResource(R.string.attend_btn_attend_failure), style = KusitmsTypo.current.Text_Semibold, color = KusitmsColorPalette.current.Sub2, maxLines = 1) + } +} + +@Composable +fun AttendBtnSuccess() { + Button( + modifier = Modifier + .wrapContentWidth() + .height(64.dp) , + colors = ButtonDefaults.buttonColors(containerColor = KusitmsColorPalette.current.Grey600) , + shape = RoundedCornerShape(size = 12.dp), + onClick = {}, + enabled = false + ) { + Text(text = stringResource(R.string.attend_btn_attend_success), style = KusitmsTypo.current.Text_Semibold, color = KusitmsColorPalette.current.Sub1, maxLines = 1) + } +} \ No newline at end of file diff --git a/presentation/src/main/java/com/kusitms/presentation/ui/home/attend/AttendScreen.kt b/presentation/src/main/java/com/kusitms/presentation/ui/home/attend/AttendScreen.kt index 32b2a66..abed74f 100644 --- a/presentation/src/main/java/com/kusitms/presentation/ui/home/attend/AttendScreen.kt +++ b/presentation/src/main/java/com/kusitms/presentation/ui/home/attend/AttendScreen.kt @@ -28,15 +28,17 @@ import com.kusitms.presentation.common.ui.KusitmsMarginVerticalSpacer import com.kusitms.presentation.common.ui.theme.KusitmsColorPalette import com.kusitms.presentation.R import com.kusitms.presentation.common.ui.KusitmsMarginHorizontalSpacer +import com.kusitms.presentation.common.ui.KusitsmTopBarTextWithIcon import com.kusitms.presentation.common.ui.theme.KusitmsTypo +import com.kusitms.presentation.model.home.attend.AttendViewModel import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @Preview @Composable -fun AttendScreen() { - +fun AttendScreen( +) { val scrollState = rememberScrollState() Column( modifier = Modifier @@ -47,6 +49,7 @@ fun AttendScreen() { horizontalAlignment = Alignment.Start, verticalArrangement = Arrangement.Top ) { + AttendTopBar() KusitmsMarginVerticalSpacer(size = 8) AttendPreColumn() KusitmsMarginVerticalSpacer(size = 24) @@ -57,6 +60,23 @@ fun AttendScreen() { ScrollBtn(scrollState = scrollState) } +@Composable +fun AttendTopBar() { + Column( + modifier = Modifier + .fillMaxWidth() + .height(48.dp), + verticalArrangement = Arrangement.Center, + horizontalAlignment = Alignment.Start + ) { + Text( + text = "출석", + style = KusitmsTypo.current.SubTitle1_Semibold, + color = KusitmsColorPalette.current.Grey100 + ) + } +} + @Composable fun AttendPreColumn() { Box(modifier = Modifier @@ -79,16 +99,7 @@ fun AttendPreColumn() { Text(text = stringResource(R.string.attend_box1_title), style = KusitmsTypo.current.Caption1, color = KusitmsColorPalette.current.Main500) Text(text = stringResource(R.string.attend_box1_subTitle), style = KusitmsTypo.current.SubTitle1_Semibold, color = KusitmsColorPalette.current.White) } - Button( - modifier = Modifier - .wrapContentWidth() - .height(64.dp) , - colors = ButtonDefaults.buttonColors(containerColor = KusitmsColorPalette.current.Main600) , - shape = RoundedCornerShape(size = 12.dp), - onClick = { /*TODO*/ } - ) { - Text(text = stringResource(R.string.attend_btn_attend), style = KusitmsTypo.current.Text_Semibold, color = KusitmsColorPalette.current.White, maxLines = 1) - } + AttendBtnOff() } } } @@ -212,7 +223,7 @@ fun AttendBoxItem( .padding(vertical = 10.dp), horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.SpaceBetween) { - Text(text = stringResource(id = title), // title을 파라미터로 전달 + Text(text = stringResource(id = title), style = KusitmsTypo.current.Caption1, color = KusitmsColorPalette.current.Grey300, ) diff --git a/presentation/src/main/res/values/strings.xml b/presentation/src/main/res/values/strings.xml index 0fdeaf9..7dd7fc1 100644 --- a/presentation/src/main/res/values/strings.xml +++ b/presentation/src/main/res/values/strings.xml @@ -168,6 +168,10 @@ %s 출석하기 + 출석완료 + 출석실패 + 출석대기 + 출석현황 출석변경 요청하기 @@ -182,6 +186,7 @@ 지각 + 타 서비스, 앱, 사이트 등 게시판 외부로 회원을\n유도하거나 공동구매, 할인 쿠폰, 홍보성 이벤트 등\n허가되지 않은 광고/홍보 게시물 비아냥, 비속어 등 예의범절에 벗어나거나,\n특정인이나 단체, 지역을 비방하는 등 논란 및 분란을\n일으킬 수 있는 게시물 게시물 무단 유출, 타인의 개인정보 유출, 관리자 사칭 등 타인의 권리를 침해하거나 관련법에 위배되는 게시물