diff --git a/presentation/src/main/java/com/everymeal/presentation/ui/signup/UnivSelectScreen.kt b/presentation/src/main/java/com/everymeal/presentation/ui/signup/UnivSelectScreen.kt index e142423e..e76779f8 100644 --- a/presentation/src/main/java/com/everymeal/presentation/ui/signup/UnivSelectScreen.kt +++ b/presentation/src/main/java/com/everymeal/presentation/ui/signup/UnivSelectScreen.kt @@ -44,12 +44,13 @@ import com.everymeal.presentation.ui.theme.EveryMeal_AndroidTheme import com.everymeal.presentation.ui.theme.Gray100 import com.everymeal.presentation.ui.theme.Gray300 import com.everymeal.presentation.ui.theme.Gray500 +import com.everymeal.presentation.ui.theme.Gray600 import com.everymeal.presentation.ui.theme.Gray800 import com.everymeal.presentation.ui.theme.Paddings data class Item( - val Image: Int, - val name: String, + val univName: String, + val campusName: String? = null ) @Composable @@ -60,10 +61,12 @@ fun UnivSelectScreen( val viewState by viewModel.viewState.collectAsState() val items = listOf( - Item(Image = R.drawable.image_myongji, name = "명지대"), - Item(Image = R.drawable.image_sungsin, name = "성신여대"), - Item(Image = R.drawable.image_seoulwoman, name = "서울여대"), - Item(Image = R.drawable.image_konkuk, name = "건국대"), + Item(univName = "명지대", campusName = "자연캠퍼스"), + Item(univName = "명지대", campusName = "인문캠퍼스"), + Item(univName = "성신여대", campusName = "수정캠퍼스"), + Item(univName = "성신여대", campusName = "운정캠퍼스"), + Item(univName = "서울여대"), + Item(univName = "연세대학교", campusName = "서울캠퍼스"), ) Box( @@ -76,7 +79,13 @@ fun UnivSelectScreen( .fillMaxSize() .padding(horizontal = Paddings.extra) ) { - Spacer(modifier = Modifier.padding(58.dp)) + Spacer(modifier = Modifier.padding(40.dp)) + Image( + painter = painterResource(id = R.drawable.icon_school), + contentDescription = stringResource(R.string.icon_univ), + modifier = Modifier.size(64.dp) + ) + Spacer(modifier = Modifier.padding(10.dp)) Text( text = stringResource(R.string.univ_select_title), style = TextStyle( @@ -86,17 +95,20 @@ fun UnivSelectScreen( ) Spacer(modifier = Modifier.padding(10.dp)) LazyVerticalGrid( - columns = GridCells.Fixed(3), + columns = GridCells.Fixed(2), modifier = Modifier.weight(1f), ) { items(items.size) { index -> val item = items[index] - val isSelected = viewState.selectedUniv == item.name + val isSelected = viewState.selectedUniv == "${item.univName}+${item.campusName}" UnivSelectItem( item = item, isSelected = isSelected, + index = index ) { - viewModel.setEvent(UnivSelectContract.UnivSelectEvent.SelectedUniv(item.name)) + viewModel.setEvent(UnivSelectContract.UnivSelectEvent.SelectedUniv( + "${item.univName}+${item.campusName}") + ) } } } @@ -154,31 +166,37 @@ fun UnivSelectScreen( @SuppressLint("RememberReturnType") @Composable -fun UnivSelectItem(item: Item, isSelected: Boolean, onSelectClick: (Item) -> Unit) { +fun UnivSelectItem(item: Item, isSelected: Boolean, index: Int, onSelectClick: (Item) -> Unit) { Column( modifier = Modifier .clickable( indication = null, interactionSource = remember { MutableInteractionSource() } ) { onSelectClick(item) } - .padding(Paddings.medium) + .padding(bottom = Paddings.medium, end = if(index%2==0) Paddings.medium else 0.dp) .clip(RoundedCornerShape(Paddings.medium)) .background(if (isSelected) Gray500 else Gray100) .fillMaxSize(), horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.Center ) { - Spacer(modifier = Modifier.padding(bottom = 10.dp)) - Image( - painter = painterResource(item.Image), - contentDescription = item.name, - Modifier.size(36.dp) - ) + val spacerSize = if (item.campusName == null) 17.dp else 10.dp + Spacer(modifier = Modifier.padding(spacerSize)) Text( - text = item.name, - fontSize = 14.sp, - modifier = Modifier.padding(10.dp) + text = item.univName, + fontSize = 13.sp, + fontWeight = FontWeight.Bold, + color = Gray800 ) + item.campusName?.let { campusName -> + Spacer(modifier = Modifier.padding(4.dp)) + Text( + text = campusName, + fontSize = 13.sp, + color = Gray600, + ) + } + Spacer(modifier = Modifier.padding(spacerSize)) } } @@ -197,10 +215,11 @@ fun UnivSelectScreenPreview() { fun UnivSelectScreenItemPreview() { EveryMeal_AndroidTheme { UnivSelectItem(item = Item( - Image = R.drawable.image_myongji, - name = "명지대학교" + univName = "명지대", + campusName = "용인캠퍼스" ), - false + false, + index = 0 ) { } diff --git a/presentation/src/main/java/com/everymeal/presentation/ui/theme/Color.kt b/presentation/src/main/java/com/everymeal/presentation/ui/theme/Color.kt index a8649d56..e54d2617 100644 --- a/presentation/src/main/java/com/everymeal/presentation/ui/theme/Color.kt +++ b/presentation/src/main/java/com/everymeal/presentation/ui/theme/Color.kt @@ -14,6 +14,7 @@ val Gray100 = Color(0xFFF9FAFB) val Gray200 = Color(0xFFE5E8EB) val Gray300 = Color(0xFFF2F4F6) val Gray500 = Color(0xFFB0B8C1) +val Gray600 = Color(0xFF8B95A1) var Gray800 = Color(0xFF4E5968) val Main100 = Color(0xFFFF4848) diff --git a/presentation/src/main/res/drawable/icon_school.png b/presentation/src/main/res/drawable/icon_school.png new file mode 100644 index 00000000..36482d93 Binary files /dev/null and b/presentation/src/main/res/drawable/icon_school.png differ diff --git a/presentation/src/main/res/drawable/image_konkuk.png b/presentation/src/main/res/drawable/image_konkuk.png deleted file mode 100644 index e0860fad..00000000 Binary files a/presentation/src/main/res/drawable/image_konkuk.png and /dev/null differ diff --git a/presentation/src/main/res/drawable/image_myongji.png b/presentation/src/main/res/drawable/image_myongji.png deleted file mode 100644 index 4c0d79ab..00000000 Binary files a/presentation/src/main/res/drawable/image_myongji.png and /dev/null differ diff --git a/presentation/src/main/res/drawable/image_seoulwoman.png b/presentation/src/main/res/drawable/image_seoulwoman.png deleted file mode 100644 index 1186786e..00000000 Binary files a/presentation/src/main/res/drawable/image_seoulwoman.png and /dev/null differ diff --git a/presentation/src/main/res/drawable/image_sungsin.png b/presentation/src/main/res/drawable/image_sungsin.png deleted file mode 100644 index 28f25136..00000000 Binary files a/presentation/src/main/res/drawable/image_sungsin.png and /dev/null differ diff --git a/presentation/src/main/res/values/strings.xml b/presentation/src/main/res/values/strings.xml index 5c55a71c..a97cf38b 100644 --- a/presentation/src/main/res/values/strings.xml +++ b/presentation/src/main/res/values/strings.xml @@ -12,6 +12,7 @@ 학교 신청하러가기 채팅아이콘 들어가기 + 학교 선택하기 아이콘 맛집