Skip to content

Commit

Permalink
[FEAT/#50] profile UI 기능 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
crownjoe committed Jan 9, 2024
1 parent 5c732d4 commit ef4688a
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 34 deletions.
24 changes: 12 additions & 12 deletions domain/src/main/kotlin/com/going/domain/entity/ProfileMock.kt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package com.going.domain.entity

data class ProfileMock (
val tendencyTitle: String,
val tendencySubTitle: String,
data class ProfileMock(
val profileTitle: String,
val profileSubTitle: String,
val tags: List<String>,
val tendencyBoxInfo: List<BoxInfo>,
) {
data class BoxInfo(
val title: String,
val first: String,
val second: String,
val third: String,
)
}
val profileBoxInfo: List<BoxInfo>,
) {
data class BoxInfo(
val title: String,
val first: String,
val second: String,
val third: String,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import com.going.ui.base.BaseActivity

class ProfileActivity :
BaseActivity<ActivityProfileBinding>(R.layout.activity_profile) {
private val viewModel by viewModels<ProfileViewModel>()
private val profileViewModel by viewModels<ProfileViewModel>()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

Expand All @@ -20,38 +20,38 @@ class ProfileActivity :

private fun bindProfileInfo() {
with(binding) {
viewModel?.mockProfileResult?.apply {
tvProfileType.text = tendencyTitle
tvProfileSubType.text = tendencySubTitle
profileViewModel.mockProfileResult.apply {
tvProfileType.text = profileTitle
tvProfileSubType.text = profileSubTitle

tvProfileTag1.text = tags[0]
tvProfileTag2.text = tags[1]
tvProfileTag3.text = tags[2]

tvFirstDescriptionTitle.text = tendencyBoxInfo[0].title
tvFirstDescriptionTitle.text = profileBoxInfo[0].title
tvFirstDescriptionFirstText.text =
setBulletPoint(tendencyBoxInfo[0].first)
setBulletPoint(profileBoxInfo[0].first)
tvFirstDescriptionSecondText.text =
setBulletPoint(tendencyBoxInfo[0].second)
setBulletPoint(profileBoxInfo[0].second)
tvFirstDescriptionThirdText.text =
setBulletPoint(tendencyBoxInfo[0].third)
setBulletPoint(profileBoxInfo[0].third)

tvSecondDescriptionTitle.text =
tendencyBoxInfo[1].title
profileBoxInfo[1].title
tvSecondDescriptionFirstText.text =
setBulletPoint(tendencyBoxInfo[1].first)
setBulletPoint(profileBoxInfo[1].first)
tvSecondDescriptionSecondText.text =
setBulletPoint(tendencyBoxInfo[1].second)
setBulletPoint(profileBoxInfo[1].second)
tvSecondDescriptionThirdText.text =
setBulletPoint(tendencyBoxInfo[1].third)
setBulletPoint(profileBoxInfo[1].third)

tvThirdDescriptionTitle.text = tendencyBoxInfo[2].title
tvThirdDescriptionTitle.text = profileBoxInfo[2].title
tvThirdDescriptionFirstText.text =
setBulletPoint(tendencyBoxInfo[2].first)
setBulletPoint(profileBoxInfo[2].first)
tvThirdDescriptionSecondText.text =
setBulletPoint(tendencyBoxInfo[2].second)
setBulletPoint(profileBoxInfo[2].second)
tvThirdDescriptionThirdText.text =
setBulletPoint(tendencyBoxInfo[2].third)
setBulletPoint(profileBoxInfo[2].third)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import com.going.domain.entity.ProfileMock

class ProfileViewModel : ViewModel() {
val mockProfileResult: ProfileMock = ProfileMock(
tendencyTitle = "배려심 많은 인간 플래너",
tendencySubTitle = "꼼꼼하고 세심하게 여행을 준비하는 친구",
profileTitle = "배려심 많은 인간 플래너",
profileSubTitle = "꼼꼼하고 세심하게 여행을 준비하는 친구",
tags = listOf(
"#친구중심",
"#꼼꼼함",
"#세심함",
),
tendencyBoxInfo = listOf(
profileBoxInfo = listOf(
ProfileMock.BoxInfo(
"이런점이\n좋아요",
"같이 가는 친구들을 잘 챙기고 배려해요",
Expand Down
4 changes: 1 addition & 3 deletions presentation/src/main/res/layout/activity_profile.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">

<data>

<variable
name="viewModel"
type="com.going.presentation.profile.ProfileViewModel" />
</data>

<androidx.constraintlayout.widget.ConstraintLayout
Expand Down

0 comments on commit ef4688a

Please sign in to comment.