From 687db952130da604c7122dc7203511eb6a11b8af Mon Sep 17 00:00:00 2001 From: Dongmin Date: Sun, 7 Jan 2024 10:22:43 +0900 Subject: [PATCH 01/21] =?UTF-8?q?[MOD/#27]=20toolbar,=20img,=20title=20?= =?UTF-8?q?=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 5 ++ .../result/TendencyTestResultActivity.kt | 8 ++ .../main/res/drawable/shape_radius_top_bg.xml | 10 +++ .../layout/activity_tendency_test_result.xml | 89 +++++++++++++++++++ .../res/menu/menu_tb_tendency_test_result.xml | 12 +++ presentation/src/main/res/values/strings.xml | 7 ++ 6 files changed, 131 insertions(+) create mode 100644 presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultActivity.kt create mode 100644 presentation/src/main/res/drawable/shape_radius_top_bg.xml create mode 100644 presentation/src/main/res/layout/activity_tendency_test_result.xml create mode 100644 presentation/src/main/res/menu/menu_tb_tendency_test_result.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index bcded3f7..6599ad45 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -58,6 +58,11 @@ android:exported="false" android:screenOrientation="portrait" /> + + diff --git a/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultActivity.kt b/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultActivity.kt new file mode 100644 index 00000000..3661b8f5 --- /dev/null +++ b/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultActivity.kt @@ -0,0 +1,8 @@ +package com.going.presentation.tendencytest.result + +import com.going.presentation.R +import com.going.presentation.databinding.ActivityTendencyTestResultBinding +import com.going.ui.base.BaseActivity + +class TendencyTestResultActivity : + BaseActivity(R.layout.activity_tendency_test_result) diff --git a/presentation/src/main/res/drawable/shape_radius_top_bg.xml b/presentation/src/main/res/drawable/shape_radius_top_bg.xml new file mode 100644 index 00000000..f8f3bbfa --- /dev/null +++ b/presentation/src/main/res/drawable/shape_radius_top_bg.xml @@ -0,0 +1,10 @@ + + + + + diff --git a/presentation/src/main/res/layout/activity_tendency_test_result.xml b/presentation/src/main/res/layout/activity_tendency_test_result.xml new file mode 100644 index 00000000..0ceaebb5 --- /dev/null +++ b/presentation/src/main/res/layout/activity_tendency_test_result.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/presentation/src/main/res/menu/menu_tb_tendency_test_result.xml b/presentation/src/main/res/menu/menu_tb_tendency_test_result.xml new file mode 100644 index 00000000..27525f4d --- /dev/null +++ b/presentation/src/main/res/menu/menu_tb_tendency_test_result.xml @@ -0,0 +1,12 @@ + + + + + + diff --git a/presentation/src/main/res/values/strings.xml b/presentation/src/main/res/values/strings.xml index 8596eaed..25d118fa 100644 --- a/presentation/src/main/res/values/strings.xml +++ b/presentation/src/main/res/values/strings.xml @@ -31,6 +31,13 @@ 다음 제출하기 + + 유형 검사 결과 + %1$s님의 여행 유형은 + 완성된 프로필 보기 + 다시 해볼래요 + 저장하기 + 이번 여행은 어땠으면 좋겠나요? 시작하기 From d0ac581e335e1c79d2675780778b53e7bbe3f5b1 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Sun, 7 Jan 2024 10:24:37 +0900 Subject: [PATCH 02/21] =?UTF-8?q?[MOD/#27]=20icon=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- presentation/src/main/res/drawable/ic_save_btn.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 presentation/src/main/res/drawable/ic_save_btn.xml diff --git a/presentation/src/main/res/drawable/ic_save_btn.xml b/presentation/src/main/res/drawable/ic_save_btn.xml new file mode 100644 index 00000000..a086bd89 --- /dev/null +++ b/presentation/src/main/res/drawable/ic_save_btn.xml @@ -0,0 +1,14 @@ + + + + From 33e5ac26c813d869fd1c4c6e70b830a69f00d03a Mon Sep 17 00:00:00 2001 From: Dongmin Date: Sun, 7 Jan 2024 12:41:45 +0900 Subject: [PATCH 03/21] =?UTF-8?q?[CHORE/#27]=20Button=20color=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../drawable/sel_rounded_corner_button.xml | 2 +- .../res/layout/activity_tendency_test.xml | 2 +- .../layout/activity_tendency_test_result.xml | 261 ++++++++++++++---- 3 files changed, 209 insertions(+), 56 deletions(-) diff --git a/presentation/src/main/res/drawable/sel_rounded_corner_button.xml b/presentation/src/main/res/drawable/sel_rounded_corner_button.xml index 59dbca25..bc06065a 100644 --- a/presentation/src/main/res/drawable/sel_rounded_corner_button.xml +++ b/presentation/src/main/res/drawable/sel_rounded_corner_button.xml @@ -4,7 +4,7 @@ - + diff --git a/presentation/src/main/res/layout/activity_tendency_test.xml b/presentation/src/main/res/layout/activity_tendency_test.xml index a4a80452..207d80de 100644 --- a/presentation/src/main/res/layout/activity_tendency_test.xml +++ b/presentation/src/main/res/layout/activity_tendency_test.xml @@ -187,7 +187,7 @@ android:enabled="@{viewModel.isChecked()}" android:paddingVertical="10dp" android:text="@{viewModel.step == 9 ? @string/tendency_test_button_final : @string/tendency_test_button_next}" - android:textColor="@color/white_000" + android:textColor="@color/gray_200" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> diff --git a/presentation/src/main/res/layout/activity_tendency_test_result.xml b/presentation/src/main/res/layout/activity_tendency_test_result.xml index 0ceaebb5..317ba6d0 100644 --- a/presentation/src/main/res/layout/activity_tendency_test_result.xml +++ b/presentation/src/main/res/layout/activity_tendency_test_result.xml @@ -16,73 +16,226 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:paddingStart="24dp" - android:paddingTop="18dp" - android:paddingBottom="16dp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:menu="@menu/menu_tb_tendency_test_result" app:title="@string/tendency_test_result_toolbar" /> - + app:layout_constraintBottom_toTopOf="@id/btn_tendency_test_result_finish"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + - - - - - - - - - - - + app:layout_constraintStart_toStartOf="parent" /> + + + From 75a8b4079c1775188e0379f89838839d27ab8af5 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Sun, 7 Jan 2024 14:39:42 +0900 Subject: [PATCH 04/21] =?UTF-8?q?[CHORE/#27]=20shape=20=EA=B8=B0=EC=B4=88?= =?UTF-8?q?=20=EC=85=8B=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 2 +- presentation/src/main/res/drawable/shape_tag_bg.xml | 5 +++++ .../main/res/layout/activity_onboarding_profile_setting.xml | 2 +- presentation/src/main/res/values/strings.xml | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 presentation/src/main/res/drawable/shape_tag_bg.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 6599ad45..f05416eb 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -51,7 +51,7 @@ + android:exported="false" /> + + + + diff --git a/presentation/src/main/res/layout/activity_onboarding_profile_setting.xml b/presentation/src/main/res/layout/activity_onboarding_profile_setting.xml index f5174750..7afc9800 100644 --- a/presentation/src/main/res/layout/activity_onboarding_profile_setting.xml +++ b/presentation/src/main/res/layout/activity_onboarding_profile_setting.xml @@ -126,7 +126,7 @@ android:onClick="@{() -> viewModel.setIsMoveScreenAvailable()}" android:paddingVertical="10dp" android:text="@string/onboarding_finish_btn" - android:textColor="@{viewModel.isProfileAvailable() == true ? @color/white_000 : @color/gray_50}" + android:textColor="@{viewModel.isProfileAvailable() == true ? @color/white_000 : @color/gray_200}" android:textSize="16sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" diff --git a/presentation/src/main/res/values/strings.xml b/presentation/src/main/res/values/strings.xml index 25d118fa..a03b02e8 100644 --- a/presentation/src/main/res/values/strings.xml +++ b/presentation/src/main/res/values/strings.xml @@ -35,7 +35,7 @@ 유형 검사 결과 %1$s님의 여행 유형은 완성된 프로필 보기 - 다시 해볼래요 + 다시 해볼래요 저장하기 From ca151374d9ef9fb1d43ad7ab9ec723ea96aa919b Mon Sep 17 00:00:00 2001 From: Dongmin Date: Sun, 7 Jan 2024 16:24:26 +0900 Subject: [PATCH 05/21] =?UTF-8?q?[UI/#27]=20=EB=9F=AC=ED=94=84=ED=95=9C=20?= =?UTF-8?q?UI=20=EC=99=84=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ape_line_gray100_fill_dash_16_vertical.xml | 12 ++ .../drawable/shape_rect_6_gray200_line.xml | 6 + .../layout/activity_tendency_test_result.xml | 119 ++++++++++++------ 3 files changed, 98 insertions(+), 39 deletions(-) create mode 100644 presentation/src/main/res/drawable/shape_line_gray100_fill_dash_16_vertical.xml create mode 100644 presentation/src/main/res/drawable/shape_rect_6_gray200_line.xml diff --git a/presentation/src/main/res/drawable/shape_line_gray100_fill_dash_16_vertical.xml b/presentation/src/main/res/drawable/shape_line_gray100_fill_dash_16_vertical.xml new file mode 100644 index 00000000..71e19705 --- /dev/null +++ b/presentation/src/main/res/drawable/shape_line_gray100_fill_dash_16_vertical.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/presentation/src/main/res/drawable/shape_rect_6_gray200_line.xml b/presentation/src/main/res/drawable/shape_rect_6_gray200_line.xml new file mode 100644 index 00000000..661bad29 --- /dev/null +++ b/presentation/src/main/res/drawable/shape_rect_6_gray200_line.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/presentation/src/main/res/layout/activity_tendency_test_result.xml b/presentation/src/main/res/layout/activity_tendency_test_result.xml index 317ba6d0..ea3e9c88 100644 --- a/presentation/src/main/res/layout/activity_tendency_test_result.xml +++ b/presentation/src/main/res/layout/activity_tendency_test_result.xml @@ -25,10 +25,10 @@ + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/tb_tendency_test_result"> + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/img_tendency_test_result" + app:layout_constraintVertical_bias="0.985"> - + + + + + app:layout_constraintStart_toEndOf="@id/first_description_title" + app:layout_constraintTop_toTopOf="parent" /> - + app:layout_constraintTop_toBottomOf="@id/cl_box_description_first"> - + + + - + app:layout_constraintTop_toBottomOf="@id/cl_box_description_second"> + + + + - - + app:layout_constraintStart_toStartOf="parent" /> From a863a825eaa70633c288366b079f95da1e394c7f Mon Sep 17 00:00:00 2001 From: Dongmin Date: Sun, 7 Jan 2024 17:53:52 +0900 Subject: [PATCH 06/21] =?UTF-8?q?[UI/#27]=20=EC=97=AC=ED=96=89=EC=9C=A0?= =?UTF-8?q?=ED=98=95=20box=20=EA=B8=B0=EB=B3=B8=EC=A0=81=EC=9D=B8=20?= =?UTF-8?q?=EB=94=94=EC=9E=90=EC=9D=B8=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../going/domain/entity/TendencyResultMock.kt | 8 + .../result/TendencyTestResultActivity.kt | 34 ++++- .../result/TendencyTestResultViewModel.kt | 27 ++++ ...ape_line_gray100_fill_dash_16_vertical.xml | 15 +- .../layout/activity_tendency_test_result.xml | 138 ++++++++++++++++-- 5 files changed, 201 insertions(+), 21 deletions(-) create mode 100644 domain/src/main/kotlin/com/going/domain/entity/TendencyResultMock.kt create mode 100644 presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultViewModel.kt diff --git a/domain/src/main/kotlin/com/going/domain/entity/TendencyResultMock.kt b/domain/src/main/kotlin/com/going/domain/entity/TendencyResultMock.kt new file mode 100644 index 00000000..28c23bc3 --- /dev/null +++ b/domain/src/main/kotlin/com/going/domain/entity/TendencyResultMock.kt @@ -0,0 +1,8 @@ +package com.going.domain.entity + +data class TendencyResultMock( + val title: String, + val first: String, + val second: String, + val third: String, +) diff --git a/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultActivity.kt b/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultActivity.kt index 3661b8f5..23d27dd4 100644 --- a/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultActivity.kt +++ b/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultActivity.kt @@ -1,8 +1,40 @@ package com.going.presentation.tendencytest.result +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.ActivityTendencyTestResultBinding import com.going.ui.base.BaseActivity class TendencyTestResultActivity : - BaseActivity(R.layout.activity_tendency_test_result) + BaseActivity(R.layout.activity_tendency_test_result) { + private val viewModel by viewModels() + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + binding.tvFirstDescriptionTitle.text = viewModel.mockList[0].title + binding.tvFirstDescriptionFirstText.text = test(viewModel.mockList[0].first) + binding.tvFirstDescriptionSecondText.text = test(viewModel.mockList[0].second) + binding.tvFirstDescriptionThirdText.text = test(viewModel.mockList[0].third) + + binding.tvSecondDescriptionTitle.text = viewModel.mockList[1].title + binding.tvSecondDescriptionFirstText.text = test(viewModel.mockList[1].first) + binding.tvSecondDescriptionSecondText.text = test(viewModel.mockList[1].second) + binding.tvSecondDescriptionThirdText.text = test(viewModel.mockList[1].third) + + binding.tvThirdDescriptionTitle.text = viewModel.mockList[2].title + binding.tvThirdDescriptionFirstText.text = test(viewModel.mockList[2].first) + binding.tvThirdDescriptionSecondText.text = test(viewModel.mockList[2].second) + binding.tvThirdDescriptionThirdText.text = test(viewModel.mockList[2].third) + } + + fun test(text: String): SpannableString { + val string = SpannableString(text) + string.setSpan(BulletSpan(), 0, text.length - 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE) + + return string + } +} diff --git a/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultViewModel.kt b/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultViewModel.kt new file mode 100644 index 00000000..4f11943c --- /dev/null +++ b/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultViewModel.kt @@ -0,0 +1,27 @@ +package com.going.presentation.tendencytest.result + +import androidx.lifecycle.ViewModel +import com.going.domain.entity.TendencyResultMock + +class TendencyTestResultViewModel : ViewModel() { + val mockList: List = listOf( + TendencyResultMock( + "이런점이\n좋아요", + "같이 가는 친구들을 잘 챙기고 배려해요", + "친구들의 의견을 잘 반영해 만족할 수 있는 일정을 계획해요", + "꼼꼼하고 부지런해 맡은 일에서 실수가 적어요", + ), + TendencyResultMock( + "이런점은\n주의해줘요", + "완벽주의 성향이 강해 계획이 틀어졌을 때 예민해질 수 있어요", + "싸우지 않고 여행하는 것을 중요시 해 갈등의 조짐이 보이면 많은 스트레스를 받아요", + "예기치 않은 상황에서 크게 당횡해요", + ), + TendencyResultMock( + "이런걸\n잘해요", + "전반적인 여행 계획 마련", + "호텔과 비행기표 예약 및 관리", + "기타 행동이 필요한 것들", + ), + ) +} diff --git a/presentation/src/main/res/drawable/shape_line_gray100_fill_dash_16_vertical.xml b/presentation/src/main/res/drawable/shape_line_gray100_fill_dash_16_vertical.xml index 71e19705..e68683ed 100644 --- a/presentation/src/main/res/drawable/shape_line_gray100_fill_dash_16_vertical.xml +++ b/presentation/src/main/res/drawable/shape_line_gray100_fill_dash_16_vertical.xml @@ -1,12 +1,5 @@ - - - - - - - + diff --git a/presentation/src/main/res/layout/activity_tendency_test_result.xml b/presentation/src/main/res/layout/activity_tendency_test_result.xml index ea3e9c88..d09aedd0 100644 --- a/presentation/src/main/res/layout/activity_tendency_test_result.xml +++ b/presentation/src/main/res/layout/activity_tendency_test_result.xml @@ -3,7 +3,9 @@ xmlns:app="http://schemas.android.com/apk/res-auto"> - + + + + + + + + + + + + + + + + + + + + + + Date: Sun, 7 Jan 2024 17:59:00 +0900 Subject: [PATCH 07/21] =?UTF-8?q?[UI/#27]=20btn=20=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/TendencyTestResultActivity.kt | 16 ++++++++++++++++ .../res/layout/activity_tendency_test_result.xml | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultActivity.kt b/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultActivity.kt index 23d27dd4..21ba7edf 100644 --- a/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultActivity.kt +++ b/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultActivity.kt @@ -8,6 +8,7 @@ import androidx.activity.viewModels import com.going.presentation.R import com.going.presentation.databinding.ActivityTendencyTestResultBinding import com.going.ui.base.BaseActivity +import com.going.ui.extension.setOnSingleClickListener class TendencyTestResultActivity : BaseActivity(R.layout.activity_tendency_test_result) { @@ -29,6 +30,21 @@ class TendencyTestResultActivity : binding.tvThirdDescriptionFirstText.text = test(viewModel.mockList[2].first) binding.tvThirdDescriptionSecondText.text = test(viewModel.mockList[2].second) binding.tvThirdDescriptionThirdText.text = test(viewModel.mockList[2].third) + + initFinishBtnClickListener() + initRestartBtnClickListener() + } + + private fun initFinishBtnClickListener() { + binding.btnTendencyTestResultFinish.setOnSingleClickListener { + // 페이지 이동 + } + } + + private fun initRestartBtnClickListener() { + binding.btnTendencyTestResultRestart.setOnSingleClickListener { + // 다시 시작 + } } fun test(text: String): SpannableString { diff --git a/presentation/src/main/res/layout/activity_tendency_test_result.xml b/presentation/src/main/res/layout/activity_tendency_test_result.xml index d09aedd0..bc1fd27c 100644 --- a/presentation/src/main/res/layout/activity_tendency_test_result.xml +++ b/presentation/src/main/res/layout/activity_tendency_test_result.xml @@ -382,12 +382,12 @@ android:text="@string/tendency_test_result_finish_button" android:textColor="@color/white_000" android:textSize="16sp" - app:layout_constraintBottom_toTopOf="@id/btn_tendency_test_result" + app:layout_constraintBottom_toTopOf="@id/btn_tendency_test_result_restart" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> Date: Sun, 7 Jan 2024 18:00:29 +0900 Subject: [PATCH 08/21] =?UTF-8?q?[CHORE/#27]=20=ED=95=A8=EC=88=98=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/TendencyTestResultActivity.kt | 40 ++++++++++--------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultActivity.kt b/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultActivity.kt index 21ba7edf..56c75771 100644 --- a/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultActivity.kt +++ b/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultActivity.kt @@ -16,23 +16,34 @@ class TendencyTestResultActivity : override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + bindTendencyInfo() + + initFinishBtnClickListener() + initRestartBtnClickListener() + } + + private fun bindTendencyInfo() { binding.tvFirstDescriptionTitle.text = viewModel.mockList[0].title - binding.tvFirstDescriptionFirstText.text = test(viewModel.mockList[0].first) - binding.tvFirstDescriptionSecondText.text = test(viewModel.mockList[0].second) - binding.tvFirstDescriptionThirdText.text = test(viewModel.mockList[0].third) + binding.tvFirstDescriptionFirstText.text = setBulletPoint(viewModel.mockList[0].first) + binding.tvFirstDescriptionSecondText.text = setBulletPoint(viewModel.mockList[0].second) + binding.tvFirstDescriptionThirdText.text = setBulletPoint(viewModel.mockList[0].third) binding.tvSecondDescriptionTitle.text = viewModel.mockList[1].title - binding.tvSecondDescriptionFirstText.text = test(viewModel.mockList[1].first) - binding.tvSecondDescriptionSecondText.text = test(viewModel.mockList[1].second) - binding.tvSecondDescriptionThirdText.text = test(viewModel.mockList[1].third) + binding.tvSecondDescriptionFirstText.text = setBulletPoint(viewModel.mockList[1].first) + binding.tvSecondDescriptionSecondText.text = setBulletPoint(viewModel.mockList[1].second) + binding.tvSecondDescriptionThirdText.text = setBulletPoint(viewModel.mockList[1].third) binding.tvThirdDescriptionTitle.text = viewModel.mockList[2].title - binding.tvThirdDescriptionFirstText.text = test(viewModel.mockList[2].first) - binding.tvThirdDescriptionSecondText.text = test(viewModel.mockList[2].second) - binding.tvThirdDescriptionThirdText.text = test(viewModel.mockList[2].third) + binding.tvThirdDescriptionFirstText.text = setBulletPoint(viewModel.mockList[2].first) + binding.tvThirdDescriptionSecondText.text = setBulletPoint(viewModel.mockList[2].second) + binding.tvThirdDescriptionThirdText.text = setBulletPoint(viewModel.mockList[2].third) + } - initFinishBtnClickListener() - initRestartBtnClickListener() + private fun setBulletPoint(text: String): SpannableString { + val string = SpannableString(text) + string.setSpan(BulletSpan(), 0, text.length - 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE) + + return string } private fun initFinishBtnClickListener() { @@ -46,11 +57,4 @@ class TendencyTestResultActivity : // 다시 시작 } } - - fun test(text: String): SpannableString { - val string = SpannableString(text) - string.setSpan(BulletSpan(), 0, text.length - 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE) - - return string - } } From b4289e9e2264cd437c9fd570112c70ed233e7fd2 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Sun, 7 Jan 2024 21:57:34 +0900 Subject: [PATCH 09/21] =?UTF-8?q?[CHORE/#28]=20=EB=AA=A9=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=20=EA=B5=AC=EC=A1=B0=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../going/domain/entity/TendencyResultMock.kt | 17 +++++--- .../result/TendencyTestResultActivity.kt | 28 ++++++------ .../result/TendencyTestResultViewModel.kt | 43 +++++++++++-------- 3 files changed, 52 insertions(+), 36 deletions(-) diff --git a/domain/src/main/kotlin/com/going/domain/entity/TendencyResultMock.kt b/domain/src/main/kotlin/com/going/domain/entity/TendencyResultMock.kt index 28c23bc3..76eea743 100644 --- a/domain/src/main/kotlin/com/going/domain/entity/TendencyResultMock.kt +++ b/domain/src/main/kotlin/com/going/domain/entity/TendencyResultMock.kt @@ -1,8 +1,15 @@ package com.going.domain.entity data class TendencyResultMock( - val title: String, - val first: String, - val second: String, - val third: String, -) + val tendencyTitle: String, + val tendencySubTitle: String, + val tags: List, + val tendencyBoxInfo: List, +) { + data class BoxInfo( + val title: String, + val first: String, + val second: String, + val third: String, + ) +} diff --git a/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultActivity.kt b/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultActivity.kt index 56c75771..b7cbba2e 100644 --- a/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultActivity.kt +++ b/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultActivity.kt @@ -23,20 +23,20 @@ class TendencyTestResultActivity : } private fun bindTendencyInfo() { - binding.tvFirstDescriptionTitle.text = viewModel.mockList[0].title - binding.tvFirstDescriptionFirstText.text = setBulletPoint(viewModel.mockList[0].first) - binding.tvFirstDescriptionSecondText.text = setBulletPoint(viewModel.mockList[0].second) - binding.tvFirstDescriptionThirdText.text = setBulletPoint(viewModel.mockList[0].third) - - binding.tvSecondDescriptionTitle.text = viewModel.mockList[1].title - binding.tvSecondDescriptionFirstText.text = setBulletPoint(viewModel.mockList[1].first) - binding.tvSecondDescriptionSecondText.text = setBulletPoint(viewModel.mockList[1].second) - binding.tvSecondDescriptionThirdText.text = setBulletPoint(viewModel.mockList[1].third) - - binding.tvThirdDescriptionTitle.text = viewModel.mockList[2].title - binding.tvThirdDescriptionFirstText.text = setBulletPoint(viewModel.mockList[2].first) - binding.tvThirdDescriptionSecondText.text = setBulletPoint(viewModel.mockList[2].second) - binding.tvThirdDescriptionThirdText.text = setBulletPoint(viewModel.mockList[2].third) + binding.tvFirstDescriptionTitle.text = viewModel.mockTendencyResult.tendencyBoxInfo[0].title + binding.tvFirstDescriptionFirstText.text = setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[0].first) + binding.tvFirstDescriptionSecondText.text = setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[0].second) + binding.tvFirstDescriptionThirdText.text = setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[0].third) + + binding.tvSecondDescriptionTitle.text = viewModel.mockTendencyResult.tendencyBoxInfo[1].title + binding.tvSecondDescriptionFirstText.text = setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[1].first) + binding.tvSecondDescriptionSecondText.text = setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[1].second) + binding.tvSecondDescriptionThirdText.text = setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[1].third) + + binding.tvThirdDescriptionTitle.text = viewModel.mockTendencyResult.tendencyBoxInfo[2].title + binding.tvThirdDescriptionFirstText.text = setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[2].first) + binding.tvThirdDescriptionSecondText.text = setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[2].second) + binding.tvThirdDescriptionThirdText.text = setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[2].third) } private fun setBulletPoint(text: String): SpannableString { diff --git a/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultViewModel.kt b/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultViewModel.kt index 4f11943c..afd1f23d 100644 --- a/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultViewModel.kt +++ b/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultViewModel.kt @@ -4,24 +4,33 @@ import androidx.lifecycle.ViewModel import com.going.domain.entity.TendencyResultMock class TendencyTestResultViewModel : ViewModel() { - val mockList: List = listOf( - TendencyResultMock( - "이런점이\n좋아요", - "같이 가는 친구들을 잘 챙기고 배려해요", - "친구들의 의견을 잘 반영해 만족할 수 있는 일정을 계획해요", - "꼼꼼하고 부지런해 맡은 일에서 실수가 적어요", + val mockTendencyResult: TendencyResultMock = TendencyResultMock( + tendencyTitle = "배려심 많은 인간 플래너", + tendencySubTitle = "꼼꼼하고 세심ㄴ하게 여행을 준비하는 친구", + tags = listOf( + "친구중심", + "꼼꼼함", + "세심함", ), - TendencyResultMock( - "이런점은\n주의해줘요", - "완벽주의 성향이 강해 계획이 틀어졌을 때 예민해질 수 있어요", - "싸우지 않고 여행하는 것을 중요시 해 갈등의 조짐이 보이면 많은 스트레스를 받아요", - "예기치 않은 상황에서 크게 당횡해요", - ), - TendencyResultMock( - "이런걸\n잘해요", - "전반적인 여행 계획 마련", - "호텔과 비행기표 예약 및 관리", - "기타 행동이 필요한 것들", + tendencyBoxInfo = listOf( + TendencyResultMock.BoxInfo( + "이런점이\n좋아요", + "같이 가는 친구들을 잘 챙기고 배려해요", + "친구들의 의견을 잘 반영해 만족할 수 있는 일정을 계획해요", + "꼼꼼하고 부지런해 맡은 일에서 실수가 적어요", + ), + TendencyResultMock.BoxInfo( + "이런점은\n주의해줘요", + "완벽주의 성향이 강해 계획이 틀어졌을 때 예민해질 수 있어요", + "싸우지 않고 여행하는 것을 중요시 해 갈등의 조짐이 보이면 많은 스트레스를 받아요", + "예기치 않은 상황에서 크게 당횡해요", + ), + TendencyResultMock.BoxInfo( + "이런걸\n잘해요", + "전반적인 여행 계획 마련", + "호텔과 비행기표 예약 및 관리", + "기타 행동이 필요한 것들", + ), ), ) } From 3e8c3316b8cc12100f8736a21318f3189eea18dd Mon Sep 17 00:00:00 2001 From: Dongmin Date: Sun, 7 Jan 2024 22:10:06 +0900 Subject: [PATCH 10/21] =?UTF-8?q?[CHORE/#28]=20corner=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/res/drawable/shape_radius_top_bg.xml | 7 ++++--- .../main/res/layout/activity_tendency_test_result.xml | 11 ++++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/presentation/src/main/res/drawable/shape_radius_top_bg.xml b/presentation/src/main/res/drawable/shape_radius_top_bg.xml index f8f3bbfa..aed64ec5 100644 --- a/presentation/src/main/res/drawable/shape_radius_top_bg.xml +++ b/presentation/src/main/res/drawable/shape_radius_top_bg.xml @@ -1,10 +1,11 @@ - + android:padding="10dp" + android:shape="rectangle"> + android:topRightRadius="8dp" /> + diff --git a/presentation/src/main/res/layout/activity_tendency_test_result.xml b/presentation/src/main/res/layout/activity_tendency_test_result.xml index bc1fd27c..766f229e 100644 --- a/presentation/src/main/res/layout/activity_tendency_test_result.xml +++ b/presentation/src/main/res/layout/activity_tendency_test_result.xml @@ -42,6 +42,7 @@ android:layout_height="200dp" android:layout_marginTop="10dp" android:src="@drawable/img_sign_in_main" + android:background="@color/black_000" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -54,10 +55,8 @@ android:paddingHorizontal="24dp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@id/img_tendency_test_result" - app:layout_constraintVertical_bias="0.985"> + app:layout_constraintTop_toBottomOf="@id/img_tendency_test_result"> Date: Mon, 8 Jan 2024 00:12:09 +0900 Subject: [PATCH 11/21] =?UTF-8?q?[FEAT/#28]=20login=20=EA=B8=B0=EB=8A=A5?= =?UTF-8?q?=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 5 +++ .../com/going/going/di/DataSourceModule.kt | 10 ++++- .../com/going/going/di/RepositoryModule.kt | 8 +++- .../java/com/going/going/di/ServiceModule.kt | 8 +++- .../going/data/datasource/LoginDataSource.kt | 11 +++++ .../datasourceImpl/LoginDataSourceImpl.kt | 17 ++++++++ .../going/data/dto/request/RequestLoginDto.kt | 10 +++++ .../data/dto/response/ResponseLoginDto.kt | 26 ++++++++++++ .../repositoryImpl/LoginRepositoryImpl.kt | 16 ++++++++ .../com/going/data/service/LoginService.kt | 15 +++++++ .../domain/entity/response/AuthTokenModel.kt | 1 - .../domain/repository/LoginRepository.kt | 10 +++++ .../going/presentation/auth/LoginActivity.kt | 2 + .../going/presentation/auth/LoginViewModel.kt | 41 ++++++++++++++----- 14 files changed, 165 insertions(+), 15 deletions(-) create mode 100644 data/src/main/java/com/going/data/datasource/LoginDataSource.kt create mode 100644 data/src/main/java/com/going/data/datasourceImpl/LoginDataSourceImpl.kt create mode 100644 data/src/main/java/com/going/data/dto/request/RequestLoginDto.kt create mode 100644 data/src/main/java/com/going/data/dto/response/ResponseLoginDto.kt create mode 100644 data/src/main/java/com/going/data/repositoryImpl/LoginRepositoryImpl.kt create mode 100644 data/src/main/java/com/going/data/service/LoginService.kt create mode 100644 domain/src/main/kotlin/com/going/domain/repository/LoginRepository.kt diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c43b914e..7e318e49 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -41,6 +41,11 @@ + + = + runCatching { + loginDataSource.postLogin(Authorization, RequestLoginDto(platform)).toAuthTokenModel() + } +} diff --git a/data/src/main/java/com/going/data/service/LoginService.kt b/data/src/main/java/com/going/data/service/LoginService.kt new file mode 100644 index 00000000..a01277f7 --- /dev/null +++ b/data/src/main/java/com/going/data/service/LoginService.kt @@ -0,0 +1,15 @@ +package com.going.data.service + +import com.going.data.dto.request.RequestLoginDto +import com.going.data.dto.response.ResponseLoginDto +import retrofit2.http.Body +import retrofit2.http.Header +import retrofit2.http.POST + +interface LoginService { + @POST("api/users/signin") + suspend fun postSignin( + @Header("Authorization") Authorization: String, + @Body body: RequestLoginDto, + ): ResponseLoginDto +} diff --git a/domain/src/main/kotlin/com/going/domain/entity/response/AuthTokenModel.kt b/domain/src/main/kotlin/com/going/domain/entity/response/AuthTokenModel.kt index 38fe35f9..651139d0 100644 --- a/domain/src/main/kotlin/com/going/domain/entity/response/AuthTokenModel.kt +++ b/domain/src/main/kotlin/com/going/domain/entity/response/AuthTokenModel.kt @@ -1,7 +1,6 @@ package com.going.domain.entity.response data class AuthTokenModel( - val isResigned: Boolean, val accessToken: String, val refreshToken: String, ) diff --git a/domain/src/main/kotlin/com/going/domain/repository/LoginRepository.kt b/domain/src/main/kotlin/com/going/domain/repository/LoginRepository.kt new file mode 100644 index 00000000..8b70be28 --- /dev/null +++ b/domain/src/main/kotlin/com/going/domain/repository/LoginRepository.kt @@ -0,0 +1,10 @@ +package com.going.domain.repository + +import com.going.domain.entity.response.AuthTokenModel + +interface LoginRepository { + suspend fun postSignin( + Authorization: String, + platform: String, + ): Result +} diff --git a/presentation/src/main/java/com/going/presentation/auth/LoginActivity.kt b/presentation/src/main/java/com/going/presentation/auth/LoginActivity.kt index 32c405e7..f46301f3 100644 --- a/presentation/src/main/java/com/going/presentation/auth/LoginActivity.kt +++ b/presentation/src/main/java/com/going/presentation/auth/LoginActivity.kt @@ -9,9 +9,11 @@ import com.going.presentation.databinding.ActivityLoginBinding import com.going.ui.base.BaseActivity import com.going.ui.extension.UiState import com.going.ui.extension.setOnSingleClickListener +import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach +@AndroidEntryPoint class LoginActivity : BaseActivity(R.layout.activity_login) { private val viewModel by viewModels() diff --git a/presentation/src/main/java/com/going/presentation/auth/LoginViewModel.kt b/presentation/src/main/java/com/going/presentation/auth/LoginViewModel.kt index 54fd0a35..86809c7b 100644 --- a/presentation/src/main/java/com/going/presentation/auth/LoginViewModel.kt +++ b/presentation/src/main/java/com/going/presentation/auth/LoginViewModel.kt @@ -1,19 +1,27 @@ package com.going.presentation.auth import android.content.Context +import android.util.Log import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.going.domain.entity.response.AuthTokenModel +import com.going.domain.repository.LoginRepository import com.going.ui.extension.UiState import com.kakao.sdk.auth.model.OAuthToken import com.kakao.sdk.common.model.ClientError import com.kakao.sdk.common.model.ClientErrorCause import com.kakao.sdk.user.UserApiClient +import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.launch +import timber.log.Timber +import javax.inject.Inject -class LoginViewModel : ViewModel() { +@HiltViewModel +class LoginViewModel @Inject constructor( + private val loginRepository: LoginRepository, +) : ViewModel() { private val _postChangeTokenState = MutableStateFlow>(UiState.Empty) val postChangeTokenState: StateFlow> = _postChangeTokenState @@ -21,6 +29,7 @@ class LoginViewModel : ViewModel() { val isAppLoginAvailable: StateFlow = _isAppLoginAvailable private var webLoginCallback: (OAuthToken?, Throwable?) -> Unit = { token, error -> + Log.e("TAG", "error : $error / token : $token") if (error == null && token != null) { changeTokenFromServer( accessToken = token.accessToken, @@ -31,10 +40,14 @@ class LoginViewModel : ViewModel() { private var appLoginCallback: (OAuthToken?, Throwable?) -> Unit = { token, error -> if (error != null) { // 뒤로가기 경우 예외 처리 + Log.e("TAG", "error : $error / token : $token") if (!(error is ClientError && error.reason == ClientErrorCause.Cancelled)) { + Log.e("TAG", "이 무슨 error : $error / token : $token") _isAppLoginAvailable.value = false } } else if (token != null) { + Log.e("TAG", "전부 error : $error / token : $token") + Log.e("TAG", "${token.accessToken}") changeTokenFromServer( accessToken = token.accessToken, ) @@ -43,11 +56,13 @@ class LoginViewModel : ViewModel() { fun startKakaoLogIn(context: Context) { if (UserApiClient.instance.isKakaoTalkLoginAvailable(context) && isAppLoginAvailable.value) { + Log.e("TAG", "startKakaoLogIn: app") UserApiClient.instance.loginWithKakaoTalk( context = context, callback = appLoginCallback, ) } else { + Log.e("TAG", "startKakaoLogIn: web") UserApiClient.instance.loginWithKakaoAccount( context = context, callback = webLoginCallback, @@ -64,19 +79,23 @@ class LoginViewModel : ViewModel() { viewModelScope.launch { // 통신 로직 - - // 성공시 서버에서 준 정보를 넣는 예시 코드 - _postChangeTokenState.value = UiState.Success( - AuthTokenModel( - isResigned = true, - accessToken = "testAccessToekn", - refreshToken = "testRefreshToekn", - ), - ) + loginRepository.postSignin(accessToken, social).onSuccess { + // 성공시 서버에서 준 정보를 넣는 예시 코드 + Timber.e("성공고오고오고공") + _postChangeTokenState.value = UiState.Success( + AuthTokenModel( + accessToken = "testAccessToekn", + refreshToken = "testRefreshToekn", + ), + ) + }.onFailure { err -> + Log.e("TAG", "changeTokenFromServer: ${err.message}", ) + Timber.e("실패패패패패패") + } } } companion object { - const val KAKAO = "KAKAO" + const val KAKAO = "kakao" } } From 13725b453eb3d1cfb9d29af8fde8a4cdf400812f Mon Sep 17 00:00:00 2001 From: Dongmin Date: Mon, 8 Jan 2024 02:04:09 +0900 Subject: [PATCH 12/21] =?UTF-8?q?[FEAT/#28]=20box=20=EB=82=B4=EB=B6=80=20?= =?UTF-8?q?=EA=B0=84=EA=B2=A9=20=EC=A1=B0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 2 +- .../result/TendencyTestResultActivity.kt | 2 +- .../layout/activity_tendency_test_result.xml | 288 +++++++++--------- presentation/src/main/res/values/themes.xml | 2 +- 4 files changed, 155 insertions(+), 139 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 7e318e49..174bb177 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -43,7 +43,7 @@ + @@ -18,11 +19,12 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:paddingStart="24dp" + android:paddingTop="32dp" + android:paddingBottom="16dp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" - app:menu="@menu/menu_tb_tendency_test_result" - app:title="@string/tendency_test_result_toolbar" /> + app:title="@string/tendency_test_title" /> @@ -170,58 +171,67 @@ - - + app:layout_constraintHorizontal_weight="7" + app:layout_constraintStart_toEndOf="@id/tv_first_description_title" + app:layout_constraintTop_toTopOf="parent"> + + + + + + + - - - - - - - - - + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_weight="7" + app:layout_constraintStart_toEndOf="@id/tv_second_description_title" + app:layout_constraintTop_toTopOf="parent"> + + + + + + + @@ -311,65 +324,68 @@ - - - - - - - + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_weight="7" + app:layout_constraintStart_toEndOf="@id/tv_third_description_title" + app:layout_constraintTop_toTopOf="parent"> + + + + + + + + android:layout_height="25dp" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/cl_box_description_third" /> diff --git a/presentation/src/main/res/values/themes.xml b/presentation/src/main/res/values/themes.xml index fd90a6d8..ff6063f4 100644 --- a/presentation/src/main/res/values/themes.xml +++ b/presentation/src/main/res/values/themes.xml @@ -35,7 +35,7 @@ From bcb8264111be44488acaed34dbe39ecdc0456723 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Mon, 8 Jan 2024 02:45:08 +0900 Subject: [PATCH 13/21] =?UTF-8?q?[UI/#28]=20UI=20=EB=B3=80=EA=B2=BD?= =?UTF-8?q?=EC=82=AC=ED=95=AD=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/TendencyTestResultActivity.kt | 52 ++++++++---- .../result/TendencyTestResultViewModel.kt | 8 +- .../layout/activity_tendency_test_result.xml | 85 +++++++++++-------- .../res/menu/menu_tb_tendency_test_result.xml | 12 --- presentation/src/main/res/values/strings.xml | 4 +- 5 files changed, 91 insertions(+), 70 deletions(-) delete mode 100644 presentation/src/main/res/menu/menu_tb_tendency_test_result.xml diff --git a/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultActivity.kt b/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultActivity.kt index 648e979f..d0cfc05b 100644 --- a/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultActivity.kt +++ b/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultActivity.kt @@ -18,25 +18,43 @@ class TendencyTestResultActivity : bindTendencyInfo() + initSaveImgBtnClickListener() initFinishBtnClickListener() - initRestartBtnClickListener() } private fun bindTendencyInfo() { + binding.tvTendencyTestResultTitle.text = getString(R.string.tendency_test_result_title, "찐두릅") + binding.tvTendencyTestResultType.text = viewModel.mockTendencyResult.tendencyTitle + binding.tvTendencyTestResultSubType.text = viewModel.mockTendencyResult.tendencySubTitle + + binding.tvTendencyTestResultTag1.text = viewModel.mockTendencyResult.tags[0] + binding.tvTendencyTestResultTag2.text = viewModel.mockTendencyResult.tags[1] + binding.tvTendencyTestResultTag3.text = viewModel.mockTendencyResult.tags[2] + binding.tvFirstDescriptionTitle.text = viewModel.mockTendencyResult.tendencyBoxInfo[0].title - binding.tvFirstDescriptionFirstText.text = setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[0].first) - binding.tvFirstDescriptionSecondText.text = setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[0].second) - binding.tvFirstDescriptionThirdText.text = setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[0].third) + binding.tvFirstDescriptionFirstText.text = + setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[0].first) + binding.tvFirstDescriptionSecondText.text = + setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[0].second) + binding.tvFirstDescriptionThirdText.text = + setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[0].third) - binding.tvSecondDescriptionTitle.text = viewModel.mockTendencyResult.tendencyBoxInfo[1].title - binding.tvSecondDescriptionFirstText.text = setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[1].first) - binding.tvSecondDescriptionSecondText.text = setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[1].second) - binding.tvSecondDescriptionThirdText.text = setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[1].third) + binding.tvSecondDescriptionTitle.text = + viewModel.mockTendencyResult.tendencyBoxInfo[1].title + binding.tvSecondDescriptionFirstText.text = + setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[1].first) + binding.tvSecondDescriptionSecondText.text = + setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[1].second) + binding.tvSecondDescriptionThirdText.text = + setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[1].third) binding.tvThirdDescriptionTitle.text = viewModel.mockTendencyResult.tendencyBoxInfo[2].title - binding.tvThirdDescriptionFirstText.text = setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[2].first) - binding.tvThirdDescriptionSecondText.text = setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[2].second) - binding.tvThirdDescriptionThirdText.text = setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[2].third) + binding.tvThirdDescriptionFirstText.text = + setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[2].first) + binding.tvThirdDescriptionSecondText.text = + setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[2].second) + binding.tvThirdDescriptionThirdText.text = + setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[2].third) } private fun setBulletPoint(text: String): SpannableString { @@ -46,15 +64,15 @@ class TendencyTestResultActivity : return string } - private fun initFinishBtnClickListener() { - binding.btnTendencyTestResultFinish.setOnSingleClickListener { - // 페이지 이동 + private fun initSaveImgBtnClickListener() { + binding.btnTendencyTestResultSave.setOnSingleClickListener { + // 이미지 저장 } } - private fun initRestartBtnClickListener() { - binding.btnTendencyTestResultRestart.setOnSingleClickListener { - // 다시 시작 + private fun initFinishBtnClickListener() { + binding.btnTendencyTestResultFinish.setOnSingleClickListener { + // 페이지 이동 } } } diff --git a/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultViewModel.kt b/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultViewModel.kt index afd1f23d..e3a0dd4a 100644 --- a/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultViewModel.kt +++ b/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultViewModel.kt @@ -6,11 +6,11 @@ import com.going.domain.entity.TendencyResultMock class TendencyTestResultViewModel : ViewModel() { val mockTendencyResult: TendencyResultMock = TendencyResultMock( tendencyTitle = "배려심 많은 인간 플래너", - tendencySubTitle = "꼼꼼하고 세심ㄴ하게 여행을 준비하는 친구", + tendencySubTitle = "꼼꼼하고 세심하게 여행을 준비하는 친구", tags = listOf( - "친구중심", - "꼼꼼함", - "세심함", + "#친구중심", + "#꼼꼼함", + "#세심함", ), tendencyBoxInfo = listOf( TendencyResultMock.BoxInfo( diff --git a/presentation/src/main/res/layout/activity_tendency_test_result.xml b/presentation/src/main/res/layout/activity_tendency_test_result.xml index 1f1ec856..e14b796a 100644 --- a/presentation/src/main/res/layout/activity_tendency_test_result.xml +++ b/presentation/src/main/res/layout/activity_tendency_test_result.xml @@ -59,18 +59,6 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/img_tendency_test_result"> - - + + + @@ -328,9 +327,9 @@ android:layout_height="wrap_content" android:gravity="center" app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toStartOf="@id/linear_layout_third_description" app:layout_constraintHorizontal_weight="3" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toStartOf="@id/linear_layout_third_description" app:layout_constraintTop_toTopOf="parent" /> + + + + app:layout_constraintTop_toBottomOf="@id/tv_tendency_test_restart" /> + - - - - + app:layout_constraintStart_toEndOf="@id/btn_tendency_test_result_save" /> diff --git a/presentation/src/main/res/menu/menu_tb_tendency_test_result.xml b/presentation/src/main/res/menu/menu_tb_tendency_test_result.xml deleted file mode 100644 index 27525f4d..00000000 --- a/presentation/src/main/res/menu/menu_tb_tendency_test_result.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - diff --git a/presentation/src/main/res/values/strings.xml b/presentation/src/main/res/values/strings.xml index 6577aec6..32e0af79 100644 --- a/presentation/src/main/res/values/strings.xml +++ b/presentation/src/main/res/values/strings.xml @@ -34,9 +34,9 @@ 유형 검사 결과 %1$s님의 여행 유형은 - 완성된 프로필 보기 + 다음 다시 해볼래요 - 저장하기 + 이미지로 저장 우리 여행 진행률 From 79e4ad729743e1040c4c9ca0b3849cc197245b52 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Mon, 8 Jan 2024 03:02:06 +0900 Subject: [PATCH 14/21] =?UTF-8?q?[UI/#28]=20UI=20blur=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/res/drawable/img_blur.xml | 21 +++++++++++++++++++ ...g_bg.xml => shape_rect_10_red300_line.xml} | 0 .../layout/activity_tendency_test_result.xml | 18 ++++++++++++---- 3 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 presentation/src/main/res/drawable/img_blur.xml rename presentation/src/main/res/drawable/{shape_tag_bg.xml => shape_rect_10_red300_line.xml} (100%) diff --git a/presentation/src/main/res/drawable/img_blur.xml b/presentation/src/main/res/drawable/img_blur.xml new file mode 100644 index 00000000..d3adab03 --- /dev/null +++ b/presentation/src/main/res/drawable/img_blur.xml @@ -0,0 +1,21 @@ + + + + + + + + + + diff --git a/presentation/src/main/res/drawable/shape_tag_bg.xml b/presentation/src/main/res/drawable/shape_rect_10_red300_line.xml similarity index 100% rename from presentation/src/main/res/drawable/shape_tag_bg.xml rename to presentation/src/main/res/drawable/shape_rect_10_red300_line.xml diff --git a/presentation/src/main/res/layout/activity_tendency_test_result.xml b/presentation/src/main/res/layout/activity_tendency_test_result.xml index e14b796a..2baca322 100644 --- a/presentation/src/main/res/layout/activity_tendency_test_result.xml +++ b/presentation/src/main/res/layout/activity_tendency_test_result.xml @@ -17,6 +17,7 @@ android:id="@+id/tb_tendency_test_result" style="@style/toolbar_style" android:layout_width="0dp" + android:elevation="1dp" android:layout_height="wrap_content" android:paddingStart="24dp" android:paddingTop="32dp" @@ -108,7 +109,7 @@ style="@style/TextAppearance.Doorip.Detail1.Regular" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="@drawable/shape_tag_bg" + android:background="@drawable/shape_rect_10_red300_line" android:paddingHorizontal="8dp" android:paddingVertical="1dp" android:text="#tag1" @@ -126,7 +127,7 @@ style="@style/TextAppearance.Doorip.Detail1.Regular" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="@drawable/shape_tag_bg" + android:background="@drawable/shape_rect_10_red300_line" android:paddingHorizontal="8dp" android:paddingVertical="1dp" android:text="#tag2" @@ -144,7 +145,7 @@ style="@style/TextAppearance.Doorip.Detail1.Regular" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="@drawable/shape_tag_bg" + android:background="@drawable/shape_rect_10_red300_line" android:paddingHorizontal="8dp" android:paddingVertical="1dp" android:text="#tag3" @@ -385,6 +386,7 @@ style="@style/TextAppearance.Doorip.Detail2.Regular" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginTop="12dp" android:text="@string/tendency_test_result_restart_button" android:textColor="@color/gray_300" app:layout_constraintEnd_toEndOf="@id/cl_box_description_third" @@ -393,7 +395,7 @@ @@ -435,5 +437,13 @@ app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@id/btn_tendency_test_result_save" /> + + From bff376447c3026aae08a876dfa50d774b6f35048 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Mon, 8 Jan 2024 03:50:36 +0900 Subject: [PATCH 15/21] =?UTF-8?q?[UI/#28]=20=EB=B2=84=ED=8A=BC=20=EA=B7=B8?= =?UTF-8?q?=EB=A6=BC=EC=9E=90=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../drawable/shape_line_gray100_fill_dash_4.xml | 8 ++++++++ ...shape_line_gray100_fill_dash_4_vertical.xml} | 2 +- .../res/drawable/shape_rect_4_gray500_fill.xml | 6 ++++++ .../activity_onboarding_profile_setting.xml | 3 ++- .../main/res/layout/activity_tendency_test.xml | 1 + .../layout/activity_tendency_test_result.xml | 17 +++++++++++++++-- .../layout/activity_tendency_test_splash.xml | 1 + 7 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 presentation/src/main/res/drawable/shape_line_gray100_fill_dash_4.xml rename presentation/src/main/res/drawable/{shape_line_gray100_fill_dash_16_vertical.xml => shape_line_gray100_fill_dash_4_vertical.xml} (71%) create mode 100644 presentation/src/main/res/drawable/shape_rect_4_gray500_fill.xml diff --git a/presentation/src/main/res/drawable/shape_line_gray100_fill_dash_4.xml b/presentation/src/main/res/drawable/shape_line_gray100_fill_dash_4.xml new file mode 100644 index 00000000..770457e6 --- /dev/null +++ b/presentation/src/main/res/drawable/shape_line_gray100_fill_dash_4.xml @@ -0,0 +1,8 @@ + + + + diff --git a/presentation/src/main/res/drawable/shape_line_gray100_fill_dash_16_vertical.xml b/presentation/src/main/res/drawable/shape_line_gray100_fill_dash_4_vertical.xml similarity index 71% rename from presentation/src/main/res/drawable/shape_line_gray100_fill_dash_16_vertical.xml rename to presentation/src/main/res/drawable/shape_line_gray100_fill_dash_4_vertical.xml index e68683ed..147e1c3f 100644 --- a/presentation/src/main/res/drawable/shape_line_gray100_fill_dash_16_vertical.xml +++ b/presentation/src/main/res/drawable/shape_line_gray100_fill_dash_4_vertical.xml @@ -2,4 +2,4 @@ + android:drawable="@drawable/shape_line_gray100_fill_dash_4"/> diff --git a/presentation/src/main/res/drawable/shape_rect_4_gray500_fill.xml b/presentation/src/main/res/drawable/shape_rect_4_gray500_fill.xml new file mode 100644 index 00000000..f25b3620 --- /dev/null +++ b/presentation/src/main/res/drawable/shape_rect_4_gray500_fill.xml @@ -0,0 +1,6 @@ + + + + + diff --git a/presentation/src/main/res/layout/activity_onboarding_profile_setting.xml b/presentation/src/main/res/layout/activity_onboarding_profile_setting.xml index 51ddc3e5..e53b12d6 100644 --- a/presentation/src/main/res/layout/activity_onboarding_profile_setting.xml +++ b/presentation/src/main/res/layout/activity_onboarding_profile_setting.xml @@ -123,7 +123,7 @@ app:layout_constraintEnd_toEndOf="@id/et_onboarding_profile_setting_info" app:layout_constraintTop_toBottomOf="@id/et_onboarding_profile_setting_info" /> - - + + diff --git a/presentation/src/main/res/layout/activity_tendency_test_splash.xml b/presentation/src/main/res/layout/activity_tendency_test_splash.xml index 40d7cdb7..cde5119f 100644 --- a/presentation/src/main/res/layout/activity_tendency_test_splash.xml +++ b/presentation/src/main/res/layout/activity_tendency_test_splash.xml @@ -44,6 +44,7 @@ android:background="@drawable/sel_rounded_corner_button" android:paddingVertical="10dp" android:text="@string/tendency_splash_start_btn" + android:outlineProvider="none" android:textColor="@color/white_000" android:textSize="16sp" app:layout_constraintBottom_toBottomOf="parent" From b0d4c89a57dd52b70e8a7ffd482371f81fa53cbe Mon Sep 17 00:00:00 2001 From: Dongmin Date: Mon, 8 Jan 2024 04:42:12 +0900 Subject: [PATCH 16/21] =?UTF-8?q?[UI/#28]=20=EC=A0=90=EC=84=A0=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layout/activity_tendency_test_result.xml | 63 +++++++++++++------ 1 file changed, 45 insertions(+), 18 deletions(-) diff --git a/presentation/src/main/res/layout/activity_tendency_test_result.xml b/presentation/src/main/res/layout/activity_tendency_test_result.xml index ad99c1dd..8943346d 100644 --- a/presentation/src/main/res/layout/activity_tendency_test_result.xml +++ b/presentation/src/main/res/layout/activity_tendency_test_result.xml @@ -17,8 +17,8 @@ android:id="@+id/tb_tendency_test_result" style="@style/toolbar_style" android:layout_width="0dp" - android:elevation="1dp" android:layout_height="wrap_content" + android:elevation="1dp" android:paddingStart="24dp" android:paddingTop="32dp" android:paddingBottom="16dp" @@ -176,14 +176,27 @@ android:gravity="center" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@id/linear_layout_first_description" - app:layout_constraintHorizontal_weight="3" + app:layout_constraintHorizontal_weight="2" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> + + - + app:layout_constraintEnd_toStartOf="@id/linear_layout_second_description" + app:layout_constraintHorizontal_weight="1" + app:layout_constraintStart_toEndOf="@id/tv_second_description_title" + app:layout_constraintTop_toTopOf="parent" /> + + + + app:layout_constraintStart_toStartOf="parent" /> From 33dcd2e35fa358798b13b5c80f54e495b929ce46 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Mon, 8 Jan 2024 04:46:12 +0900 Subject: [PATCH 17/21] =?UTF-8?q?[CHORE/#28]=20export=20false=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 174bb177..45855db5 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -74,7 +74,7 @@ From 1a9e46bc05666e55af2a3a819b22ff921f5b55a7 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Mon, 8 Jan 2024 13:30:30 +0900 Subject: [PATCH 18/21] =?UTF-8?q?[CHORE/#28]=20BaseResponse=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84=20=EB=B0=8F=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 2 +- .../going/data/datasource/LoginDataSource.kt | 5 ++- .../datasourceImpl/LoginDataSourceImpl.kt | 5 ++- .../java/com/going/data/dto/BaseResponse.kt | 14 +++++++ .../data/dto/response/LoginResponseDto.kt | 37 +++++++++++++++++++ .../data/dto/response/ResponseLoginDto.kt | 26 ------------- .../repositoryImpl/LoginRepositoryImpl.kt | 10 ++++- .../com/going/data/service/LoginService.kt | 5 ++- 8 files changed, 69 insertions(+), 35 deletions(-) create mode 100644 data/src/main/java/com/going/data/dto/BaseResponse.kt create mode 100644 data/src/main/java/com/going/data/dto/response/LoginResponseDto.kt delete mode 100644 data/src/main/java/com/going/data/dto/response/ResponseLoginDto.kt diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 42d81b3f..fadadfb3 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -73,7 +73,7 @@ diff --git a/data/src/main/java/com/going/data/datasource/LoginDataSource.kt b/data/src/main/java/com/going/data/datasource/LoginDataSource.kt index 197cb5d8..254e1b4c 100644 --- a/data/src/main/java/com/going/data/datasource/LoginDataSource.kt +++ b/data/src/main/java/com/going/data/datasource/LoginDataSource.kt @@ -1,11 +1,12 @@ package com.going.data.datasource +import com.going.data.dto.BaseResponse import com.going.data.dto.request.RequestLoginDto -import com.going.data.dto.response.ResponseLoginDto +import com.going.data.dto.response.LoginResponseDto interface LoginDataSource { suspend fun postLogin( Authorization: String, platform: RequestLoginDto, - ): ResponseLoginDto + ): BaseResponse } diff --git a/data/src/main/java/com/going/data/datasourceImpl/LoginDataSourceImpl.kt b/data/src/main/java/com/going/data/datasourceImpl/LoginDataSourceImpl.kt index 44e33237..b2f5c59b 100644 --- a/data/src/main/java/com/going/data/datasourceImpl/LoginDataSourceImpl.kt +++ b/data/src/main/java/com/going/data/datasourceImpl/LoginDataSourceImpl.kt @@ -1,8 +1,9 @@ package com.going.data.datasourceImpl import com.going.data.datasource.LoginDataSource +import com.going.data.dto.BaseResponse import com.going.data.dto.request.RequestLoginDto -import com.going.data.dto.response.ResponseLoginDto +import com.going.data.dto.response.LoginResponseDto import com.going.data.service.LoginService import javax.inject.Inject @@ -12,6 +13,6 @@ class LoginDataSourceImpl @Inject constructor( override suspend fun postLogin( Authorization: String, platform: RequestLoginDto, - ): ResponseLoginDto = + ): BaseResponse = loginService.postSignin(Authorization, platform) } diff --git a/data/src/main/java/com/going/data/dto/BaseResponse.kt b/data/src/main/java/com/going/data/dto/BaseResponse.kt new file mode 100644 index 00000000..bf7834d1 --- /dev/null +++ b/data/src/main/java/com/going/data/dto/BaseResponse.kt @@ -0,0 +1,14 @@ +package com.going.data.dto + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +@Serializable +data class BaseResponse( + @SerialName("status") + val status: Int, + @SerialName("message") + val message: String, + @SerialName("data") + val data: T, +) diff --git a/data/src/main/java/com/going/data/dto/response/LoginResponseDto.kt b/data/src/main/java/com/going/data/dto/response/LoginResponseDto.kt new file mode 100644 index 00000000..c52b73e6 --- /dev/null +++ b/data/src/main/java/com/going/data/dto/response/LoginResponseDto.kt @@ -0,0 +1,37 @@ +package com.going.data.dto.response + +import com.going.domain.entity.response.AuthTokenModel +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +@Serializable +data class LoginResponseDto( + @SerialName("accessToken") + val accessToken: String, + @SerialName("refreshToken") + val refreshToken: String, +) { + fun toAuthTokenModel() = + AuthTokenModel(accessToken = accessToken, refreshToken = refreshToken) +} + +// @Serializable +// data class LoginResponseDto( +// @SerialName("status") +// val status: Int, +// @SerialName("message") +// val message: String, +// @SerialName("data") +// val data: Data, +// ) { +// @Serializable +// data class Data( +// @SerialName("accessToken") +// val accessToken: String, +// @SerialName("refreshToken") +// val refreshToken: String, +// ) +// +// fun toAuthTokenModel() = +// AuthTokenModel(accessToken = data.accessToken, refreshToken = data.refreshToken) +// } diff --git a/data/src/main/java/com/going/data/dto/response/ResponseLoginDto.kt b/data/src/main/java/com/going/data/dto/response/ResponseLoginDto.kt deleted file mode 100644 index 556544c0..00000000 --- a/data/src/main/java/com/going/data/dto/response/ResponseLoginDto.kt +++ /dev/null @@ -1,26 +0,0 @@ -package com.going.data.dto.response - -import com.going.domain.entity.response.AuthTokenModel -import kotlinx.serialization.SerialName -import kotlinx.serialization.Serializable - -@Serializable -class ResponseLoginDto( - @SerialName("status") - val status: Int, - @SerialName("message") - val message: String, - @SerialName("data") - val data: Data, -) { - @Serializable - data class Data( - @SerialName("accessToken") - val accessToken: String, - @SerialName("refreshToken") - val refreshToken: String, - ) - - fun toAuthTokenModel() = - AuthTokenModel(accessToken = data.accessToken, refreshToken = data.refreshToken) -} diff --git a/data/src/main/java/com/going/data/repositoryImpl/LoginRepositoryImpl.kt b/data/src/main/java/com/going/data/repositoryImpl/LoginRepositoryImpl.kt index e04d28eb..04d5e991 100644 --- a/data/src/main/java/com/going/data/repositoryImpl/LoginRepositoryImpl.kt +++ b/data/src/main/java/com/going/data/repositoryImpl/LoginRepositoryImpl.kt @@ -9,8 +9,14 @@ import javax.inject.Inject class LoginRepositoryImpl @Inject constructor( private val loginDataSource: LoginDataSource, ) : LoginRepository { - override suspend fun postSignin(Authorization: String, platform: String): Result = + override suspend fun postSignin( + Authorization: String, + platform: String, + ): Result = runCatching { - loginDataSource.postLogin(Authorization, RequestLoginDto(platform)).toAuthTokenModel() + loginDataSource.postLogin( + Authorization, + RequestLoginDto(platform), + ).data.toAuthTokenModel() } } diff --git a/data/src/main/java/com/going/data/service/LoginService.kt b/data/src/main/java/com/going/data/service/LoginService.kt index a01277f7..1859e29b 100644 --- a/data/src/main/java/com/going/data/service/LoginService.kt +++ b/data/src/main/java/com/going/data/service/LoginService.kt @@ -1,7 +1,8 @@ package com.going.data.service +import com.going.data.dto.BaseResponse import com.going.data.dto.request.RequestLoginDto -import com.going.data.dto.response.ResponseLoginDto +import com.going.data.dto.response.LoginResponseDto import retrofit2.http.Body import retrofit2.http.Header import retrofit2.http.POST @@ -11,5 +12,5 @@ interface LoginService { suspend fun postSignin( @Header("Authorization") Authorization: String, @Body body: RequestLoginDto, - ): ResponseLoginDto + ): BaseResponse } From 78228063054bc306d432dfd42c257882446db269 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Mon, 8 Jan 2024 13:30:42 +0900 Subject: [PATCH 19/21] =?UTF-8?q?[CHORE/#28]=20log=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/going/presentation/auth/LoginViewModel.kt | 9 --------- 1 file changed, 9 deletions(-) diff --git a/presentation/src/main/java/com/going/presentation/auth/LoginViewModel.kt b/presentation/src/main/java/com/going/presentation/auth/LoginViewModel.kt index 86809c7b..4ab0f59e 100644 --- a/presentation/src/main/java/com/going/presentation/auth/LoginViewModel.kt +++ b/presentation/src/main/java/com/going/presentation/auth/LoginViewModel.kt @@ -1,7 +1,6 @@ package com.going.presentation.auth import android.content.Context -import android.util.Log import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.going.domain.entity.response.AuthTokenModel @@ -29,7 +28,6 @@ class LoginViewModel @Inject constructor( val isAppLoginAvailable: StateFlow = _isAppLoginAvailable private var webLoginCallback: (OAuthToken?, Throwable?) -> Unit = { token, error -> - Log.e("TAG", "error : $error / token : $token") if (error == null && token != null) { changeTokenFromServer( accessToken = token.accessToken, @@ -40,14 +38,10 @@ class LoginViewModel @Inject constructor( private var appLoginCallback: (OAuthToken?, Throwable?) -> Unit = { token, error -> if (error != null) { // 뒤로가기 경우 예외 처리 - Log.e("TAG", "error : $error / token : $token") if (!(error is ClientError && error.reason == ClientErrorCause.Cancelled)) { - Log.e("TAG", "이 무슨 error : $error / token : $token") _isAppLoginAvailable.value = false } } else if (token != null) { - Log.e("TAG", "전부 error : $error / token : $token") - Log.e("TAG", "${token.accessToken}") changeTokenFromServer( accessToken = token.accessToken, ) @@ -56,13 +50,11 @@ class LoginViewModel @Inject constructor( fun startKakaoLogIn(context: Context) { if (UserApiClient.instance.isKakaoTalkLoginAvailable(context) && isAppLoginAvailable.value) { - Log.e("TAG", "startKakaoLogIn: app") UserApiClient.instance.loginWithKakaoTalk( context = context, callback = appLoginCallback, ) } else { - Log.e("TAG", "startKakaoLogIn: web") UserApiClient.instance.loginWithKakaoAccount( context = context, callback = webLoginCallback, @@ -89,7 +81,6 @@ class LoginViewModel @Inject constructor( ), ) }.onFailure { err -> - Log.e("TAG", "changeTokenFromServer: ${err.message}", ) Timber.e("실패패패패패패") } } From c7e39164a2a097abe6836c718b35b035f62fc139 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Mon, 8 Jan 2024 14:44:40 +0900 Subject: [PATCH 20/21] =?UTF-8?q?[CHORE/#28]=20scope=20=ED=95=A8=EC=88=98?= =?UTF-8?q?=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/TendencyTestResultActivity.kt | 61 ++++++++++--------- 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultActivity.kt b/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultActivity.kt index d0cfc05b..d4c9c88e 100644 --- a/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultActivity.kt +++ b/presentation/src/main/java/com/going/presentation/tendencytest/result/TendencyTestResultActivity.kt @@ -23,38 +23,43 @@ class TendencyTestResultActivity : } private fun bindTendencyInfo() { - binding.tvTendencyTestResultTitle.text = getString(R.string.tendency_test_result_title, "찐두릅") - binding.tvTendencyTestResultType.text = viewModel.mockTendencyResult.tendencyTitle - binding.tvTendencyTestResultSubType.text = viewModel.mockTendencyResult.tendencySubTitle + with(binding) { + tvTendencyTestResultTitle.text = getString(R.string.tendency_test_result_title, "찐두릅") - binding.tvTendencyTestResultTag1.text = viewModel.mockTendencyResult.tags[0] - binding.tvTendencyTestResultTag2.text = viewModel.mockTendencyResult.tags[1] - binding.tvTendencyTestResultTag3.text = viewModel.mockTendencyResult.tags[2] + viewModel.mockTendencyResult.apply { + tvTendencyTestResultType.text = tendencyTitle + tvTendencyTestResultSubType.text = tendencySubTitle - binding.tvFirstDescriptionTitle.text = viewModel.mockTendencyResult.tendencyBoxInfo[0].title - binding.tvFirstDescriptionFirstText.text = - setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[0].first) - binding.tvFirstDescriptionSecondText.text = - setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[0].second) - binding.tvFirstDescriptionThirdText.text = - setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[0].third) + tvTendencyTestResultTag1.text = tags[0] + tvTendencyTestResultTag2.text = tags[1] + tvTendencyTestResultTag3.text = tags[2] - binding.tvSecondDescriptionTitle.text = - viewModel.mockTendencyResult.tendencyBoxInfo[1].title - binding.tvSecondDescriptionFirstText.text = - setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[1].first) - binding.tvSecondDescriptionSecondText.text = - setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[1].second) - binding.tvSecondDescriptionThirdText.text = - setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[1].third) + tvFirstDescriptionTitle.text = tendencyBoxInfo[0].title + tvFirstDescriptionFirstText.text = + setBulletPoint(tendencyBoxInfo[0].first) + tvFirstDescriptionSecondText.text = + setBulletPoint(tendencyBoxInfo[0].second) + tvFirstDescriptionThirdText.text = + setBulletPoint(tendencyBoxInfo[0].third) - binding.tvThirdDescriptionTitle.text = viewModel.mockTendencyResult.tendencyBoxInfo[2].title - binding.tvThirdDescriptionFirstText.text = - setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[2].first) - binding.tvThirdDescriptionSecondText.text = - setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[2].second) - binding.tvThirdDescriptionThirdText.text = - setBulletPoint(viewModel.mockTendencyResult.tendencyBoxInfo[2].third) + tvSecondDescriptionTitle.text = + tendencyBoxInfo[1].title + tvSecondDescriptionFirstText.text = + setBulletPoint(tendencyBoxInfo[1].first) + tvSecondDescriptionSecondText.text = + setBulletPoint(tendencyBoxInfo[1].second) + tvSecondDescriptionThirdText.text = + setBulletPoint(tendencyBoxInfo[1].third) + + tvThirdDescriptionTitle.text = tendencyBoxInfo[2].title + tvThirdDescriptionFirstText.text = + setBulletPoint(tendencyBoxInfo[2].first) + tvThirdDescriptionSecondText.text = + setBulletPoint(tendencyBoxInfo[2].second) + tvThirdDescriptionThirdText.text = + setBulletPoint(tendencyBoxInfo[2].third) + } + } } private fun setBulletPoint(text: String): SpannableString { From 7805104e00fda1936573b0fd99af62d783804328 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Mon, 8 Jan 2024 14:53:36 +0900 Subject: [PATCH 21/21] =?UTF-8?q?[CHORE/#28]=20=EB=B3=80=EC=88=98=EB=AA=85?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...bg.xml => shape_rect_topleft_8_topright_8_white000_fill.xml} | 0 .../src/main/res/layout/activity_onboarding_profile_setting.xml | 2 +- .../src/main/res/layout/activity_tendency_test_result.xml | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename presentation/src/main/res/drawable/{shape_radius_top_bg.xml => shape_rect_topleft_8_topright_8_white000_fill.xml} (100%) diff --git a/presentation/src/main/res/drawable/shape_radius_top_bg.xml b/presentation/src/main/res/drawable/shape_rect_topleft_8_topright_8_white000_fill.xml similarity index 100% rename from presentation/src/main/res/drawable/shape_radius_top_bg.xml rename to presentation/src/main/res/drawable/shape_rect_topleft_8_topright_8_white000_fill.xml diff --git a/presentation/src/main/res/layout/activity_onboarding_profile_setting.xml b/presentation/src/main/res/layout/activity_onboarding_profile_setting.xml index e53b12d6..6e2ef9f8 100644 --- a/presentation/src/main/res/layout/activity_onboarding_profile_setting.xml +++ b/presentation/src/main/res/layout/activity_onboarding_profile_setting.xml @@ -123,7 +123,7 @@ app:layout_constraintEnd_toEndOf="@id/et_onboarding_profile_setting_info" app:layout_constraintTop_toBottomOf="@id/et_onboarding_profile_setting_info" /> -