diff --git a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/common/view/component/FieldSelectComponent.kt b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/common/view/component/FieldSelectComponent.kt index d277e37c..38839d45 100644 --- a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/common/view/component/FieldSelectComponent.kt +++ b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/common/view/component/FieldSelectComponent.kt @@ -44,7 +44,7 @@ fun FieldSelectComponent( .background(color = Gray000) .border( width = 1.dp, - color = if (isSelected) Primary4 else Gray400, + color = if (isSelected) Primary4 else Gray500, shape = Shapes.medium ) .fillMaxWidth() diff --git a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/common/view/textfield/TypingTextField.kt b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/common/view/textfield/TypingTextField.kt index c17a76ae..e78f0b9d 100644 --- a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/common/view/textfield/TypingTextField.kt +++ b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/common/view/textfield/TypingTextField.kt @@ -4,6 +4,7 @@ import ac.dnd.mour.android.presentation.R import ac.dnd.mour.android.presentation.common.theme.Body1 import ac.dnd.mour.android.presentation.common.theme.Body2 import ac.dnd.mour.android.presentation.common.theme.Gray400 +import ac.dnd.mour.android.presentation.common.theme.Gray500 import ac.dnd.mour.android.presentation.common.theme.Gray600 import ac.dnd.mour.android.presentation.common.theme.Gray700 import ac.dnd.mour.android.presentation.common.theme.Gray900 @@ -75,7 +76,7 @@ fun TypingTextField( keyboardActions: KeyboardActions = KeyboardActions.Default, visualTransformation: VisualTransformation = VisualTransformation.None, backgroundColor: Color = Color.White, - basicBorderColor: Color = Gray400, + basicBorderColor: Color = Gray500, cursorColor: Color? = null, hintTextColor: Color = Gray700, textStyle: TextStyle = Body1.merge( diff --git a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/HomeConstant.kt b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/HomeConstant.kt index c91dfb97..1463c8d8 100644 --- a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/HomeConstant.kt +++ b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/HomeConstant.kt @@ -2,4 +2,7 @@ package ac.dnd.mour.android.presentation.ui.main.home object HomeConstant { const val ROUTE = "/home" + + const val ROUTE_ARGUMENT_MESSAGE = "message" + const val ROUTE_STRUCTURE = "${ROUTE}?$ROUTE_ARGUMENT_MESSAGE={$ROUTE_ARGUMENT_MESSAGE}" } diff --git a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/HomeDestination.kt b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/HomeDestination.kt index d9365a6c..44dce97f 100644 --- a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/HomeDestination.kt +++ b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/HomeDestination.kt @@ -12,14 +12,23 @@ import androidx.compose.runtime.getValue import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.navigation.NavGraphBuilder +import androidx.navigation.NavType import androidx.navigation.compose.composable +import androidx.navigation.navArgument fun NavGraphBuilder.homeDestination( appState: ApplicationState ) { composable( - route = HomeConstant.ROUTE + route = HomeConstant.ROUTE_STRUCTURE, + arguments = listOf( + navArgument(HomeConstant.ROUTE_ARGUMENT_MESSAGE) { + type = NavType.StringType + defaultValue = "" + } + ) ) { + val viewModel: HomeViewModel = hiltViewModel() val model: HomeModel = let { diff --git a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/HomeViewModel.kt b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/HomeViewModel.kt index f9dc7c83..a03af584 100644 --- a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/HomeViewModel.kt +++ b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/HomeViewModel.kt @@ -6,10 +6,10 @@ import ac.dnd.mour.android.presentation.common.util.coroutine.event.MutableEvent import ac.dnd.mour.android.presentation.common.util.coroutine.event.asEventFlow import androidx.lifecycle.SavedStateHandle import dagger.hilt.android.lifecycle.HiltViewModel -import javax.inject.Inject import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow +import javax.inject.Inject @HiltViewModel class HomeViewModel @Inject constructor( @@ -22,7 +22,24 @@ class HomeViewModel @Inject constructor( private val _event: MutableEventFlow = MutableEventFlow() val event: EventFlow = _event.asEventFlow() + val message: String by lazy { + savedStateHandle.get(HomeConstant.ROUTE_ARGUMENT_MESSAGE) ?: "" + } + + init { + if (message.isNotEmpty()) { + viewMessage(message) + } + } + fun onIntent(intent: HomeIntent) { } + + private fun viewMessage(message: String) { + launch { + _event.emit(HomeEvent.ShowSnackBar(message)) + } + savedStateHandle.remove(HomeConstant.ROUTE_ARGUMENT_MESSAGE) + } } diff --git a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/group/get/GetGroupIntent.kt b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/group/get/GetGroupIntent.kt index afc8e840..f67f4e00 100644 --- a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/group/get/GetGroupIntent.kt +++ b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/group/get/GetGroupIntent.kt @@ -1,9 +1,5 @@ package ac.dnd.mour.android.presentation.ui.main.home.common.group.get -import ac.dnd.mour.android.domain.model.feature.group.Group - sealed interface GetGroupIntent { data class OnDelete(val id: Long) : GetGroupIntent - data class OnEdit(val group: Group) : GetGroupIntent - data class OnAdd(val group: Group) : GetGroupIntent } diff --git a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/group/get/GetGroupScreen.kt b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/group/get/GetGroupScreen.kt index 0f66cf65..a8463f07 100644 --- a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/group/get/GetGroupScreen.kt +++ b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/group/get/GetGroupScreen.kt @@ -73,7 +73,7 @@ fun GetGroupScreen( appState: ApplicationState, groups: List, onDismissRequest: () -> Unit, - onGroupChange: (List) -> Unit, + onGroupChange: () -> Unit, onResult: (Group) -> Unit, viewModel: GetGroupViewModel = hiltViewModel() ) { @@ -104,7 +104,7 @@ private fun GetGroupScreen( appState: ApplicationState, onDismissRequest: () -> Unit, onResult: (Group) -> Unit, - onGroupChange: (List) -> Unit, + onGroupChange: () -> Unit, model: GetGroupModel, intent: (GetGroupIntent) -> Unit, event: EventFlow, @@ -287,8 +287,11 @@ private fun GetGroupScreen( modifier = Modifier .fillMaxWidth() .background(color = Gray200) + .padding( + horizontal = 20.dp, + vertical = 12.dp + ) .height(56.dp) - .padding(horizontal = 20.dp) .align(Alignment.BottomCenter), contentAlignment = Alignment.CenterStart ) { @@ -332,7 +335,7 @@ private fun GetGroupScreen( }, onConfirm = { intent(GetGroupIntent.OnDelete(model.groups[currentDeleteGroupIndex].id)) - onGroupChange(model.groups) + onGroupChange() currentDeleteGroupIndex = -1 }, onDismissRequest = { @@ -349,8 +352,7 @@ private fun GetGroupScreen( }, prevGroup = model.groups[currentEditGroupIndex], onResult = { - intent(GetGroupIntent.OnEdit(it)) - onGroupChange(model.groups) + onGroupChange() currentEditGroupIndex = -1 } ) @@ -363,9 +365,8 @@ private fun GetGroupScreen( isShowingAddGroupSheet = false }, onResult = { + onGroupChange() isShowingAddGroupSheet = false - intent(GetGroupIntent.OnAdd(it)) - onGroupChange(model.groups) } ) } diff --git a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/group/get/GetGroupViewModel.kt b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/group/get/GetGroupViewModel.kt index 020c13ce..eb8e307d 100644 --- a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/group/get/GetGroupViewModel.kt +++ b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/group/get/GetGroupViewModel.kt @@ -10,10 +10,10 @@ import ac.dnd.mour.android.presentation.common.util.coroutine.event.MutableEvent import ac.dnd.mour.android.presentation.common.util.coroutine.event.asEventFlow import androidx.lifecycle.SavedStateHandle import dagger.hilt.android.lifecycle.HiltViewModel -import javax.inject.Inject import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow +import javax.inject.Inject @HiltViewModel class GetGroupViewModel @Inject constructor( @@ -33,8 +33,6 @@ class GetGroupViewModel @Inject constructor( fun onIntent(intent: GetGroupIntent) { when (intent) { is GetGroupIntent.OnDelete -> deleteGroup(intent.id) - is GetGroupIntent.OnAdd -> addGroup(intent.group) - is GetGroupIntent.OnEdit -> editGroup(intent.group) } } @@ -61,18 +59,4 @@ class GetGroupViewModel @Inject constructor( } } } - - private fun addGroup(group: Group) { - _groups.value = _groups.value.toMutableList().also { - it.add(group) - } - } - - private fun editGroup(newGroup: Group) { - _groups.value = _groups.value.toMutableList().also { - it.replaceAll { group -> - if (group.id == newGroup.id) newGroup else group - } - } - } } diff --git a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/relation/RelationIntent.kt b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/relation/RelationIntent.kt index ab482468..8bd966c5 100644 --- a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/relation/RelationIntent.kt +++ b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/relation/RelationIntent.kt @@ -1,7 +1,5 @@ package ac.dnd.mour.android.presentation.ui.main.home.common.relation -import ac.dnd.mour.android.domain.model.feature.group.Group - sealed interface RelationIntent { data class OnClickAdd( val groupId: Long, @@ -40,8 +38,5 @@ sealed interface RelationIntent { ) : RelationIntent data object OnClickLoadFriend : RelationIntent - - data class OnGroupChange( - val groups: List - ) : RelationIntent + data object OnGroupChange : RelationIntent } diff --git a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/relation/RelationScreen.kt b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/relation/RelationScreen.kt index f30f44f8..c928d5f5 100644 --- a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/relation/RelationScreen.kt +++ b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/relation/RelationScreen.kt @@ -46,8 +46,10 @@ import ac.dnd.mour.android.presentation.model.relation.RelationDetailWithUserInf import ac.dnd.mour.android.presentation.model.relation.RelationType import ac.dnd.mour.android.presentation.ui.main.ApplicationState import ac.dnd.mour.android.presentation.ui.main.common.gallery.GalleryScreen +import ac.dnd.mour.android.presentation.ui.main.home.HomeConstant import ac.dnd.mour.android.presentation.ui.main.home.common.group.get.GetGroupScreen import ac.dnd.mour.android.presentation.ui.main.home.history.registration.HistoryRegistrationConstant +import ac.dnd.mour.android.presentation.ui.main.home.history.scaledSp import ac.dnd.mour.android.presentation.ui.main.rememberApplicationState import androidx.activity.compose.BackHandler import androidx.compose.foundation.Image @@ -102,6 +104,7 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp import androidx.compose.ui.window.Dialog import androidx.compose.ui.window.DialogProperties import coil.compose.AsyncImage @@ -144,6 +147,7 @@ fun RelationScreen( var isShowingGetGroup by remember { mutableStateOf(false) } var isShowingGalleryView by remember { mutableStateOf(false) } var isShowingNonGroupSnackBar by remember { mutableStateOf(false) } + var isShowingInvalidSnackBar by remember { mutableStateOf(false) } var isShowingNonNameSnackBar by remember { mutableStateOf(false) } BackHandler( @@ -155,7 +159,7 @@ fun RelationScreen( LaunchedEffect(Unit) { scope.launch { - delay(40000L) + delay(20000L) isShowingTooltip = false } } @@ -184,7 +188,11 @@ fun RelationScreen( ) appState.navController.navigate(route) } else { - appState.navController.popBackStack() + val route = makeRoute( + HomeConstant.ROUTE, + listOf(HomeConstant.ROUTE_ARGUMENT_MESSAGE to "등록이 완료되었습니다.") + ) + appState.navController.navigate(route) } } } @@ -193,7 +201,11 @@ fun RelationScreen( fun deleteRelation(event: RelationEvent.DeleteRelation) { when (event) { is RelationEvent.DeleteRelation.Success -> { - appState.navController.popBackStack() + val route = makeRoute( + HomeConstant.ROUTE, + listOf(HomeConstant.ROUTE_ARGUMENT_MESSAGE to "삭제가 완료되었습니다.") + ) + appState.navController.navigate(route) } } } @@ -221,6 +233,13 @@ fun RelationScreen( isShowingNonNameSnackBar = false } false + } else if (isNameTypeTyping && isUserNameInValid || !isNameTypeTyping && isKakaoNameInValid) { + scope.launch { + isShowingInvalidSnackBar = true + delay(1000L) + isShowingInvalidSnackBar = false + } + false } else { true } @@ -250,15 +269,19 @@ fun RelationScreen( .height(Space80), contentAlignment = Alignment.Center ) { - Box( - modifier = Modifier.clickable { - isShowingGalleryView = true - } - ) { + Box { Box( modifier = Modifier .aspectRatio(1f) .clip(CircleShape) + .border( + width = 1.dp, + color = Gray400, + shape = CircleShape + ) + .clickable { + isShowingGalleryView = true + } .background(Gray400) ) { if (currentImageUrl.isEmpty()) { @@ -321,10 +344,9 @@ fun RelationScreen( ) { Text( text = "카카오톡에서 자동으로 친구 정보를 가져와요.", - style = Body2.merge( - color = Gray800, - fontWeight = FontWeight.SemiBold - ) + fontWeight = FontWeight.SemiBold, + fontSize = 12.scaledSp(), + style = Body2.merge(color = Gray800) ) } } @@ -363,7 +385,7 @@ fun RelationScreen( chipId = 1, currentSelectedId = setOf(if (isNameTypeTyping) 0 else 1), onSelectChip = { - if (isNameTypeTyping) { + if (isNameTypeTyping && kakaoNameText == "카카오톡에서 친구 선택") { intent(RelationIntent.OnClickLoadFriend) } isNameTypeTyping = false @@ -377,9 +399,9 @@ fun RelationScreen( text = currentNameText, onValueChange = { currentNameText = it - isUserNameInValid = currentNameText.length > 5 + isUserNameInValid = currentNameText.length > 8 }, - hintText = "닉네임 입력 (15자 이내)", + hintText = "닉네임 입력 (8자 이내)", hintTextColor = Gray700, isError = isUserNameInValid, errorMessageContent = { @@ -426,8 +448,8 @@ fun RelationScreen( textType = TypingTextFieldType.Basic, text = kakaoNameText, onValueChange = { - currentNameText = it - isKakaoNameInValid = it.length > 5 + kakaoNameText = it + isKakaoNameInValid = it.length > 8 }, isError = isKakaoNameInValid, isSingleLine = true, @@ -499,7 +521,7 @@ fun RelationScreen( Spacer(modifier = Modifier.height(Space24)) FieldSubject(subject = "그룹") - Spacer(modifier = Modifier.height(6.dp)) + Spacer(modifier = Modifier.height(4.dp)) Box( modifier = Modifier .fillMaxWidth() @@ -590,7 +612,7 @@ fun RelationScreen( subject = "메모", isViewIcon = false ) - Spacer(modifier = Modifier.height(6.dp)) + Spacer(modifier = Modifier.height(7.dp)) when (relationType) { RelationType.EDIT -> { TypingTextField( @@ -856,6 +878,16 @@ fun RelationScreen( SnackBarScreen("이름이 선택되지 않았습니다.") } } + + if (isShowingInvalidSnackBar) { + Box( + modifier = Modifier + .align(Alignment.BottomCenter) + .padding(bottom = 65.dp) + ) { + SnackBarScreen("이름이 유효하지 않습니다.") + } + } } if (isCancelWriteState) { @@ -894,6 +926,7 @@ fun RelationScreen( color = Gray800, fontWeight = FontWeight.SemiBold ), + lineHeight = 25.sp, textAlign = TextAlign.Center ) Spacer(modifier = Modifier.height(20.dp)) @@ -932,7 +965,7 @@ fun RelationScreen( } ) { Text( - text = "계속 ${currentText}", + text = "계속 $currentText", style = Headline3.merge( color = Gray000, fontWeight = FontWeight.SemiBold @@ -957,7 +990,7 @@ fun RelationScreen( currentGroupId = it.id }, onGroupChange = { - intent(RelationIntent.OnGroupChange(it)) + intent(RelationIntent.OnGroupChange) } ) } @@ -975,10 +1008,6 @@ fun RelationScreen( ) } - if (!isNameTypeTyping && kakaoNameText.isEmpty()) { - intent(RelationIntent.OnClickLoadFriend) - } - if (isShowingDeleteDialog) { DialogScreen( isCancelable = true, @@ -1022,7 +1051,7 @@ private fun errorMessage() { ) Spacer(Modifier.width(Space4)) Text( - text = "5자 이내로 입력해주세요", + text = "8자 이내로 입력해주세요", style = Body1.merge(color = Negative) ) } diff --git a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/relation/RelationViewModel.kt b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/relation/RelationViewModel.kt index 5dae8841..9238ad50 100644 --- a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/relation/RelationViewModel.kt +++ b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/relation/RelationViewModel.kt @@ -16,10 +16,10 @@ import ac.dnd.mour.android.presentation.common.util.coroutine.event.MutableEvent import ac.dnd.mour.android.presentation.common.util.coroutine.event.asEventFlow import androidx.lifecycle.SavedStateHandle import dagger.hilt.android.lifecycle.HiltViewModel -import javax.inject.Inject import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow +import javax.inject.Inject @HiltViewModel class RelationViewModel @Inject constructor( @@ -44,24 +44,7 @@ class RelationViewModel @Inject constructor( val groups: StateFlow> = _groups.asStateFlow() init { - launch { - _state.value = RelationState.Loading - getGroupListUseCase() - .onSuccess { - _groups.value = it - } - .onFailure { exception -> - when (exception) { - is ServerException -> { - _errorEvent.emit(ErrorEvent.InvalidRequest(exception)) - } - - else -> { - _errorEvent.emit(ErrorEvent.UnavailableServer(exception)) - } - } - } - } + loadGroup() } fun onIntent(intent: RelationIntent) { @@ -104,7 +87,7 @@ class RelationViewModel @Inject constructor( is RelationIntent.OnClickLoadFriend -> loadKakaoFriend() - is RelationIntent.OnGroupChange -> resetGroup(intent.groups) + is RelationIntent.OnGroupChange -> loadGroup() } } @@ -303,7 +286,24 @@ class RelationViewModel @Inject constructor( } } - private fun resetGroup(newGroups: List) { - _groups.value = newGroups + private fun loadGroup() { + launch { + _state.value = RelationState.Loading + getGroupListUseCase() + .onSuccess { + _groups.value = it + } + .onFailure { exception -> + when (exception) { + is ServerException -> { + _errorEvent.emit(ErrorEvent.InvalidRequest(exception)) + } + + else -> { + _errorEvent.emit(ErrorEvent.UnavailableServer(exception)) + } + } + } + } } } diff --git a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/history/HistoryBackgroundComponent.kt b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/history/HistoryBackgroundComponent.kt index 3a74c2a6..62f04cd5 100644 --- a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/history/HistoryBackgroundComponent.kt +++ b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/history/HistoryBackgroundComponent.kt @@ -71,6 +71,7 @@ fun HistoryBackgroundComponent( onClickAlarm: () -> Unit, onSearchValueChange: (String) -> Unit ) { + val totalCount = model.groups.flatMap { it.relationList }.size val compositionLoading by rememberLottieComposition( spec = LottieCompositionSpec.RawRes(resId = R.raw.loading) ) @@ -185,7 +186,7 @@ fun HistoryBackgroundComponent( Text( fontWeight = FontWeight.SemiBold, style = Headline1.merge(color = Gray000), - text = "총 ${model.groups.size}번의 마음을 \n주고 받았어요", + text = "총 ${totalCount}번의 마음을 \n주고 받았어요", fontSize = 20.scaledSp(), letterSpacing = (-0.25).sp, modifier = Modifier.height(60.dp) diff --git a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/history/HistoryRelationItem.kt b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/history/HistoryRelationItem.kt index 202adfa4..c440ec7e 100644 --- a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/history/HistoryRelationItem.kt +++ b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/history/HistoryRelationItem.kt @@ -37,7 +37,6 @@ import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp -import androidx.compose.ui.unit.sp import java.text.DecimalFormat @Composable @@ -73,17 +72,15 @@ fun HistoryRelationItem( text = relation.name, fontWeight = FontWeight.SemiBold, style = Headline3.merge(color = Gray800), - lineHeight = 24.sp, textAlign = TextAlign.Left, maxLines = 1, overflow = TextOverflow.Ellipsis ) - Spacer(modifier = Modifier.height(1.dp)) + Spacer(modifier = Modifier.height(3.dp)) Text( text = relation.group.name, fontWeight = FontWeight.Medium, style = Body1.merge(color = Gray600), - lineHeight = 21.sp, ) } } diff --git a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/history/detail/HistoryDetailItem.kt b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/history/detail/HistoryDetailItem.kt index 74cd098e..4c835202 100644 --- a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/history/detail/HistoryDetailItem.kt +++ b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/history/detail/HistoryDetailItem.kt @@ -74,23 +74,21 @@ fun HistoryDetailItem( "${relatedHeart.day.dayOfMonth}일", fontWeight = FontWeight.Normal, style = Body1.merge(color = Gray700), - lineHeight = 28.sp, letterSpacing = (-0.25).sp ) val textLength = relatedHeart.event.length val text = if (textLength >= 20) relatedHeart.event.substring(0, 20).plus("...") else relatedHeart.event - Spacer(modifier = Modifier.height(1.dp)) + Spacer(modifier = Modifier.height(5.dp)) Text( text = text, fontWeight = FontWeight.SemiBold, style = Headline3.merge( color = Gray900 - ), - lineHeight = 24.sp + ) ) - Spacer(modifier = Modifier.height(1.dp)) + Spacer(modifier = Modifier.height(4.dp)) Row(verticalAlignment = Alignment.CenterVertically) { Text( text = "${if (relatedHeart.give) "-" else ""}${ @@ -100,8 +98,7 @@ fun HistoryDetailItem( fontWeight = FontWeight.SemiBold, style = Headline3.merge( color = if (relatedHeart.give) Color(0xFF1187D8) else Primary5 - ), - lineHeight = 24.sp + ) ) Text( text = "원", @@ -151,8 +148,7 @@ fun HistoryDetailItem( style = Caption2.merge( color = Gray700, fontWeight = FontWeight.Medium - ), - lineHeight = 18.sp + ) ) } }