Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UI/#50] 프로필 뷰 구현 #57

Merged
merged 16 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<activity
android:name="com.going.presentation.starttrip.StartTripSplashActivity"
android:exported="false"
android:screenOrientation="portrait" />
android:screenOrientation="portrait"/>

<activity
android:name="com.going.presentation.todo.mytodo.create.MyTodoCreateActivity"
Expand All @@ -112,6 +112,13 @@
android:exported="false"
android:screenOrientation="portrait"/>

<activity
android:name="com.going.presentation.profile.ProfileActivity"
android:exported="false"
android:screenOrientation="portrait"/>



Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

빈줄이 많네요~

</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.going.domain.entity

data class TendencyResultMock(
val tendencyTitle: String,
val tendencySubTitle: String,
data class ProfileMock(
val profileTitle: String,
val profileSubTitle: String,
val tags: List<String>,
val tendencyBoxInfo: List<BoxInfo>,
val profileBoxInfo: List<BoxInfo>,
) {
data class BoxInfo(
val title: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
package com.going.presentation.profile

import android.os.Bundle
import android.text.SpannableString
import android.text.Spanned
import android.text.style.BulletSpan
import androidx.activity.viewModels
import com.going.presentation.R
import com.going.presentation.databinding.ActivityProfileBinding
import com.going.ui.base.BaseActivity

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

줄바꿈을 권장합니다 ~

super.onCreate(savedInstanceState)

bindProfileInfo()
}

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

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

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

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

tvThirdDescriptionTitle.text = profileBoxInfo[2].title
tvThirdDescriptionFirstText.text =
setBulletPoint(profileBoxInfo[2].first)
tvThirdDescriptionSecondText.text =
setBulletPoint(profileBoxInfo[2].second)
tvThirdDescriptionThirdText.text =
setBulletPoint(profileBoxInfo[2].third)
}
}
}

private fun setBulletPoint(text: String): SpannableString {
val string = SpannableString(text)
string.setSpan(BulletSpan(10), 0, text.length - 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)

return string
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.going.presentation.profile

import androidx.lifecycle.ViewModel
import com.going.domain.entity.ProfileMock

class ProfileViewModel : ViewModel() {
val mockProfileResult: ProfileMock = ProfileMock(
profileTitle = "배려심 많은 인간 플래너",
profileSubTitle = "꼼꼼하고 세심하게 여행을 준비하는 친구",
tags = listOf(
"#친구중심",
"#꼼꼼함",
"#세심함",
),
profileBoxInfo = listOf(
ProfileMock.BoxInfo(
"이런점이\n좋아요",
"같이 가는 친구들을 잘 챙기고 배려해요",
"친구들의 의견을 잘 반영해 만족할 수 있는 일정을 계획해요",
"꼼꼼하고 부지런해 맡은 일에서 실수가 적어요",
),
ProfileMock.BoxInfo(
"이런점은\n주의해줘요",
"완벽주의 성향이 강해 계획이 틀어졌을 때 예민해질 수 있어요",
"싸우지 않고 여행하는 것을 중요시 해 갈등의 조짐이 보이면 많은 스트레스를 받아요",
"예기치 않은 상황에서 크게 당횡해요",
),
ProfileMock.BoxInfo(
"이런걸\n잘해요",
"전반적인 여행 계획 마련",
"호텔과 비행기표 예약 및 관리",
"기타 행동이 필요한 것들",
),
),
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,37 +27,37 @@ class TendencyTestResultActivity :
tvTendencyTestResultTitle.text = getString(R.string.tendency_test_result_title, "찐두릅")

viewModel?.mockTendencyResult?.apply {
tvTendencyTestResultType.text = tendencyTitle
tvTendencyTestResultSubType.text = tendencySubTitle
tvTendencyTestResultType.text = profileTitle
tvTendencyTestResultSubType.text = profileSubTitle

tvTendencyTestResultTag1.text = tags[0]
tvTendencyTestResultTag2.text = tags[1]
tvTendencyTestResultTag3.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
@@ -1,31 +1,31 @@
package com.going.presentation.tendencytest.result

import androidx.lifecycle.ViewModel
import com.going.domain.entity.TendencyResultMock
import com.going.domain.entity.ProfileMock

class TendencyTestResultViewModel : ViewModel() {
val mockTendencyResult: TendencyResultMock = TendencyResultMock(
tendencyTitle = "배려심 많은 인간 플래너",
tendencySubTitle = "꼼꼼하고 세심하게 여행을 준비하는 친구",
val mockTendencyResult: ProfileMock = ProfileMock(
profileTitle = "배려심 많은 인간 플래너",
profileSubTitle = "꼼꼼하고 세심하게 여행을 준비하는 친구",
tags = listOf(
"#친구중심",
"#꼼꼼함",
"#세심함",
),
tendencyBoxInfo = listOf(
TendencyResultMock.BoxInfo(
profileBoxInfo = listOf(
ProfileMock.BoxInfo(
"이런점이\n좋아요",
"같이 가는 친구들을 잘 챙기고 배려해요",
"친구들의 의견을 잘 반영해 만족할 수 있는 일정을 계획해요",
"꼼꼼하고 부지런해 맡은 일에서 실수가 적어요",
),
TendencyResultMock.BoxInfo(
ProfileMock.BoxInfo(
"이런점은\n주의해줘요",
"완벽주의 성향이 강해 계획이 틀어졌을 때 예민해질 수 있어요",
"싸우지 않고 여행하는 것을 중요시 해 갈등의 조짐이 보이면 많은 스트레스를 받아요",
"예기치 않은 상황에서 크게 당횡해요",
),
TendencyResultMock.BoxInfo(
ProfileMock.BoxInfo(
"이런걸\n잘해요",
"전반적인 여행 계획 마련",
"호텔과 비행기표 예약 및 관리",
Expand Down
Loading