diff --git a/app/src/main/java/com/ddd/attendance/ui/component/DDDSituation.kt b/app/src/main/java/com/ddd/attendance/ui/component/DDDSituation.kt index 5e84201..9069867 100644 --- a/app/src/main/java/com/ddd/attendance/ui/component/DDDSituation.kt +++ b/app/src/main/java/com/ddd/attendance/ui/component/DDDSituation.kt @@ -85,11 +85,12 @@ fun DDDMemberSituation( @Composable fun AttendanceStatusRow( + modifier: Modifier = Modifier, onPressQrcode:() -> Unit, onPressMyPage:() -> Unit ) { Row( - modifier = Modifier + modifier = modifier .fillMaxWidth() .height(52.dp) .background(DDD_WHITE), @@ -103,20 +104,18 @@ fun AttendanceStatusRow( Spacer(modifier = Modifier.weight(1F)) Image( - modifier = Modifier.noRippleClickable(onClick = onPressMyPage), - painter = painterResource(R.drawable.ic_36_my_info), + modifier = Modifier.noRippleClickable(onClick = onPressQrcode), + painter = painterResource(R.drawable.ic_36_qr_code), contentDescription = "Arrow Icon" ) Spacer(modifier = Modifier.width(12.dp)) Image( - modifier = Modifier.noRippleClickable(onClick = onPressQrcode), - painter = painterResource(R.drawable.ic_36_qr_code), + modifier = Modifier.noRippleClickable(onClick = onPressMyPage), + painter = painterResource(R.drawable.ic_36_my_info), contentDescription = "Arrow Icon" ) - - Spacer(modifier = Modifier.width(24.dp)) } } @@ -134,7 +133,7 @@ fun DDDMemberSituationItem( text = "$count", color = textColor, textStyle = MaterialTheme.typography.headlineSmall, - fontWeight = FontWeight.W700, + fontWeight = FontWeight.Bold, ) Spacer(modifier = Modifier.height(4.dp)) @@ -143,7 +142,7 @@ fun DDDMemberSituationItem( text = label, textStyle = MaterialTheme.typography.bodyMedium, color = DDD_TEXT_SECONDARY, - fontWeight = FontWeight.W500, + fontWeight = FontWeight.Medium, ) } } @@ -169,7 +168,7 @@ fun DDDAdminSituationItem( DDDText( text = text, color = DDD_WHITE, - fontWeight = FontWeight.W700, + fontWeight = FontWeight.Bold, fontSize = 20.sp ) diff --git a/app/src/main/java/com/ddd/attendance/ui/login/screen/affiliation/AffiliationScreen.kt b/app/src/main/java/com/ddd/attendance/ui/login/screen/affiliation/AffiliationScreen.kt index 9bf4bec..5a00d2e 100644 --- a/app/src/main/java/com/ddd/attendance/ui/login/screen/affiliation/AffiliationScreen.kt +++ b/app/src/main/java/com/ddd/attendance/ui/login/screen/affiliation/AffiliationScreen.kt @@ -1,5 +1,6 @@ package com.ddd.attendance.ui.login.screen.affiliation +import android.app.Activity import android.content.Intent import androidx.compose.foundation.background import androidx.compose.foundation.layout.Column @@ -43,15 +44,16 @@ fun AffiliationScreen( navController: NavController, viewModel: LoginProcessViewModel ) { - val context = LocalContext.current + val context = LocalContext.current as? Activity Content( onClickBackButton = { navController.popBackStack() }, onClickNext = { // 어디로 가야하는가~ - context.startActivity(Intent(context, MainActivity::class.java)) viewModel.onClickNextFromUserAffiliation() + context?.startActivity(Intent(context, MainActivity::class.java)) + context?.finish() } ) } diff --git a/app/src/main/java/com/ddd/attendance/ui/main/screen/member/MemberScreen.kt b/app/src/main/java/com/ddd/attendance/ui/main/screen/member/MemberScreen.kt index 959052d..fe1d797 100644 --- a/app/src/main/java/com/ddd/attendance/ui/main/screen/member/MemberScreen.kt +++ b/app/src/main/java/com/ddd/attendance/ui/main/screen/member/MemberScreen.kt @@ -1,5 +1,6 @@ package com.ddd.attendance.ui.main.screen.member +import androidx.activity.compose.BackHandler import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box @@ -57,8 +58,12 @@ fun MemberScreen( private fun Content( onPressMyPage:() -> Unit, onPressQrcode:() -> Unit, - onClickBackButton: () -> Unit, + onClickBackButton:() -> Unit, ) { + BackHandler { + onClickBackButton() + } + Box( modifier = Modifier .fillMaxSize() @@ -75,61 +80,25 @@ private fun Content( modifier = Modifier .fillMaxWidth() .wrapContentHeight() - .padding(horizontal = 24.dp) ) { item { Spacer(Modifier.height(36.dp)) + HeaderSection(onPressMyPage, onPressQrcode) + } - AttendanceStatusRow( - onPressQrcode = onPressMyPage, - onPressMyPage = onPressQrcode - ) - + item { Spacer(Modifier.height(20.dp)) - - DDDText( - text = stringResource(R.string.member_attendance_status, "김디디"), - color = DDD_TEXT_PRIMARY, - textStyle = MaterialTheme.typography.titleLarge, - fontWeight = FontWeight.Bold - ) - - Spacer(Modifier.height(16.dp)) - - DDDText( - text = stringResource(R.string.member_activity_period, "2025.03.12 ~ 2025.08.12"), - color = DDD_NEUTRAL_GRAY_50, - textStyle = MaterialTheme.typography.bodySmall, - fontWeight = FontWeight.Normal - ) - - Spacer(Modifier.height(8.dp)) - - DDDMemberSituation( - attendanceCount = 2, - tardyCount = 3, - absentCount = 5 - ) - - Spacer(Modifier.height(56.dp)) - - DDDText( - text = stringResource(R.string.member_th_schedule, "12"), - color = DDD_TEXT_PRIMARY, - textStyle = MaterialTheme.typography.titleMedium, - fontWeight = FontWeight.Medium - ) - - Spacer(Modifier.height(16.dp)) + BodySection() } + items(schedules) { item -> ScheduleItem( + modifier = Modifier.padding(horizontal = 24.dp), month = item.month, day = item.day, title = item.title, content = item.content ) - Spacer(Modifier.height(12.dp)) } } @@ -137,9 +106,67 @@ private fun Content( } @Composable -private fun ScheduleItem(month: String, day: String, title: String, content: String) { +private fun HeaderSection( + onPressMyPage:() -> Unit, + onPressQrcode:() -> Unit +) { + AttendanceStatusRow( + modifier = Modifier.padding(start = 16.dp, end = 24.dp), + onPressQrcode = onPressMyPage, + onPressMyPage = onPressQrcode + ) +} + +@Composable +private fun BodySection() { + Column( + modifier = Modifier.padding(horizontal = 24.dp) + ) { + DDDText( + text = stringResource(R.string.member_attendance_status, "김디디"), + color = DDD_TEXT_PRIMARY, + textStyle = MaterialTheme.typography.titleLarge, + fontWeight = FontWeight.Bold + ) + + Spacer(Modifier.height(16.dp)) + + DDDText( + text = stringResource(R.string.member_activity_period, "2025.03.12 ~ 2025.08.12"), + color = DDD_NEUTRAL_GRAY_50, + textStyle = MaterialTheme.typography.bodySmall, + fontWeight = FontWeight.Normal + ) + + Spacer(Modifier.height(8.dp)) + + DDDMemberSituation( + attendanceCount = 2, + tardyCount = 3, + absentCount = 5 + ) + + Spacer(Modifier.height(56.dp)) + + DDDText( + text = stringResource(R.string.member_th_schedule, "12"), + color = DDD_TEXT_PRIMARY, + textStyle = MaterialTheme.typography.titleMedium, + fontWeight = FontWeight.Medium + ) + + Spacer(Modifier.height(16.dp)) + } +} + +@Composable +private fun ScheduleItem(modifier: Modifier = Modifier + ,month: String, + day: String, + title: String, + content: String) { Box( - modifier = Modifier + modifier = modifier .fillMaxWidth() .clip(RoundedCornerShape(12.dp)) .background(DDD_GRAY_F5)