@@ -81,18 +81,23 @@ fun LateStudyScreen(
8181
8282 val studyTypes = viewModel.studyTypes
8383 val teachers = viewModel.teachers
84+
8485 val isSubmitEnabled = isSubmitEnabled(
8586 selectedTeacherId = selectedTeacherId,
8687 selectedTypeId = selectedTypeId,
8788 startDate = startDate,
8889 reason = reason,
8990 )
91+
9092 val filteredTeachers = remember(teacherKeyword, teachers) {
9193 if (teacherKeyword.isBlank()) {
9294 emptyList()
9395 } else {
9496 teachers.filter { teacher ->
95- teacher.name.contains(teacherKeyword)
97+ teacher.name.contains(
98+ other = teacherKeyword,
99+ ignoreCase = true ,
100+ )
96101 }
97102 }
98103 }
@@ -149,12 +154,22 @@ fun LateStudyScreen(
149154 currentMonth = currentMonth,
150155 startDate = startDate,
151156 endDate = endDate,
152- onPrevMonthClick = { currentMonth = currentMonth.minusMonths(1 ) },
153- onNextMonthClick = { currentMonth = currentMonth.plusMonths(1 ) },
157+ onPrevMonthClick = {
158+ currentMonth = currentMonth.minusMonths(1 )
159+ },
160+ onNextMonthClick = {
161+ currentMonth = currentMonth.plusMonths(1 )
162+ },
154163 onDateClick = { clickedDate ->
155164 when {
156- startDate == null -> startDate = clickedDate
157- endDate == null && ! clickedDate.isBefore(startDate) -> endDate = clickedDate
165+ startDate == null -> {
166+ startDate = clickedDate
167+ }
168+
169+ endDate == null && ! clickedDate.isBefore(startDate) -> {
170+ endDate = clickedDate
171+ }
172+
158173 else -> {
159174 startDate = clickedDate
160175 endDate = null
@@ -187,7 +202,6 @@ fun LateStudyScreen(
187202 resultKey = " late_study_application_result" ,
188203 result = " 신청 중" ,
189204 )
190-
191205 onBack()
192206 },
193207 onFailure = { message ->
@@ -254,15 +268,16 @@ private fun TeacherSearchSection(
254268 }
255269 }
256270}
257-
258271@Composable
259272private fun TeacherDropdown (
260273 teachers : List <TeacherResponse >,
261274 keyword : String ,
262275 onTeacherClick : (TeacherResponse ) -> Unit ,
263276) {
264- val dropdownShadowColor = DmsTheme .colorScheme.scrim
265- val highlightColor = DmsTheme .colorScheme.primary
277+ val shape = RoundedCornerShape (28 .dp)
278+ val highlightColor = DmsTheme .colorScheme.onPrimaryContainer
279+ val iconColor = DmsTheme .colorScheme.primaryContainer
280+ val shadowColor = DmsTheme .colorScheme.primaryContainer
266281
267282 Box (
268283 modifier = Modifier
@@ -274,26 +289,35 @@ private fun TeacherDropdown(
274289 Box (
275290 modifier = Modifier
276291 .matchParentSize()
277- .offset(y = 10 .dp)
292+ .offset(y = 3 .dp)
293+ .shadow(
294+ elevation = 8 .dp,
295+ shape = shape,
296+ clip = false ,
297+ ambientColor = shadowColor.copy(alpha = 0.3f ),
298+ spotColor = shadowColor.copy(alpha = 0.3f ),
299+ )
278300 .background(
279- color = dropdownShadowColor ,
280- shape = RoundedCornerShape ( 28 .dp) ,
301+ color = shadowColor.copy(alpha = 0.3f ) ,
302+ shape = shape ,
281303 ),
282304 )
283305
284306 Column (
285307 modifier = Modifier
286308 .fillMaxWidth()
287309 .shadow(
288- elevation = 12 .dp,
289- shape = RoundedCornerShape ( 28 .dp) ,
310+ elevation = 2 .dp,
311+ shape = shape ,
290312 clip = false ,
313+ ambientColor = Color .Black .copy(alpha = 0.05f ),
314+ spotColor = Color .Black .copy(alpha = 0.05f ),
291315 )
292316 .background(
293- color = DmsTheme .colorScheme.surfaceVariant ,
294- shape = RoundedCornerShape ( 28 .dp) ,
317+ color = DmsTheme .colorScheme.surface ,
318+ shape = shape ,
295319 )
296- .heightIn(max = 220 .dp)
320+ .heightIn(max = 300 .dp)
297321 .verticalScroll(rememberScrollState())
298322 .padding(vertical = 12 .dp),
299323 ) {
@@ -302,6 +326,7 @@ private fun TeacherDropdown(
302326 teacher = teacher,
303327 keyword = keyword,
304328 highlightColor = highlightColor,
329+ iconColor = iconColor,
305330 onClick = { onTeacherClick(teacher) },
306331 )
307332 }
@@ -314,20 +339,24 @@ private fun TeacherDropdownItem(
314339 teacher : TeacherResponse ,
315340 keyword : String ,
316341 highlightColor : Color ,
342+ iconColor : Color ,
317343 onClick : () -> Unit ,
318344) {
319345 Row (
320346 modifier = Modifier
321347 .fillMaxWidth()
322348 .clickable(onClick = onClick)
323- .padding(horizontal = 20 .dp, vertical = 14 .dp),
349+ .padding(
350+ horizontal = 20 .dp,
351+ vertical = 14 .dp,
352+ ),
324353 verticalAlignment = Alignment .CenterVertically ,
325354 horizontalArrangement = Arrangement .spacedBy(10 .dp),
326355 ) {
327356 Icon (
328357 imageVector = Icons .Outlined .Search ,
329358 contentDescription = " 검색" ,
330- tint = DmsTheme .colorScheme.onSurfaceVariant ,
359+ tint = iconColor ,
331360 modifier = Modifier .size(20 .dp),
332361 )
333362
@@ -352,7 +381,10 @@ private fun StudyTypeSection(
352381 LateStudySectionCard {
353382 Text (
354383 text = " 유형" ,
355- modifier = Modifier .padding(horizontal = 16 .dp, vertical = 12 .dp),
384+ modifier = Modifier .padding(
385+ horizontal = 16 .dp,
386+ vertical = 12 .dp,
387+ ),
356388 color = DmsTheme .colorScheme.onBackground,
357389 style = DmsTheme .typography.bodyB,
358390 )
@@ -420,13 +452,25 @@ private fun highlightText(
420452 keyword : String ,
421453 highlightColor : Color ,
422454) = buildAnnotatedString {
423- val startIndex = text.indexOf(keyword)
455+ val startIndex = text.indexOf(
456+ string = keyword,
457+ ignoreCase = true ,
458+ )
424459
425460 if (startIndex >= 0 && keyword.isNotEmpty()) {
426461 append(text.substring(0 , startIndex))
427- withStyle(style = SpanStyle (color = highlightColor)) {
428- append(text.substring(startIndex, startIndex + keyword.length))
462+
463+ withStyle(
464+ style = SpanStyle (color = highlightColor),
465+ ) {
466+ append(
467+ text.substring(
468+ startIndex,
469+ startIndex + keyword.length,
470+ ),
471+ )
429472 }
473+
430474 append(text.substring(startIndex + keyword.length))
431475 } else {
432476 append(text)
0 commit comments