diff --git a/core/design-system/src/main/java/team/aliens/dms/android/core/designsystem/card/DmsApplicationCard.kt b/core/design-system/src/main/java/team/aliens/dms/android/core/designsystem/card/DmsApplicationCard.kt index 9c4b81180..16a12fa3a 100644 --- a/core/design-system/src/main/java/team/aliens/dms/android/core/designsystem/card/DmsApplicationCard.kt +++ b/core/design-system/src/main/java/team/aliens/dms/android/core/designsystem/card/DmsApplicationCard.kt @@ -21,12 +21,12 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.res.painterResource +import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp import team.aliens.dms.android.core.designsystem.DmsTheme import team.aliens.dms.android.core.designsystem.bodyB import team.aliens.dms.android.core.designsystem.endPadding import team.aliens.dms.android.core.designsystem.foundation.DmsIcon -import team.aliens.dms.android.core.designsystem.labelB import team.aliens.dms.android.core.designsystem.labelM import team.aliens.dms.android.core.designsystem.util.clickable @@ -158,10 +158,12 @@ private fun AppliedTitleText( color = backgroundColor, shape = RoundedCornerShape(6.dp), ) - .padding(horizontal = 22.dp, vertical = 8.dp), + .padding(horizontal = 12.dp, vertical = 6.dp), text = appliedTitle, - style = DmsTheme.typography.labelB, + style = DmsTheme.typography.labelM, color = textColor, + maxLines = 1, + overflow = TextOverflow.Ellipsis, ) } diff --git a/feature/src/main/kotlin/team/aliens/dms/android/feature/latestudy/ui/LateStudyScreen.kt b/feature/src/main/kotlin/team/aliens/dms/android/feature/latestudy/ui/LateStudyScreen.kt index a6fcd1c51..e35efd581 100644 --- a/feature/src/main/kotlin/team/aliens/dms/android/feature/latestudy/ui/LateStudyScreen.kt +++ b/feature/src/main/kotlin/team/aliens/dms/android/feature/latestudy/ui/LateStudyScreen.kt @@ -81,18 +81,23 @@ fun LateStudyScreen( val studyTypes = viewModel.studyTypes val teachers = viewModel.teachers + val isSubmitEnabled = isSubmitEnabled( selectedTeacherId = selectedTeacherId, selectedTypeId = selectedTypeId, startDate = startDate, reason = reason, ) + val filteredTeachers = remember(teacherKeyword, teachers) { if (teacherKeyword.isBlank()) { emptyList() } else { teachers.filter { teacher -> - teacher.name.contains(teacherKeyword) + teacher.name.contains( + other = teacherKeyword, + ignoreCase = true, + ) } } } @@ -149,12 +154,22 @@ fun LateStudyScreen( currentMonth = currentMonth, startDate = startDate, endDate = endDate, - onPrevMonthClick = { currentMonth = currentMonth.minusMonths(1) }, - onNextMonthClick = { currentMonth = currentMonth.plusMonths(1) }, + onPrevMonthClick = { + currentMonth = currentMonth.minusMonths(1) + }, + onNextMonthClick = { + currentMonth = currentMonth.plusMonths(1) + }, onDateClick = { clickedDate -> when { - startDate == null -> startDate = clickedDate - endDate == null && !clickedDate.isBefore(startDate) -> endDate = clickedDate + startDate == null -> { + startDate = clickedDate + } + + endDate == null && !clickedDate.isBefore(startDate) -> { + endDate = clickedDate + } + else -> { startDate = clickedDate endDate = null @@ -187,7 +202,6 @@ fun LateStudyScreen( resultKey = "late_study_application_result", result = "신청 중", ) - onBack() }, onFailure = { message -> @@ -254,15 +268,16 @@ private fun TeacherSearchSection( } } } - @Composable private fun TeacherDropdown( teachers: List, keyword: String, onTeacherClick: (TeacherResponse) -> Unit, ) { - val dropdownShadowColor = DmsTheme.colorScheme.scrim - val highlightColor = DmsTheme.colorScheme.primary + val shape = RoundedCornerShape(28.dp) + val highlightColor = DmsTheme.colorScheme.onPrimaryContainer + val iconColor = DmsTheme.colorScheme.primaryContainer + val shadowColor = DmsTheme.colorScheme.primaryContainer Box( modifier = Modifier @@ -274,10 +289,17 @@ private fun TeacherDropdown( Box( modifier = Modifier .matchParentSize() - .offset(y = 10.dp) + .offset(y = 3.dp) + .shadow( + elevation = 8.dp, + shape = shape, + clip = false, + ambientColor = shadowColor.copy(alpha = 0.3f), + spotColor = shadowColor.copy(alpha = 0.3f), + ) .background( - color = dropdownShadowColor, - shape = RoundedCornerShape(28.dp), + color = shadowColor.copy(alpha = 0.3f), + shape = shape, ), ) @@ -285,15 +307,17 @@ private fun TeacherDropdown( modifier = Modifier .fillMaxWidth() .shadow( - elevation = 12.dp, - shape = RoundedCornerShape(28.dp), + elevation = 2.dp, + shape = shape, clip = false, + ambientColor = Color.Black.copy(alpha = 0.05f), + spotColor = Color.Black.copy(alpha = 0.05f), ) .background( - color = DmsTheme.colorScheme.surfaceVariant, - shape = RoundedCornerShape(28.dp), + color = DmsTheme.colorScheme.surface, + shape = shape, ) - .heightIn(max = 220.dp) + .heightIn(max = 300.dp) .verticalScroll(rememberScrollState()) .padding(vertical = 12.dp), ) { @@ -302,6 +326,7 @@ private fun TeacherDropdown( teacher = teacher, keyword = keyword, highlightColor = highlightColor, + iconColor = iconColor, onClick = { onTeacherClick(teacher) }, ) } @@ -314,20 +339,24 @@ private fun TeacherDropdownItem( teacher: TeacherResponse, keyword: String, highlightColor: Color, + iconColor: Color, onClick: () -> Unit, ) { Row( modifier = Modifier .fillMaxWidth() .clickable(onClick = onClick) - .padding(horizontal = 20.dp, vertical = 14.dp), + .padding( + horizontal = 20.dp, + vertical = 14.dp, + ), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(10.dp), ) { Icon( imageVector = Icons.Outlined.Search, contentDescription = "검색", - tint = DmsTheme.colorScheme.onSurfaceVariant, + tint = iconColor, modifier = Modifier.size(20.dp), ) @@ -352,7 +381,10 @@ private fun StudyTypeSection( LateStudySectionCard { Text( text = "유형", - modifier = Modifier.padding(horizontal = 16.dp, vertical = 12.dp), + modifier = Modifier.padding( + horizontal = 16.dp, + vertical = 12.dp, + ), color = DmsTheme.colorScheme.onBackground, style = DmsTheme.typography.bodyB, ) @@ -420,13 +452,25 @@ private fun highlightText( keyword: String, highlightColor: Color, ) = buildAnnotatedString { - val startIndex = text.indexOf(keyword) + val startIndex = text.indexOf( + string = keyword, + ignoreCase = true, + ) if (startIndex >= 0 && keyword.isNotEmpty()) { append(text.substring(0, startIndex)) - withStyle(style = SpanStyle(color = highlightColor)) { - append(text.substring(startIndex, startIndex + keyword.length)) + + withStyle( + style = SpanStyle(color = highlightColor), + ) { + append( + text.substring( + startIndex, + startIndex + keyword.length, + ), + ) } + append(text.substring(startIndex + keyword.length)) } else { append(text)