Skip to content

Commit

Permalink
[chore] : reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
ham2174 committed Feb 9, 2024
1 parent 1a0a0c3 commit c4aba24
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ data class Profile(
blood = Blood.A,
subways = listOf(
SubwayStation(
"동대문역사문화공원", listOf(
"동대문역사문화공원",
listOf(
SubwayLine.ONE,
SubwayLine.FOUR
)
),
SubwayStation(
"초지역", listOf(
"초지역",
listOf(
SubwayLine.TWO,
SubwayLine.THREE
)
Expand Down
47 changes: 20 additions & 27 deletions feature/profile/src/main/java/com/moya/funch/MyProfileScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ import com.moya.funch.theme.White
import com.moya.funch.uimodel.ProfileLabel

@Composable
internal fun MyProfileRoute(
viewModel: MyProfileViewModel = hiltViewModel(),
onCloseMyProfile: () -> Unit,
) {
internal fun MyProfileRoute(viewModel: MyProfileViewModel = hiltViewModel(), onCloseMyProfile: () -> Unit) {
val profile = viewModel.profile.collectAsState().value

MyProfileScreen(
Expand All @@ -51,17 +48,14 @@ internal fun MyProfileRoute(
}

@Composable
internal fun MyProfileScreen(
onCloseMyProfile: () -> Unit,
profile: Profile,
) {
internal fun MyProfileScreen(onCloseMyProfile: () -> Unit, profile: Profile) {
Box(
modifier = Modifier
.padding(
top = 8.dp,
bottom = 14.dp,
start = 20.dp,
end = 20.dp,
end = 20.dp
)
) {
Column(
Expand All @@ -80,13 +74,13 @@ internal fun MyProfileScreen(
Text(
text = profile.code,
style = FunchTheme.typography.b,
color = Gray400,
color = Gray400
)
Spacer(modifier = Modifier.height(2.dp))
Text(
text = profile.name,
style = FunchTheme.typography.t2,
color = Color.White,
color = Color.White
)
Spacer(modifier = Modifier.height(20.dp))
UsersDistinct(profile = profile)
Expand All @@ -100,7 +94,7 @@ private fun UsersDistinct(profile: Profile) {
Column(
modifier = Modifier
.fillMaxSize(),
verticalArrangement = Arrangement.spacedBy(16.dp),
verticalArrangement = Arrangement.spacedBy(16.dp)
) {
ProfileLabel.entries.forEach { profileLabel ->
val labelValues = when (profileLabel) {
Expand All @@ -114,7 +108,7 @@ private fun UsersDistinct(profile: Profile) {
if (labelValues.isNotEmpty()) {
Row(
modifier = Modifier
.fillMaxWidth(),
.fillMaxWidth()
) {
Box(
modifier = Modifier
Expand All @@ -125,12 +119,12 @@ private fun UsersDistinct(profile: Profile) {
Text(
text = profileLabel.labelName,
color = Gray400,
style = FunchTheme.typography.b,
style = FunchTheme.typography.b
)
}
FlowRow(
horizontalArrangement = Arrangement.spacedBy(8.dp),
verticalArrangement = Arrangement.spacedBy(8.dp),
verticalArrangement = Arrangement.spacedBy(8.dp)
) {
labelValues.forEach { value ->
val leadingIcon = when (profileLabel) {
Expand Down Expand Up @@ -164,7 +158,7 @@ private fun UsersDistinct(profile: Profile) {
Image(
modifier = Modifier.size(18.dp),
painter = icon,
contentDescription = "",
contentDescription = ""
)
}
}
Expand Down Expand Up @@ -200,16 +194,15 @@ private fun UsersDistinct(profile: Profile) {
}

@Composable
private fun profileLeadingIcon(value: String): Painter =
when (value) {
"개발자" -> painterResource(id = FunchIconAsset.Job.developer_24)
"디자인" -> painterResource(id = FunchIconAsset.Job.designer_24)
"디자이너" -> painterResource(id = FunchIconAsset.Club.nexters_24)
"넥스터즈" -> painterResource(id = FunchIconAsset.Club.nexters_24)
"SOPT" -> painterResource(id = FunchIconAsset.Club.sopt_24)
"Depromeet" -> painterResource(id = FunchIconAsset.Club.depromeet_24)
else -> throw IllegalArgumentException("Unknown job: $value")
}
private fun profileLeadingIcon(value: String): Painter = when (value) {
"개발자" -> painterResource(id = FunchIconAsset.Job.developer_24)
"디자인" -> painterResource(id = FunchIconAsset.Job.designer_24)
"디자이너" -> painterResource(id = FunchIconAsset.Club.nexters_24)
"넥스터즈" -> painterResource(id = FunchIconAsset.Club.nexters_24)
"SOPT" -> painterResource(id = FunchIconAsset.Club.sopt_24)
"Depromeet" -> painterResource(id = FunchIconAsset.Club.depromeet_24)
else -> throw IllegalArgumentException("Unknown job: $value")
}

@Composable
private fun subwayLineIcon(line: String): Painter = // @Gun Hyung TODO : 신림역부터 도메인 Entity 추가 되는데로 수정
Expand Down Expand Up @@ -243,7 +236,7 @@ private fun subwayLineIcon(line: String): Painter = // @Gun Hyung TODO : 신림
@Preview(
showBackground = true,
widthDp = 360,
heightDp = 640,
heightDp = 640
)
@Composable
private fun Preview1() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@ package com.moya.funch
import androidx.lifecycle.ViewModel
import com.moya.funch.entity.profile.Profile
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow
import javax.inject.Inject


@HiltViewModel
internal class MyProfileViewModel @Inject constructor(

) : ViewModel() {
internal class MyProfileViewModel @Inject constructor() : ViewModel() {
private val _profile = MutableStateFlow(Profile.default())
val profile = _profile.asStateFlow()

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ enum class ProfileLabel(val labelName: String) {
MBTI("MBTI"),
BLOOD_TYPE("혈액형"),
SUBWAY("지하철")
;
}

0 comments on commit c4aba24

Please sign in to comment.