From 52b5e84f76bea1ccb9fcee948f6196f74ec64d1d Mon Sep 17 00:00:00 2001 From: plgafhd Date: Thu, 13 Feb 2025 19:47:38 +0900 Subject: [PATCH] =?UTF-8?q?TagDto=EC=97=90=20toItemKey()=20=EC=A0=95?= =?UTF-8?q?=EC=9D=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/wafflestudio/snutt2/model/TagDto.kt | 3 ++- .../snutt2/views/logged_in/home/search/SearchResultList.kt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/wafflestudio/snutt2/model/TagDto.kt b/app/src/main/java/com/wafflestudio/snutt2/model/TagDto.kt index 9cbd5c546..e61ffb1b8 100644 --- a/app/src/main/java/com/wafflestudio/snutt2/model/TagDto.kt +++ b/app/src/main/java/com/wafflestudio/snutt2/model/TagDto.kt @@ -7,11 +7,12 @@ data class TagDto( val type: TagType, val name: String, ) { - companion object { val TIME_EMPTY: TagDto = TagDto(TagType.TIME, "빈 시간대로 검색") val TIME_SELECT: TagDto = TagDto(TagType.TIME, "시간대 직접 선택") val ETC_ENG: TagDto = TagDto(TagType.ETC, "영어진행 강의") val ETC_MILITARY: TagDto = TagDto(TagType.ETC, "군휴학 원격수업") } + + fun toItemKey(): String = type.toString() + name } diff --git a/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/home/search/SearchResultList.kt b/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/home/search/SearchResultList.kt index 40f409dc2..102050ecd 100644 --- a/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/home/search/SearchResultList.kt +++ b/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/home/search/SearchResultList.kt @@ -49,7 +49,7 @@ fun SearchResultList( val keyBoardController = LocalSoftwareKeyboardController.current Column { - AnimatedLazyRow(itemList = selectedTags, itemKey = { it.type.toString() + it.name }) { + AnimatedLazyRow(itemList = selectedTags, itemKey = { it.toItemKey() }) { TagCell( tagDto = it, onClick = {