From 3bb93c97a20400966192f2603a2263b21f004904 Mon Sep 17 00:00:00 2001
From: pmj1459 <76741702+minju1459@users.noreply.github.com>
Date: Mon, 29 Jan 2024 16:47:17 +0900
Subject: [PATCH 01/18] =?UTF-8?q?[FEAT/#350]=20=ED=83=88=ED=87=B4=20?=
=?UTF-8?q?=EC=82=AC=EC=9C=A0=20Recycleview=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 | 4 +
.../main/profile/ProfileViewModel.kt | 24 ++++
.../profile/manage/ProfileManageActivity.kt | 3 +-
.../main/profile/quit/QuitReasonActivity.kt | 42 +++++++
.../main/profile/quit/QuitReasonAdapter.kt | 47 ++++++++
.../ic_profile_quit_reason_uncheck.xml | 11 ++
...rayscales900_fill_grayscales700_circle.xml | 6 -
.../layout/activity_profile_quit_reason.xml | 103 ++++++++++++++++++
.../res/layout/item_profile_quit_reason.xml | 64 +++++++++++
app/src/main/res/values/strings.xml | 3 +
10 files changed, 300 insertions(+), 7 deletions(-)
create mode 100644 app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt
create mode 100644 app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonAdapter.kt
create mode 100644 app/src/main/res/drawable/ic_profile_quit_reason_uncheck.xml
delete mode 100644 app/src/main/res/drawable/shape_grayscales900_fill_grayscales700_circle.xml
create mode 100644 app/src/main/res/layout/activity_profile_quit_reason.xml
create mode 100644 app/src/main/res/layout/item_profile_quit_reason.xml
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 27a2448f0..cf967a1bb 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -137,6 +137,10 @@
android:name=".presentation.main.profile.manage.ProfileQuitOneActivity"
android:exported="false"
android:screenOrientation="portrait" />
+
> = MutableLiveData()
+ val quitReasonData: LiveData> = _quitReasonData
+
+ private val quitReasonText = MutableLiveData()
+
+ fun setQuitReason(reason: String) {
+ quitReasonText.value = reason
+ }
+ fun addQuitReasonList() {
+ val quitReasonList = listOf(
+ "앱에 아는 사람들이 없어서",
+ "구독권과 열람권의 가격이 비싸서",
+ "오류가 많아서",
+ "재밌는 콘텐츠 또는 질문이 없어서",
+ "포인트를 너무 적게 줘서",
+ "내 정보를 삭제하고 싶어서",
+ "다른 앱이 더 재밌어서",
+ "기타",
+ )
+ _quitReasonData.value = quitReasonList
+ }
+
fun setItemPosition(position: Int) {
clickedItemPosition = position
}
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileManageActivity.kt b/app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileManageActivity.kt
index 38b4faec2..88fcac92c 100644
--- a/app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileManageActivity.kt
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileManageActivity.kt
@@ -10,6 +10,7 @@ import com.el.yello.BuildConfig
import com.el.yello.R
import com.el.yello.databinding.ActivityProfileManageBinding
import com.el.yello.presentation.main.profile.ProfileViewModel
+import com.el.yello.presentation.main.profile.quit.QuitReasonActivity
import com.el.yello.util.amplitude.AmplitudeUtils
import com.el.yello.util.context.yelloSnackbar
import com.example.ui.base.BindingActivity
@@ -82,7 +83,7 @@ class ProfileManageActivity :
"click_profile_withdrawal",
JSONObject().put("withdrawal_button", "withdrawal1"),
)
- Intent(this, ProfileQuitOneActivity::class.java).apply {
+ Intent(this, QuitReasonActivity::class.java).apply {
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
startActivity(this)
}
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt b/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt
new file mode 100644
index 000000000..e38f27d4d
--- /dev/null
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt
@@ -0,0 +1,42 @@
+package com.el.yello.presentation.main.profile.quit
+
+import QuitReasonAdapter
+import android.os.Bundle
+import android.util.Log
+import androidx.activity.viewModels
+import com.el.yello.R
+import com.el.yello.databinding.ActivityProfileQuitReasonBinding
+import com.el.yello.presentation.main.profile.ProfileViewModel
+import com.example.ui.base.BindingActivity
+import dagger.hilt.android.AndroidEntryPoint
+
+@AndroidEntryPoint
+class QuitReasonActivity :
+ BindingActivity(R.layout.activity_profile_quit_reason) {
+ private lateinit var quitReasonList: List
+ private val viewModel by viewModels()
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ binding.vm = viewModel
+ initQuitReasonAdapter()
+ }
+
+ private fun initQuitReasonAdapter() {
+ viewModel.addQuitReasonList()
+ quitReasonList = viewModel.quitReasonData.value ?: emptyList()
+ Log.d("QuitReasonActivity", "quitReasonList size: ${quitReasonList.size}")
+
+ val adapter = QuitReasonAdapter(storeQuitReason = ::storeQuitReason)
+
+ // Adapter 초기화 시 로그 확인
+ Log.d("QuitReasonActivity", "Adapter initialized")
+ binding.rvQuitReason.adapter = adapter
+ Log.d("QuitReasonActivity", "Adapter: $adapter")
+ adapter.submitList(ArrayList(quitReasonList))
+ Log.d("QuitReasonActivity", "Adapter item count: ${adapter.itemCount}")
+ }
+
+ private fun storeQuitReason(reason: String) {
+ viewModel.setQuitReason(reason)
+ }
+}
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonAdapter.kt b/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonAdapter.kt
new file mode 100644
index 000000000..251131c02
--- /dev/null
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonAdapter.kt
@@ -0,0 +1,47 @@
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.recyclerview.widget.ListAdapter
+import androidx.recyclerview.widget.RecyclerView
+import com.el.yello.databinding.ItemProfileQuitReasonBinding
+import com.example.ui.view.ItemDiffCallback
+import com.example.ui.view.setOnSingleClickListener
+
+class QuitReasonAdapter(
+ private val storeQuitReason: (String) -> Unit,
+) : ListAdapter(diffUtil) {
+
+ override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): QuitReasonViewHolder {
+ return QuitReasonViewHolder(
+ ItemProfileQuitReasonBinding.inflate(
+ LayoutInflater.from(parent.context),
+ parent,
+ false,
+ ),
+ storeQuitReason,
+ )
+ }
+
+ override fun onBindViewHolder(holder: QuitReasonViewHolder, position: Int) {
+ holder.setQuitReason(getItem(position))
+ }
+
+ class QuitReasonViewHolder(
+ private val binding: ItemProfileQuitReasonBinding,
+ private val storeQuitReason: (String) -> Unit,
+ ) : RecyclerView.ViewHolder(binding.root) {
+
+ fun setQuitReason(reason: String) {
+ binding.reason = reason
+ binding.root.setOnSingleClickListener {
+ storeQuitReason(reason)
+ }
+ }
+ }
+
+ companion object {
+ private val diffUtil = ItemDiffCallback(
+ onItemsTheSame = { old, new -> old == new },
+ onContentsTheSame = { old, new -> old == new },
+ )
+ }
+}
diff --git a/app/src/main/res/drawable/ic_profile_quit_reason_uncheck.xml b/app/src/main/res/drawable/ic_profile_quit_reason_uncheck.xml
new file mode 100644
index 000000000..0f2c28597
--- /dev/null
+++ b/app/src/main/res/drawable/ic_profile_quit_reason_uncheck.xml
@@ -0,0 +1,11 @@
+
+
+
diff --git a/app/src/main/res/drawable/shape_grayscales900_fill_grayscales700_circle.xml b/app/src/main/res/drawable/shape_grayscales900_fill_grayscales700_circle.xml
deleted file mode 100644
index 132244d0f..000000000
--- a/app/src/main/res/drawable/shape_grayscales900_fill_grayscales700_circle.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_profile_quit_reason.xml b/app/src/main/res/layout/activity_profile_quit_reason.xml
new file mode 100644
index 000000000..74d08dc98
--- /dev/null
+++ b/app/src/main/res/layout/activity_profile_quit_reason.xml
@@ -0,0 +1,103 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_profile_quit_reason.xml b/app/src/main/res/layout/item_profile_quit_reason.xml
new file mode 100644
index 000000000..308f2a6ce
--- /dev/null
+++ b/app/src/main/res/layout/item_profile_quit_reason.xml
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 41f700fe4..f068820b8 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -349,5 +349,8 @@
초성 힌트 무제한 제공
곧 위와 같은 혜택을 누릴 수 없게 돼요. \n\n옐로 플러스의 특별한 서비스를\n계속 이용하시려면, 버튼을 눌러\n구독을 계속해 보세요!
계속 옐로플러스 구독하기
+ 탈퇴 사유를 적어주세요.
+ 완료
+ 사유를 적어주세요.(최대 30자)
From c9ad790191a158a2e6b61421ef52156071933912 Mon Sep 17 00:00:00 2001
From: pmj1459 <76741702+minju1459@users.noreply.github.com>
Date: Mon, 29 Jan 2024 16:48:10 +0900
Subject: [PATCH 02/18] =?UTF-8?q?[MOD/#350]=20onBoardingViewModel=20?=
=?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EC=9C=84=EC=B9=98=20=EC=9D=B4=EB=8F=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../onboarding/{activity => }/OnBoardingViewModel.kt | 2 +-
.../yello/presentation/onboarding/activity/EditNameActivity.kt | 1 +
.../presentation/onboarding/activity/OnBoardingActivity.kt | 1 +
.../onboarding/fragment/addfriend/AddFriendFragment.kt | 2 +-
.../yello/presentation/onboarding/fragment/code/CodeFragment.kt | 2 +-
.../fragment/highschoolinfo/HighSchoolInfoFragment.kt | 2 +-
.../fragment/highschoolinfo/group/GroupDialogFragment.kt | 2 +-
.../highschoolinfo/school/SearchDialogHighSchoolFragment.kt | 2 +-
.../onboarding/fragment/studenttype/SelectStudentFragment.kt | 2 +-
.../fragment/universityinfo/UniversityInfoFragment.kt | 2 +-
.../universityinfo/department/SearchDialogDepartmentFragment.kt | 2 +-
.../universityinfo/studentid/StudentIdDialogFragment.kt | 2 +-
.../universityinfo/university/SearchDialogUniversityFragment.kt | 2 +-
.../presentation/onboarding/fragment/yelloid/YelIoIdFragment.kt | 2 +-
app/src/main/res/layout/activity_name_edit.xml | 2 +-
app/src/main/res/layout/activity_tutorial_end_point.xml | 2 +-
app/src/main/res/layout/fragment_add_friend.xml | 2 +-
app/src/main/res/layout/fragment_code.xml | 2 +-
app/src/main/res/layout/fragment_dialog_check_name.xml | 2 +-
app/src/main/res/layout/fragment_dialog_department.xml | 2 +-
app/src/main/res/layout/fragment_dialog_group.xml | 2 +-
app/src/main/res/layout/fragment_dialog_highschool.xml | 2 +-
app/src/main/res/layout/fragment_dialog_student_id.xml | 2 +-
app/src/main/res/layout/fragment_dialog_university.xml | 2 +-
app/src/main/res/layout/fragment_highschool.xml | 2 +-
app/src/main/res/layout/fragment_select_student_type.xml | 2 +-
app/src/main/res/layout/fragment_university.xml | 2 +-
app/src/main/res/layout/fragment_yello_id.xml | 2 +-
28 files changed, 28 insertions(+), 26 deletions(-)
rename app/src/main/java/com/el/yello/presentation/onboarding/{activity => }/OnBoardingViewModel.kt (99%)
diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/activity/OnBoardingViewModel.kt b/app/src/main/java/com/el/yello/presentation/onboarding/OnBoardingViewModel.kt
similarity index 99%
rename from app/src/main/java/com/el/yello/presentation/onboarding/activity/OnBoardingViewModel.kt
rename to app/src/main/java/com/el/yello/presentation/onboarding/OnBoardingViewModel.kt
index 653f08429..72a4cf9ed 100644
--- a/app/src/main/java/com/el/yello/presentation/onboarding/activity/OnBoardingViewModel.kt
+++ b/app/src/main/java/com/el/yello/presentation/onboarding/OnBoardingViewModel.kt
@@ -1,4 +1,4 @@
-package com.el.yello.presentation.onboarding.activity
+package com.el.yello.presentation.onboarding
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/activity/EditNameActivity.kt b/app/src/main/java/com/el/yello/presentation/onboarding/activity/EditNameActivity.kt
index fcc25656e..f0c2bbb8d 100644
--- a/app/src/main/java/com/el/yello/presentation/onboarding/activity/EditNameActivity.kt
+++ b/app/src/main/java/com/el/yello/presentation/onboarding/activity/EditNameActivity.kt
@@ -11,6 +11,7 @@ import com.el.yello.presentation.auth.SignInActivity.Companion.EXTRA_GENDER
import com.el.yello.presentation.auth.SignInActivity.Companion.EXTRA_KAKAO_ID
import com.el.yello.presentation.auth.SignInActivity.Companion.EXTRA_NAME
import com.el.yello.presentation.auth.SignInActivity.Companion.EXTRA_PROFILE_IMAGE
+import com.el.yello.presentation.onboarding.OnBoardingViewModel
import com.example.ui.base.BindingActivity
import com.example.ui.context.toast
import com.example.ui.view.setOnSingleClickListener
diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/activity/OnBoardingActivity.kt b/app/src/main/java/com/el/yello/presentation/onboarding/activity/OnBoardingActivity.kt
index 44d1631d4..cf152c6e5 100644
--- a/app/src/main/java/com/el/yello/presentation/onboarding/activity/OnBoardingActivity.kt
+++ b/app/src/main/java/com/el/yello/presentation/onboarding/activity/OnBoardingActivity.kt
@@ -14,6 +14,7 @@ import com.el.yello.presentation.auth.SignInActivity.Companion.EXTRA_GENDER
import com.el.yello.presentation.auth.SignInActivity.Companion.EXTRA_KAKAO_ID
import com.el.yello.presentation.auth.SignInActivity.Companion.EXTRA_NAME
import com.el.yello.presentation.auth.SignInActivity.Companion.EXTRA_PROFILE_IMAGE
+import com.el.yello.presentation.onboarding.OnBoardingViewModel
import com.example.ui.base.BindingActivity
import com.example.ui.context.toast
import dagger.hilt.android.AndroidEntryPoint
diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/addfriend/AddFriendFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/addfriend/AddFriendFragment.kt
index 39d3939db..e55be43c1 100644
--- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/addfriend/AddFriendFragment.kt
+++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/addfriend/AddFriendFragment.kt
@@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView
import com.el.yello.R
import com.el.yello.databinding.FragmentAddFriendBinding
import com.el.yello.presentation.onboarding.activity.OnBoardingActivity
-import com.el.yello.presentation.onboarding.activity.OnBoardingViewModel
+import com.el.yello.presentation.onboarding.OnBoardingViewModel
import com.el.yello.util.amplitude.AmplitudeUtils
import com.example.domain.entity.onboarding.AddFriendListModel.FriendModel
import com.example.ui.base.BindingFragment
diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/code/CodeFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/code/CodeFragment.kt
index a027ea06e..6976787f4 100644
--- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/code/CodeFragment.kt
+++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/code/CodeFragment.kt
@@ -9,7 +9,7 @@ import com.el.yello.R
import com.el.yello.databinding.FragmentCodeBinding
import com.el.yello.presentation.onboarding.activity.GetAlarmActivity
import com.el.yello.presentation.onboarding.activity.OnBoardingActivity
-import com.el.yello.presentation.onboarding.activity.OnBoardingViewModel
+import com.el.yello.presentation.onboarding.OnBoardingViewModel
import com.el.yello.util.amplitude.AmplitudeUtils
import com.el.yello.util.context.yelloSnackbar
import com.example.ui.base.BindingFragment
diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/HighSchoolInfoFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/HighSchoolInfoFragment.kt
index 85df6dfb1..2f20e03b5 100644
--- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/HighSchoolInfoFragment.kt
+++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/HighSchoolInfoFragment.kt
@@ -7,7 +7,7 @@ import androidx.navigation.fragment.findNavController
import com.el.yello.R
import com.el.yello.databinding.FragmentHighschoolBinding
import com.el.yello.presentation.onboarding.activity.OnBoardingActivity
-import com.el.yello.presentation.onboarding.activity.OnBoardingViewModel
+import com.el.yello.presentation.onboarding.OnBoardingViewModel
import com.el.yello.presentation.onboarding.fragment.highschoolinfo.group.GroupDialogFragment
import com.el.yello.presentation.onboarding.fragment.highschoolinfo.school.SearchDialogHighSchoolFragment
import com.el.yello.util.amplitude.AmplitudeUtils
diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/group/GroupDialogFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/group/GroupDialogFragment.kt
index bf47b5a45..4005e250b 100644
--- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/group/GroupDialogFragment.kt
+++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/group/GroupDialogFragment.kt
@@ -5,7 +5,7 @@ import android.view.View
import androidx.fragment.app.activityViewModels
import com.el.yello.R
import com.el.yello.databinding.FragmentDialogGroupBinding
-import com.el.yello.presentation.onboarding.activity.OnBoardingViewModel
+import com.el.yello.presentation.onboarding.OnBoardingViewModel
import com.example.ui.base.BindingBottomSheetDialog
class GroupDialogFragment :
diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/school/SearchDialogHighSchoolFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/school/SearchDialogHighSchoolFragment.kt
index 36bffac47..1cd778f95 100644
--- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/school/SearchDialogHighSchoolFragment.kt
+++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/school/SearchDialogHighSchoolFragment.kt
@@ -16,7 +16,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.el.yello.R
import com.el.yello.databinding.FragmentDialogHighschoolBinding
-import com.el.yello.presentation.onboarding.activity.OnBoardingViewModel
+import com.el.yello.presentation.onboarding.OnBoardingViewModel
import com.el.yello.util.context.yelloSnackbar
import com.example.ui.base.BindingBottomSheetDialog
import com.example.ui.context.hideKeyboard
diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/studenttype/SelectStudentFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/studenttype/SelectStudentFragment.kt
index 78ed2e662..6550a304d 100644
--- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/studenttype/SelectStudentFragment.kt
+++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/studenttype/SelectStudentFragment.kt
@@ -7,7 +7,7 @@ import androidx.navigation.fragment.findNavController
import com.el.yello.R
import com.el.yello.databinding.FragmentSelectStudentTypeBinding
import com.el.yello.presentation.onboarding.activity.OnBoardingActivity
-import com.el.yello.presentation.onboarding.activity.OnBoardingViewModel
+import com.el.yello.presentation.onboarding.OnBoardingViewModel
import com.el.yello.util.amplitude.AmplitudeUtils
import com.example.domain.enum.StudentType
import com.example.ui.base.BindingFragment
diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/UniversityInfoFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/UniversityInfoFragment.kt
index f59a67847..9a778ea03 100644
--- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/UniversityInfoFragment.kt
+++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/UniversityInfoFragment.kt
@@ -8,7 +8,7 @@ import androidx.navigation.fragment.findNavController
import com.el.yello.R
import com.el.yello.databinding.FragmentUniversityBinding
import com.el.yello.presentation.onboarding.activity.OnBoardingActivity
-import com.el.yello.presentation.onboarding.activity.OnBoardingViewModel
+import com.el.yello.presentation.onboarding.OnBoardingViewModel
import com.el.yello.presentation.onboarding.fragment.universityinfo.department.SearchDialogDepartmentFragment
import com.el.yello.presentation.onboarding.fragment.universityinfo.studentid.StudentIdDialogFragment
import com.el.yello.presentation.onboarding.fragment.universityinfo.university.SearchDialogUniversityFragment
diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/department/SearchDialogDepartmentFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/department/SearchDialogDepartmentFragment.kt
index 5c070fed3..250098ac4 100644
--- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/department/SearchDialogDepartmentFragment.kt
+++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/department/SearchDialogDepartmentFragment.kt
@@ -16,7 +16,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.el.yello.R
import com.el.yello.databinding.FragmentDialogDepartmentBinding
-import com.el.yello.presentation.onboarding.activity.OnBoardingViewModel
+import com.el.yello.presentation.onboarding.OnBoardingViewModel
import com.el.yello.util.context.yelloSnackbar
import com.example.ui.base.BindingBottomSheetDialog
import com.example.ui.context.hideKeyboard
diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/studentid/StudentIdDialogFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/studentid/StudentIdDialogFragment.kt
index 94185d164..6aa088edd 100644
--- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/studentid/StudentIdDialogFragment.kt
+++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/studentid/StudentIdDialogFragment.kt
@@ -5,7 +5,7 @@ import android.view.View
import androidx.fragment.app.activityViewModels
import com.el.yello.R
import com.el.yello.databinding.FragmentDialogStudentIdBinding
-import com.el.yello.presentation.onboarding.activity.OnBoardingViewModel
+import com.el.yello.presentation.onboarding.OnBoardingViewModel
import com.example.ui.base.BindingBottomSheetDialog
class StudentIdDialogFragment :
diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/university/SearchDialogUniversityFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/university/SearchDialogUniversityFragment.kt
index 5f4d3cdf9..e67b84b32 100644
--- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/university/SearchDialogUniversityFragment.kt
+++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/university/SearchDialogUniversityFragment.kt
@@ -16,7 +16,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.el.yello.R
import com.el.yello.databinding.FragmentDialogUniversityBinding
-import com.el.yello.presentation.onboarding.activity.OnBoardingViewModel
+import com.el.yello.presentation.onboarding.OnBoardingViewModel
import com.el.yello.util.context.yelloSnackbar
import com.example.ui.base.BindingBottomSheetDialog
import com.example.ui.context.hideKeyboard
diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/yelloid/YelIoIdFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/yelloid/YelIoIdFragment.kt
index 2c31f26a5..e780e0ac1 100644
--- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/yelloid/YelIoIdFragment.kt
+++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/yelloid/YelIoIdFragment.kt
@@ -8,7 +8,7 @@ import androidx.navigation.fragment.findNavController
import com.el.yello.R
import com.el.yello.databinding.FragmentYelloIdBinding
import com.el.yello.presentation.onboarding.activity.OnBoardingActivity
-import com.el.yello.presentation.onboarding.activity.OnBoardingViewModel
+import com.el.yello.presentation.onboarding.OnBoardingViewModel
import com.el.yello.util.amplitude.AmplitudeUtils
import com.el.yello.util.context.yelloSnackbar
import com.example.ui.base.BindingFragment
diff --git a/app/src/main/res/layout/activity_name_edit.xml b/app/src/main/res/layout/activity_name_edit.xml
index 7bdeabac8..ccb9e00b5 100644
--- a/app/src/main/res/layout/activity_name_edit.xml
+++ b/app/src/main/res/layout/activity_name_edit.xml
@@ -7,7 +7,7 @@
+ type="com.el.yello.presentation.onboarding.OnBoardingViewModel" />
diff --git a/app/src/main/res/layout/activity_tutorial_end_point.xml b/app/src/main/res/layout/activity_tutorial_end_point.xml
index 47e84dfb9..5156bb705 100644
--- a/app/src/main/res/layout/activity_tutorial_end_point.xml
+++ b/app/src/main/res/layout/activity_tutorial_end_point.xml
@@ -5,7 +5,7 @@
+ type="com.el.yello.presentation.onboarding.OnBoardingViewModel" />
+ type="com.el.yello.presentation.onboarding.OnBoardingViewModel" />
+ type="com.el.yello.presentation.onboarding.OnBoardingViewModel" />
diff --git a/app/src/main/res/layout/fragment_dialog_check_name.xml b/app/src/main/res/layout/fragment_dialog_check_name.xml
index e911d9095..0aa6f6c8f 100644
--- a/app/src/main/res/layout/fragment_dialog_check_name.xml
+++ b/app/src/main/res/layout/fragment_dialog_check_name.xml
@@ -7,7 +7,7 @@
+ type="com.el.yello.presentation.onboarding.OnBoardingViewModel" />
+ type="com.el.yello.presentation.onboarding.OnBoardingViewModel" />
+ type="com.el.yello.presentation.onboarding.OnBoardingViewModel" />
+ type="com.el.yello.presentation.onboarding.OnBoardingViewModel" />
+ type="com.el.yello.presentation.onboarding.OnBoardingViewModel" />
+ type="com.el.yello.presentation.onboarding.OnBoardingViewModel" />
+ type="com.el.yello.presentation.onboarding.OnBoardingViewModel" />
+ type="com.el.yello.presentation.onboarding.OnBoardingViewModel" />
+ type="com.el.yello.presentation.onboarding.OnBoardingViewModel" />
+ type="com.el.yello.presentation.onboarding.OnBoardingViewModel" />
From 19f2d88d3ec20a45db90b4bb5dc1d96c3ea78914 Mon Sep 17 00:00:00 2001
From: pmj1459 <76741702+minju1459@users.noreply.github.com>
Date: Mon, 29 Jan 2024 17:40:06 +0900
Subject: [PATCH 03/18] =?UTF-8?q?[FIX/#350]=20=ED=83=88=ED=87=B4=EC=82=AC?=
=?UTF-8?q?=EC=9C=A0=20scroll=20=EC=98=81=EC=97=AD=20=EC=88=98=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../layout/activity_profile_quit_reason.xml | 54 +++++++++----------
.../res/layout/item_profile_quit_reason.xml | 1 +
2 files changed, 26 insertions(+), 29 deletions(-)
diff --git a/app/src/main/res/layout/activity_profile_quit_reason.xml b/app/src/main/res/layout/activity_profile_quit_reason.xml
index 74d08dc98..a0b2ebd07 100644
--- a/app/src/main/res/layout/activity_profile_quit_reason.xml
+++ b/app/src/main/res/layout/activity_profile_quit_reason.xml
@@ -11,7 +11,7 @@
-
+ android:layout_height="wrap_content">
-
-
-
+
-
-
+
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_profile_quit_reason.xml b/app/src/main/res/layout/item_profile_quit_reason.xml
index 308f2a6ce..545d8b6e0 100644
--- a/app/src/main/res/layout/item_profile_quit_reason.xml
+++ b/app/src/main/res/layout/item_profile_quit_reason.xml
@@ -15,6 +15,7 @@
app:cardBackgroundColor="@color/grayscales_900"
app:cardCornerRadius="8dp"
app:cardElevation="10dp"
+ android:layout_marginBottom="4dp"
app:layout_constraintTop_toTopOf="parent">
Date: Tue, 30 Jan 2024 00:00:54 +0900
Subject: [PATCH 04/18] =?UTF-8?q?[UI/#350]=20Recyclerview=20=EB=8B=A8?=
=?UTF-8?q?=EC=9D=BC=20=EC=84=A0=ED=83=9D=20=EA=B5=AC=ED=98=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../main/profile/quit/QuitReasonActivity.kt | 9 -----
.../main/profile/quit/QuitReasonAdapter.kt | 35 +++++++++++++++++--
.../drawable/ic_profile_quit_reason_check.xml | 14 ++++++++
.../shape_black_fill_white_line_8_rect.xml | 10 ++++++
.../res/layout/item_profile_quit_reason.xml | 8 +++--
5 files changed, 62 insertions(+), 14 deletions(-)
create mode 100644 app/src/main/res/drawable/ic_profile_quit_reason_check.xml
create mode 100644 app/src/main/res/drawable/shape_black_fill_white_line_8_rect.xml
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt b/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt
index e38f27d4d..040692f50 100644
--- a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt
@@ -1,8 +1,6 @@
package com.el.yello.presentation.main.profile.quit
-import QuitReasonAdapter
import android.os.Bundle
-import android.util.Log
import androidx.activity.viewModels
import com.el.yello.R
import com.el.yello.databinding.ActivityProfileQuitReasonBinding
@@ -24,16 +22,9 @@ class QuitReasonActivity :
private fun initQuitReasonAdapter() {
viewModel.addQuitReasonList()
quitReasonList = viewModel.quitReasonData.value ?: emptyList()
- Log.d("QuitReasonActivity", "quitReasonList size: ${quitReasonList.size}")
-
val adapter = QuitReasonAdapter(storeQuitReason = ::storeQuitReason)
-
- // Adapter 초기화 시 로그 확인
- Log.d("QuitReasonActivity", "Adapter initialized")
binding.rvQuitReason.adapter = adapter
- Log.d("QuitReasonActivity", "Adapter: $adapter")
adapter.submitList(ArrayList(quitReasonList))
- Log.d("QuitReasonActivity", "Adapter item count: ${adapter.itemCount}")
}
private fun storeQuitReason(reason: String) {
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonAdapter.kt b/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonAdapter.kt
index 251131c02..b22448975 100644
--- a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonAdapter.kt
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonAdapter.kt
@@ -1,7 +1,11 @@
+package com.el.yello.presentation.main.profile.quit
+
import android.view.LayoutInflater
+import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.ListAdapter
import androidx.recyclerview.widget.RecyclerView
+import com.el.yello.R
import com.el.yello.databinding.ItemProfileQuitReasonBinding
import com.example.ui.view.ItemDiffCallback
import com.example.ui.view.setOnSingleClickListener
@@ -10,6 +14,8 @@ class QuitReasonAdapter(
private val storeQuitReason: (String) -> Unit,
) : ListAdapter(diffUtil) {
+ private var selectedItemPosition: Int = RecyclerView.NO_POSITION
+
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): QuitReasonViewHolder {
return QuitReasonViewHolder(
ItemProfileQuitReasonBinding.inflate(
@@ -18,22 +24,47 @@ class QuitReasonAdapter(
false,
),
storeQuitReason,
+ this::onItemClicked,
)
}
override fun onBindViewHolder(holder: QuitReasonViewHolder, position: Int) {
- holder.setQuitReason(getItem(position))
+ holder.bind(getItem(position), position == selectedItemPosition)
+ }
+
+ private fun onItemClicked(position: Int) {
+ if (selectedItemPosition != RecyclerView.NO_POSITION) {
+ notifyItemChanged(selectedItemPosition)
+ }
+ selectedItemPosition = position
+ notifyItemChanged(position)
+ storeQuitReason(getItem(position))
}
class QuitReasonViewHolder(
private val binding: ItemProfileQuitReasonBinding,
private val storeQuitReason: (String) -> Unit,
+ private val onItemClicked: (Int) -> Unit,
) : RecyclerView.ViewHolder(binding.root) {
- fun setQuitReason(reason: String) {
+ fun bind(reason: String, isSelected: Boolean) {
binding.reason = reason
binding.root.setOnSingleClickListener {
+ onItemClicked(absoluteAdapterPosition)
+ }
+ if (isSelected) {
+ binding.ivQuitReasonCheckpoint.setBackgroundResource(R.drawable.ic_profile_quit_reason_check)
+ binding.cvQuitReasonList.setBackgroundResource(R.drawable.shape_black_fill_white_line_8_rect)
+ if (absoluteAdapterPosition == 7) {
+ binding.etQuitEtc.visibility = View.VISIBLE
+ } else {
+ binding.etQuitEtc.visibility = View.GONE
+ }
storeQuitReason(reason)
+ } else {
+ binding.ivQuitReasonCheckpoint.setBackgroundResource(R.drawable.ic_profile_quit_reason_uncheck)
+ binding.cvQuitReasonList.setBackgroundResource(R.drawable.shape_grayscales900_fill_8_rect)
+ binding.etQuitEtc.visibility = View.GONE
}
}
}
diff --git a/app/src/main/res/drawable/ic_profile_quit_reason_check.xml b/app/src/main/res/drawable/ic_profile_quit_reason_check.xml
new file mode 100644
index 000000000..51a6bcc93
--- /dev/null
+++ b/app/src/main/res/drawable/ic_profile_quit_reason_check.xml
@@ -0,0 +1,14 @@
+
+
+
+
diff --git a/app/src/main/res/drawable/shape_black_fill_white_line_8_rect.xml b/app/src/main/res/drawable/shape_black_fill_white_line_8_rect.xml
new file mode 100644
index 000000000..36cb2fe16
--- /dev/null
+++ b/app/src/main/res/drawable/shape_black_fill_white_line_8_rect.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/item_profile_quit_reason.xml b/app/src/main/res/layout/item_profile_quit_reason.xml
index 545d8b6e0..4edbb208a 100644
--- a/app/src/main/res/layout/item_profile_quit_reason.xml
+++ b/app/src/main/res/layout/item_profile_quit_reason.xml
@@ -10,6 +10,7 @@
+ app:layout_constraintTop_toBottomOf="@id/iv_quit_reason_checkpoint" />
\ No newline at end of file
From baf121925f66d34ffb4f956657e89e5888039c57 Mon Sep 17 00:00:00 2001
From: pmj1459 <76741702+minju1459@users.noreply.github.com>
Date: Tue, 30 Jan 2024 17:53:44 +0900
Subject: [PATCH 05/18] =?UTF-8?q?[UI/#350]=20item=20=ED=81=B4=EB=A6=AD=20?=
=?UTF-8?q?=EC=9D=B4=EB=B2=A4=ED=8A=B8=EB=B3=84=20button=20UI=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
---
app/src/main/AndroidManifest.xml | 1 +
.../main/profile/ProfileViewModel.kt | 10 +++---
.../main/profile/quit/QuitReasonActivity.kt | 32 ++++++++++++++++++-
.../main/profile/quit/QuitReasonAdapter.kt | 2 ++
.../fragment/yelloid/YelIoIdFragment.kt | 2 +-
...black_fill_grayscales600_line_100_rect.xml | 10 ++++++
.../layout/activity_profile_quit_reason.xml | 5 +--
.../res/layout/item_profile_quit_reason.xml | 8 +++++
8 files changed, 62 insertions(+), 8 deletions(-)
create mode 100644 app/src/main/res/drawable/shape_black_fill_grayscales600_line_100_rect.xml
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index cf967a1bb..e6c2ef905 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -140,6 +140,7 @@
> = MutableLiveData()
- val quitReasonData: LiveData> = _quitReasonData
-
- private val quitReasonText = MutableLiveData()
+ val etcText = MutableLiveData("")
+ val quitReasonText = MutableLiveData()
fun setQuitReason(reason: String) {
quitReasonText.value = reason
}
+
+ private val _quitReasonData: MutableLiveData> = MutableLiveData()
+ val quitReasonData: LiveData> = _quitReasonData
fun addQuitReasonList() {
val quitReasonList = listOf(
"앱에 아는 사람들이 없어서",
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt b/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt
index 040692f50..0029b8dcc 100644
--- a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt
@@ -2,6 +2,8 @@ package com.el.yello.presentation.main.profile.quit
import android.os.Bundle
import androidx.activity.viewModels
+import androidx.core.content.ContextCompat
+import androidx.recyclerview.widget.RecyclerView
import com.el.yello.R
import com.el.yello.databinding.ActivityProfileQuitReasonBinding
import com.el.yello.presentation.main.profile.ProfileViewModel
@@ -13,6 +15,8 @@ class QuitReasonActivity :
BindingActivity(R.layout.activity_profile_quit_reason) {
private lateinit var quitReasonList: List
private val viewModel by viewModels()
+ private var clickedItemPosition: Int = RecyclerView.NO_POSITION
+ private var isItemClicked: Boolean = false
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding.vm = viewModel
@@ -22,11 +26,37 @@ class QuitReasonActivity :
private fun initQuitReasonAdapter() {
viewModel.addQuitReasonList()
quitReasonList = viewModel.quitReasonData.value ?: emptyList()
- val adapter = QuitReasonAdapter(storeQuitReason = ::storeQuitReason)
+ val adapter = QuitReasonAdapter(storeQuitReason = ::storeQuitReason) { position, clicked ->
+ clickedItemPosition = position
+ isItemClicked = clicked
+ if (isItemClicked) {
+ if (clickedItemPosition == 7) {
+ if (viewModel.etcText.value.toString().isNotBlank()) {
+ clickedButtonUI()
+ } else {
+ unclickedButtonUI()
+ }
+ } else {
+ clickedButtonUI()
+ }
+ }
+ }
binding.rvQuitReason.adapter = adapter
adapter.submitList(ArrayList(quitReasonList))
}
+ private fun clickedButtonUI(){
+ binding.btnProfileQuitReasonDone.setBackgroundResource(R.drawable.shape_black_fill_grayscales700_line_100_rect)
+ binding.btnProfileQuitReasonDone.setTextColor(ContextCompat.getColor(this, R.color.semantic_red_500))
+ binding.btnProfileQuitReasonDone.isClickable = true
+ }
+
+ private fun unclickedButtonUI(){
+ binding.btnProfileQuitReasonDone.setBackgroundResource(R.drawable.shape_black_fill_grayscales600_line_100_rect)
+ binding.btnProfileQuitReasonDone.setTextColor(ContextCompat.getColor(this, R.color.grayscales_600))
+ binding.btnProfileQuitReasonDone.isClickable = false
+ }
+
private fun storeQuitReason(reason: String) {
viewModel.setQuitReason(reason)
}
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonAdapter.kt b/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonAdapter.kt
index b22448975..2ccceeb77 100644
--- a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonAdapter.kt
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonAdapter.kt
@@ -12,6 +12,7 @@ import com.example.ui.view.setOnSingleClickListener
class QuitReasonAdapter(
private val storeQuitReason: (String) -> Unit,
+ private val onItemClickListener: (Int, Boolean) -> Unit
) : ListAdapter(diffUtil) {
private var selectedItemPosition: Int = RecyclerView.NO_POSITION
@@ -39,6 +40,7 @@ class QuitReasonAdapter(
selectedItemPosition = position
notifyItemChanged(position)
storeQuitReason(getItem(position))
+ onItemClickListener(position, true)
}
class QuitReasonViewHolder(
diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/yelloid/YelIoIdFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/yelloid/YelIoIdFragment.kt
index e780e0ac1..0660a13be 100644
--- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/yelloid/YelIoIdFragment.kt
+++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/yelloid/YelIoIdFragment.kt
@@ -7,8 +7,8 @@ import androidx.fragment.app.activityViewModels
import androidx.navigation.fragment.findNavController
import com.el.yello.R
import com.el.yello.databinding.FragmentYelloIdBinding
-import com.el.yello.presentation.onboarding.activity.OnBoardingActivity
import com.el.yello.presentation.onboarding.OnBoardingViewModel
+import com.el.yello.presentation.onboarding.activity.OnBoardingActivity
import com.el.yello.util.amplitude.AmplitudeUtils
import com.el.yello.util.context.yelloSnackbar
import com.example.ui.base.BindingFragment
diff --git a/app/src/main/res/drawable/shape_black_fill_grayscales600_line_100_rect.xml b/app/src/main/res/drawable/shape_black_fill_grayscales600_line_100_rect.xml
new file mode 100644
index 000000000..1a64a3455
--- /dev/null
+++ b/app/src/main/res/drawable/shape_black_fill_grayscales600_line_100_rect.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_profile_quit_reason.xml b/app/src/main/res/layout/activity_profile_quit_reason.xml
index a0b2ebd07..d2c86e97a 100644
--- a/app/src/main/res/layout/activity_profile_quit_reason.xml
+++ b/app/src/main/res/layout/activity_profile_quit_reason.xml
@@ -87,11 +87,12 @@
android:layout_marginHorizontal="16dp"
android:layout_marginTop="32dp"
android:layout_marginBottom="34dp"
- android:background="@drawable/shape_black_fill_grayscales700_line_100_rect"
+ android:background="@drawable/shape_black_fill_grayscales600_line_100_rect"
android:gravity="center"
android:paddingVertical="16dp"
android:text="@string/profile_quit_reason_button"
- android:textColor="@color/semantic_red_500"
+ android:clickable="false"
+ android:textColor="@color/grayscales_600"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
diff --git a/app/src/main/res/layout/item_profile_quit_reason.xml b/app/src/main/res/layout/item_profile_quit_reason.xml
index 4edbb208a..06cf19a2f 100644
--- a/app/src/main/res/layout/item_profile_quit_reason.xml
+++ b/app/src/main/res/layout/item_profile_quit_reason.xml
@@ -4,9 +4,14 @@
xmlns:tools="http://schemas.android.com/tools">
+
+
+
Date: Tue, 30 Jan 2024 18:01:28 +0900
Subject: [PATCH 06/18] =?UTF-8?q?[FEAT/#350]=20profile=20=ED=83=88?=
=?UTF-8?q?=ED=87=B4=20intent=20=EC=97=B0=EA=B2=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../profile/manage/ProfileManageActivity.kt | 3 +-
.../profile/manage/ProfileQuitTwoActivity.kt | 24 ++++--------
.../main/profile/quit/QuitReasonActivity.kt | 38 +++++++++++++++++--
.../main/profile/quit/QuitReasonAdapter.kt | 2 +-
4 files changed, 44 insertions(+), 23 deletions(-)
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileManageActivity.kt b/app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileManageActivity.kt
index 88fcac92c..38b4faec2 100644
--- a/app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileManageActivity.kt
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileManageActivity.kt
@@ -10,7 +10,6 @@ import com.el.yello.BuildConfig
import com.el.yello.R
import com.el.yello.databinding.ActivityProfileManageBinding
import com.el.yello.presentation.main.profile.ProfileViewModel
-import com.el.yello.presentation.main.profile.quit.QuitReasonActivity
import com.el.yello.util.amplitude.AmplitudeUtils
import com.el.yello.util.context.yelloSnackbar
import com.example.ui.base.BindingActivity
@@ -83,7 +82,7 @@ class ProfileManageActivity :
"click_profile_withdrawal",
JSONObject().put("withdrawal_button", "withdrawal1"),
)
- Intent(this, QuitReasonActivity::class.java).apply {
+ Intent(this, ProfileQuitOneActivity::class.java).apply {
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
startActivity(this)
}
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileQuitTwoActivity.kt b/app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileQuitTwoActivity.kt
index bed202e9b..90e0b4ec6 100644
--- a/app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileQuitTwoActivity.kt
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileQuitTwoActivity.kt
@@ -1,8 +1,10 @@
package com.el.yello.presentation.main.profile.manage
+import android.content.Intent
import android.os.Bundle
import com.el.yello.R
import com.el.yello.databinding.ActivityProfileQuitTwoBinding
+import com.el.yello.presentation.main.profile.quit.QuitReasonActivity
import com.el.yello.util.amplitude.AmplitudeUtils
import com.example.ui.base.BindingActivity
import com.example.ui.view.setOnSingleClickListener
@@ -12,37 +14,27 @@ import org.json.JSONObject
@AndroidEntryPoint
class ProfileQuitTwoActivity :
BindingActivity(R.layout.activity_profile_quit_two) {
-
- private var profileQuitDialog: ProfileQuitDialog? = null
-
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
initBackBtnListener()
- initInviteDialogBtnListener()
+ initQuitBtnListener()
}
private fun initBackBtnListener() {
binding.btnProfileQuitBack.setOnSingleClickListener { finish() }
}
- private fun initInviteDialogBtnListener() {
+ private fun initQuitBtnListener() {
binding.btnProfileQuitForSure.setOnSingleClickListener {
AmplitudeUtils.trackEventWithProperties(
"click_profile_withdrawal",
JSONObject().put("withdrawal_button", "withdrawal3"),
)
- profileQuitDialog = ProfileQuitDialog()
- profileQuitDialog?.show(supportFragmentManager, QUIT_DIALOG)
+ Intent(this, QuitReasonActivity::class.java).apply {
+ addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
+ startActivity(this)
+ }
}
}
-
- override fun onDestroy() {
- super.onDestroy()
- profileQuitDialog?.dismiss()
- }
-
- private companion object {
- const val QUIT_DIALOG = "quitDialog"
- }
}
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt b/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt
index 0029b8dcc..867a93e6f 100644
--- a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt
@@ -7,7 +7,9 @@ import androidx.recyclerview.widget.RecyclerView
import com.el.yello.R
import com.el.yello.databinding.ActivityProfileQuitReasonBinding
import com.el.yello.presentation.main.profile.ProfileViewModel
+import com.el.yello.presentation.main.profile.manage.ProfileQuitDialog
import com.example.ui.base.BindingActivity
+import com.example.ui.view.setOnSingleClickListener
import dagger.hilt.android.AndroidEntryPoint
@AndroidEntryPoint
@@ -17,10 +19,12 @@ class QuitReasonActivity :
private val viewModel by viewModels()
private var clickedItemPosition: Int = RecyclerView.NO_POSITION
private var isItemClicked: Boolean = false
+ private var profileQuitDialog: ProfileQuitDialog? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding.vm = viewModel
initQuitReasonAdapter()
+ initInviteDialogBtnListener()
}
private fun initQuitReasonAdapter() {
@@ -45,19 +49,45 @@ class QuitReasonActivity :
adapter.submitList(ArrayList(quitReasonList))
}
- private fun clickedButtonUI(){
+ private fun initInviteDialogBtnListener() {
+ binding.btnProfileQuitReasonDone.setOnSingleClickListener {
+ profileQuitDialog = ProfileQuitDialog()
+ profileQuitDialog?.show(supportFragmentManager, QUIT_DIALOG)
+ }
+ }
+
+ private fun clickedButtonUI() {
binding.btnProfileQuitReasonDone.setBackgroundResource(R.drawable.shape_black_fill_grayscales700_line_100_rect)
- binding.btnProfileQuitReasonDone.setTextColor(ContextCompat.getColor(this, R.color.semantic_red_500))
+ binding.btnProfileQuitReasonDone.setTextColor(
+ ContextCompat.getColor(
+ this,
+ R.color.semantic_red_500,
+ ),
+ )
binding.btnProfileQuitReasonDone.isClickable = true
}
- private fun unclickedButtonUI(){
+ private fun unclickedButtonUI() {
binding.btnProfileQuitReasonDone.setBackgroundResource(R.drawable.shape_black_fill_grayscales600_line_100_rect)
- binding.btnProfileQuitReasonDone.setTextColor(ContextCompat.getColor(this, R.color.grayscales_600))
+ binding.btnProfileQuitReasonDone.setTextColor(
+ ContextCompat.getColor(
+ this,
+ R.color.grayscales_600,
+ ),
+ )
binding.btnProfileQuitReasonDone.isClickable = false
}
private fun storeQuitReason(reason: String) {
viewModel.setQuitReason(reason)
}
+
+ override fun onDestroy() {
+ super.onDestroy()
+ profileQuitDialog?.dismiss()
+ }
+
+ private companion object {
+ const val QUIT_DIALOG = "quitDialog"
+ }
}
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonAdapter.kt b/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonAdapter.kt
index 2ccceeb77..4c592a1af 100644
--- a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonAdapter.kt
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonAdapter.kt
@@ -12,7 +12,7 @@ import com.example.ui.view.setOnSingleClickListener
class QuitReasonAdapter(
private val storeQuitReason: (String) -> Unit,
- private val onItemClickListener: (Int, Boolean) -> Unit
+ private val onItemClickListener: (Int, Boolean) -> Unit,
) : ListAdapter(diffUtil) {
private var selectedItemPosition: Int = RecyclerView.NO_POSITION
From ac7cf2616ce180bcfaf293125981c5ee7287abed Mon Sep 17 00:00:00 2001
From: pmj1459 <76741702+minju1459@users.noreply.github.com>
Date: Tue, 30 Jan 2024 18:16:35 +0900
Subject: [PATCH 07/18] [FIX/#350] xml clickable -> enabled
---
.../presentation/main/profile/quit/QuitReasonActivity.kt | 9 +++++++--
app/src/main/res/layout/activity_profile_quit_reason.xml | 2 +-
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt b/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt
index 867a93e6f..66374a136 100644
--- a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt
@@ -24,6 +24,7 @@ class QuitReasonActivity :
super.onCreate(savedInstanceState)
binding.vm = viewModel
initQuitReasonAdapter()
+ initBackBtnListener()
initInviteDialogBtnListener()
}
@@ -56,6 +57,10 @@ class QuitReasonActivity :
}
}
+ private fun initBackBtnListener() {
+ binding.btnProfileQuitReasonBack.setOnSingleClickListener { finish() }
+ }
+
private fun clickedButtonUI() {
binding.btnProfileQuitReasonDone.setBackgroundResource(R.drawable.shape_black_fill_grayscales700_line_100_rect)
binding.btnProfileQuitReasonDone.setTextColor(
@@ -64,7 +69,7 @@ class QuitReasonActivity :
R.color.semantic_red_500,
),
)
- binding.btnProfileQuitReasonDone.isClickable = true
+ binding.btnProfileQuitReasonDone.isEnabled = true
}
private fun unclickedButtonUI() {
@@ -75,7 +80,7 @@ class QuitReasonActivity :
R.color.grayscales_600,
),
)
- binding.btnProfileQuitReasonDone.isClickable = false
+ binding.btnProfileQuitReasonDone.isEnabled = false
}
private fun storeQuitReason(reason: String) {
diff --git a/app/src/main/res/layout/activity_profile_quit_reason.xml b/app/src/main/res/layout/activity_profile_quit_reason.xml
index d2c86e97a..c0a413aab 100644
--- a/app/src/main/res/layout/activity_profile_quit_reason.xml
+++ b/app/src/main/res/layout/activity_profile_quit_reason.xml
@@ -91,7 +91,7 @@
android:gravity="center"
android:paddingVertical="16dp"
android:text="@string/profile_quit_reason_button"
- android:clickable="false"
+ android:enabled="false"
android:textColor="@color/grayscales_600"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
From e68cccca1a018eb06824b6a59261b31488173996 Mon Sep 17 00:00:00 2001
From: pmj1459 <76741702+minju1459@users.noreply.github.com>
Date: Wed, 31 Jan 2024 02:17:00 +0900
Subject: [PATCH 08/18] =?UTF-8?q?[FEAT/#350]=20=EC=9C=A0=EC=A0=80=20?=
=?UTF-8?q?=ED=83=88=ED=87=B4=20v2=20API=20=EC=97=B0=EA=B2=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../presentation/main/profile/ProfileViewModel.kt | 9 ++++++++-
.../main/profile/quit/QuitReasonActivity.kt | 1 +
.../example/data/datasource/ProfileDataSource.kt | 5 ++++-
.../data/datasource/remote/ProfileDataSourceImpl.kt | 6 ++++--
.../model/request/profile/RequestQuitReasonDto.kt | 13 +++++++++++++
.../example/data/remote/service/ProfileService.kt | 12 ++++++++++--
.../data/repository/ProfileRepositoryImpl.kt | 6 ++++--
.../example/domain/entity/ProfileQuitReasonModel.kt | 5 +++++
.../example/domain/repository/ProfileRepository.kt | 7 +++++--
9 files changed, 54 insertions(+), 10 deletions(-)
create mode 100644 data/src/main/java/com/example/data/model/request/profile/RequestQuitReasonDto.kt
create mode 100644 domain/src/main/java/com/example/domain/entity/ProfileQuitReasonModel.kt
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt b/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt
index 09a1af1ae..8aacdebf0 100644
--- a/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt
@@ -9,6 +9,7 @@ import com.el.yello.util.amplitude.AmplitudeUtils
import com.example.domain.entity.PayInfoModel
import com.example.domain.entity.PayUserSubsInfoModel
import com.example.domain.entity.ProfileFriendsListModel
+import com.example.domain.entity.ProfileQuitReasonModel
import com.example.domain.entity.ProfileUserModel
import com.example.domain.entity.vote.VoteCount
import com.example.domain.repository.AuthRepository
@@ -171,13 +172,19 @@ class ProfileViewModel @Inject constructor(
fun deleteUserDataToServer() {
viewModelScope.launch {
_deleteUserState.value = UiState.Loading
- profileRepository.deleteUserData()
+ profileRepository.deleteUserData(
+ ProfileQuitReasonModel(
+ quitReasonText.value.toString()
+ ),
+ )
.onSuccess {
+ Timber.d("User deletion successful")
clearLocalInfo()
delay(300)
_deleteUserState.value = UiState.Success(it)
}
.onFailure {
+ Timber.e("User deletion failed: ${it.message}")
_deleteUserState.value = UiState.Failure(it.message.toString())
}
}
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt b/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt
index 66374a136..df0919fff 100644
--- a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt
@@ -1,6 +1,7 @@
package com.el.yello.presentation.main.profile.quit
import android.os.Bundle
+import android.util.Log
import androidx.activity.viewModels
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
diff --git a/data/src/main/java/com/example/data/datasource/ProfileDataSource.kt b/data/src/main/java/com/example/data/datasource/ProfileDataSource.kt
index d4ceb29e4..3698edd5a 100644
--- a/data/src/main/java/com/example/data/datasource/ProfileDataSource.kt
+++ b/data/src/main/java/com/example/data/datasource/ProfileDataSource.kt
@@ -1,5 +1,6 @@
package com.example.data.datasource
+import com.example.data.model.request.profile.RequestQuitReasonDto
import com.example.data.model.response.BaseResponse
import com.example.data.model.response.profile.ResponseProfileFriendsListDto
import com.example.data.model.response.profile.ResponseProfileUserDto
@@ -12,7 +13,9 @@ interface ProfileDataSource {
page: Int,
): BaseResponse
- suspend fun deleteUserData(): BaseResponse
+ suspend fun deleteUserData(
+ request: RequestQuitReasonDto,
+ ): BaseResponse
suspend fun deleteFriendData(
friendId: Long,
diff --git a/data/src/main/java/com/example/data/datasource/remote/ProfileDataSourceImpl.kt b/data/src/main/java/com/example/data/datasource/remote/ProfileDataSourceImpl.kt
index 70f42f81a..735152cca 100644
--- a/data/src/main/java/com/example/data/datasource/remote/ProfileDataSourceImpl.kt
+++ b/data/src/main/java/com/example/data/datasource/remote/ProfileDataSourceImpl.kt
@@ -1,6 +1,7 @@
package com.example.data.datasource.remote
import com.example.data.datasource.ProfileDataSource
+import com.example.data.model.request.profile.RequestQuitReasonDto
import com.example.data.model.response.BaseResponse
import com.example.data.model.response.profile.ResponseProfileFriendsListDto
import com.example.data.model.response.profile.ResponseProfileUserDto
@@ -21,10 +22,11 @@ class ProfileDataSourceImpl @Inject constructor(
return profileService.getFriendsData(page)
}
- override suspend fun deleteUserData(): BaseResponse {
- return profileService.deleteUserData()
+ override suspend fun deleteUserData(request: RequestQuitReasonDto): BaseResponse {
+ return profileService.deleteUserData(request)
}
+
override suspend fun deleteFriendData(friendId: Long): BaseResponse {
return profileService.deleteFriendData(friendId)
}
diff --git a/data/src/main/java/com/example/data/model/request/profile/RequestQuitReasonDto.kt b/data/src/main/java/com/example/data/model/request/profile/RequestQuitReasonDto.kt
new file mode 100644
index 000000000..1a07981de
--- /dev/null
+++ b/data/src/main/java/com/example/data/model/request/profile/RequestQuitReasonDto.kt
@@ -0,0 +1,13 @@
+package com.example.data.model.request.profile
+
+import com.example.domain.entity.ProfileQuitReasonModel
+import kotlinx.serialization.SerialName
+import kotlinx.serialization.Serializable
+
+@Serializable
+data class RequestQuitReasonDto(
+ @SerialName("value")
+ val value: String,
+)
+
+fun ProfileQuitReasonModel.toRequestDto() = RequestQuitReasonDto(value)
diff --git a/data/src/main/java/com/example/data/remote/service/ProfileService.kt b/data/src/main/java/com/example/data/remote/service/ProfileService.kt
index 14c3e1f49..8febbd681 100644
--- a/data/src/main/java/com/example/data/remote/service/ProfileService.kt
+++ b/data/src/main/java/com/example/data/remote/service/ProfileService.kt
@@ -1,10 +1,16 @@
package com.example.data.remote.service
+import com.example.data.model.request.onboarding.RequestAddFriendDto
+import com.example.data.model.request.profile.RequestQuitReasonDto
import com.example.data.model.response.BaseResponse
+import com.example.data.model.response.onboarding.ResponseFriendListDto
import com.example.data.model.response.profile.ResponseProfileFriendsListDto
import com.example.data.model.response.profile.ResponseProfileUserDto
+import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET
+import retrofit2.http.HTTP
+import retrofit2.http.POST
import retrofit2.http.Path
import retrofit2.http.Query
@@ -18,8 +24,10 @@ interface ProfileService {
@Query("page") page: Int,
): BaseResponse
- @DELETE("/api/v1/user")
- suspend fun deleteUserData(): BaseResponse
+ @HTTP(method = "DELETE", path = "/api/v2/user", hasBody = true)
+ suspend fun deleteUserData(
+ @Body request: RequestQuitReasonDto,
+ ): BaseResponse
@DELETE("/api/v1/friend/{friendId}")
suspend fun deleteFriendData(
diff --git a/data/src/main/java/com/example/data/repository/ProfileRepositoryImpl.kt b/data/src/main/java/com/example/data/repository/ProfileRepositoryImpl.kt
index fabf83d8a..2939823e1 100644
--- a/data/src/main/java/com/example/data/repository/ProfileRepositoryImpl.kt
+++ b/data/src/main/java/com/example/data/repository/ProfileRepositoryImpl.kt
@@ -1,7 +1,9 @@
package com.example.data.repository
import com.example.data.datasource.ProfileDataSource
+import com.example.data.model.request.profile.toRequestDto
import com.example.domain.entity.ProfileFriendsListModel
+import com.example.domain.entity.ProfileQuitReasonModel
import com.example.domain.entity.ProfileUserModel
import com.example.domain.repository.ProfileRepository
import javax.inject.Inject
@@ -22,9 +24,9 @@ class ProfileRepositoryImpl @Inject constructor(
}
}
- override suspend fun deleteUserData(): Result {
+ override suspend fun deleteUserData(request: ProfileQuitReasonModel): Result {
return runCatching {
- profileDataSource.deleteUserData().data
+ profileDataSource.deleteUserData(request.toRequestDto())
}
}
diff --git a/domain/src/main/java/com/example/domain/entity/ProfileQuitReasonModel.kt b/domain/src/main/java/com/example/domain/entity/ProfileQuitReasonModel.kt
new file mode 100644
index 000000000..191d3130e
--- /dev/null
+++ b/domain/src/main/java/com/example/domain/entity/ProfileQuitReasonModel.kt
@@ -0,0 +1,5 @@
+package com.example.domain.entity
+
+data class ProfileQuitReasonModel(
+ val value: String,
+)
\ No newline at end of file
diff --git a/domain/src/main/java/com/example/domain/repository/ProfileRepository.kt b/domain/src/main/java/com/example/domain/repository/ProfileRepository.kt
index 787b4aa82..3f0b0f541 100644
--- a/domain/src/main/java/com/example/domain/repository/ProfileRepository.kt
+++ b/domain/src/main/java/com/example/domain/repository/ProfileRepository.kt
@@ -1,6 +1,7 @@
package com.example.domain.repository
import com.example.domain.entity.ProfileFriendsListModel
+import com.example.domain.entity.ProfileQuitReasonModel
import com.example.domain.entity.ProfileUserModel
interface ProfileRepository {
@@ -11,9 +12,11 @@ interface ProfileRepository {
page: Int,
): Result
- suspend fun deleteUserData(): Result
+ suspend fun deleteUserData(
+ request: ProfileQuitReasonModel,
+ ): Result
suspend fun deleteFriendData(
friendId: Long,
): Result
-}
+}
\ No newline at end of file
From 2f2ef60dd06fb7ae72db089cdaf00e4a81ed670d Mon Sep 17 00:00:00 2001
From: pmj1459 <76741702+minju1459@users.noreply.github.com>
Date: Wed, 31 Jan 2024 04:06:32 +0900
Subject: [PATCH 09/18] =?UTF-8?q?[DEL/#350]=20Timber=20=EC=A0=9C=EA=B1=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../yello/presentation/main/profile/ProfileViewModel.kt | 9 +++------
.../main/profile/manage/ProfileQuitDialog.kt | 2 --
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt b/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt
index 214de0939..748f099b8 100644
--- a/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt
@@ -1,6 +1,5 @@
package com.el.yello.presentation.main.profile
-import android.util.Log
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
@@ -40,7 +39,7 @@ class ProfileViewModel @Inject constructor(
init {
resetPageVariable()
- resetStateVariable()
+ // resetStateVariable()
}
private val _getUserDataResult = MutableSharedFlow()
@@ -126,7 +125,7 @@ class ProfileViewModel @Inject constructor(
}
fun resetStateVariable() {
- _deleteFriendState.value = UiState.Empty
+ _deleteFriendState.value = UiState.Loading
_deleteUserState.value = UiState.Empty
_kakaoLogoutState.value = UiState.Empty
_kakaoQuitState.value = UiState.Empty
@@ -182,17 +181,15 @@ class ProfileViewModel @Inject constructor(
_deleteUserState.value = UiState.Loading
profileRepository.deleteUserData(
ProfileQuitReasonModel(
- quitReasonText.value.toString()
+ quitReasonText.value.toString(),
),
)
.onSuccess {
- Timber.d("User deletion successful")
clearLocalInfo()
delay(300)
_deleteUserState.value = UiState.Success(it)
}
.onFailure {
- Timber.e("User deletion failed: ${it.message}")
_deleteUserState.value = UiState.Failure(it.message.toString())
}
}
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileQuitDialog.kt b/app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileQuitDialog.kt
index c7a7e7f97..70009c558 100644
--- a/app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileQuitDialog.kt
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileQuitDialog.kt
@@ -70,8 +70,6 @@ class ProfileQuitDialog :
viewModel.deleteUserDataToServer()
}
}
-
- // 유저 탈퇴 서버 통신 성공 시 카카오 연결 해제 진행
private fun observeUserDeleteState() {
viewModel.deleteUserState.flowWithLifecycle(lifecycle).onEach { state ->
when (state) {
From 39b93dc68674b0fad5e94297ea10d33d0cf1d597 Mon Sep 17 00:00:00 2001
From: pmj1459 <76741702+minju1459@users.noreply.github.com>
Date: Wed, 31 Jan 2024 19:39:24 +0900
Subject: [PATCH 10/18] =?UTF-8?q?[FEAT/#350]=20=EA=B8=B0=ED=83=80=20?=
=?UTF-8?q?=EC=84=A0=ED=83=9D=EC=8B=9C=20=EB=B2=84=ED=8A=BC=20UI=20?=
=?UTF-8?q?=EB=B3=80=EA=B2=BD=20=EB=B0=8F=20=EC=84=9C=EB=B2=84=ED=86=B5?=
=?UTF-8?q?=EC=8B=A0=20request=20=EA=B0=92=20=EB=B3=80=EA=B2=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../el/yello/presentation/main/profile/ProfileViewModel.kt | 7 ++++++-
.../presentation/main/profile/quit/QuitReasonActivity.kt | 7 +------
app/src/main/res/layout/activity_profile_quit_reason.xml | 6 +++---
app/src/main/res/layout/item_profile_quit_reason.xml | 2 +-
4 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt b/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt
index 748f099b8..09f787be5 100644
--- a/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt
@@ -179,9 +179,14 @@ class ProfileViewModel @Inject constructor(
fun deleteUserDataToServer() {
viewModelScope.launch {
_deleteUserState.value = UiState.Loading
+ val quitReason = if (quitReasonText.value.toString() == "기타") {
+ etcText.value.toString()
+ } else {
+ quitReasonText.value.toString()
+ }
profileRepository.deleteUserData(
ProfileQuitReasonModel(
- quitReasonText.value.toString(),
+ quitReason,
),
)
.onSuccess {
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt b/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt
index df0919fff..f0a2a03f2 100644
--- a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt
@@ -1,7 +1,6 @@
package com.el.yello.presentation.main.profile.quit
import android.os.Bundle
-import android.util.Log
import androidx.activity.viewModels
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
@@ -37,11 +36,7 @@ class QuitReasonActivity :
isItemClicked = clicked
if (isItemClicked) {
if (clickedItemPosition == 7) {
- if (viewModel.etcText.value.toString().isNotBlank()) {
- clickedButtonUI()
- } else {
- unclickedButtonUI()
- }
+ unclickedButtonUI()
} else {
clickedButtonUI()
}
diff --git a/app/src/main/res/layout/activity_profile_quit_reason.xml b/app/src/main/res/layout/activity_profile_quit_reason.xml
index c0a413aab..2ee0facf8 100644
--- a/app/src/main/res/layout/activity_profile_quit_reason.xml
+++ b/app/src/main/res/layout/activity_profile_quit_reason.xml
@@ -87,12 +87,12 @@
android:layout_marginHorizontal="16dp"
android:layout_marginTop="32dp"
android:layout_marginBottom="34dp"
- android:background="@drawable/shape_black_fill_grayscales600_line_100_rect"
+ android:background="@{!vm.etcText.isEmpty() ? @drawable/shape_black_fill_grayscales700_line_100_rect : @drawable/shape_black_fill_grayscales600_line_100_rect}"
android:gravity="center"
android:paddingVertical="16dp"
android:text="@string/profile_quit_reason_button"
- android:enabled="false"
- android:textColor="@color/grayscales_600"
+ android:enabled="@{!vm.etcText.isEmpty()}"
+ android:textColor="@{!vm.etcText.isEmpty() ? @color/semantic_red_500 : @color/grayscales_600}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
diff --git a/app/src/main/res/layout/item_profile_quit_reason.xml b/app/src/main/res/layout/item_profile_quit_reason.xml
index 06cf19a2f..07c385408 100644
--- a/app/src/main/res/layout/item_profile_quit_reason.xml
+++ b/app/src/main/res/layout/item_profile_quit_reason.xml
@@ -64,7 +64,7 @@
android:paddingBottom="44dp"
android:lines="3"
android:singleLine="true"
- android:text="@{vm.etcText}"
+ android:text="@={vm.etcText}"
android:textAppearance="@style/TextAppearance.Yello.Body02"
android:textColor="@color/white"
android:textColorHint="@color/grayscales_600"
From e7d5c7984180b88f4f6943c7b38b2ff43d4bdfc8 Mon Sep 17 00:00:00 2001
From: pmj1459 <76741702+minju1459@users.noreply.github.com>
Date: Thu, 1 Feb 2024 00:01:05 +0900
Subject: [PATCH 11/18] =?UTF-8?q?[UI/#350]=20EditText=20=EA=B8=80=EC=9E=90?=
=?UTF-8?q?=EC=88=98=2030=EC=9E=90=20=EC=A0=9C=ED=95=9C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../main/profile/ProfileViewModel.kt | 2 +-
.../main/profile/quit/QuitReasonActivity.kt | 20 ++++++-------------
.../res/layout/item_profile_quit_reason.xml | 4 ++--
3 files changed, 9 insertions(+), 17 deletions(-)
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt b/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt
index 09f787be5..011ad83e6 100644
--- a/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt
@@ -88,7 +88,7 @@ class ProfileViewModel @Inject constructor(
var clickedItemPosition: Int? = null
val etcText = MutableLiveData("")
- val quitReasonText = MutableLiveData()
+ private val quitReasonText = MutableLiveData()
fun setQuitReason(reason: String) {
quitReasonText.value = reason
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt b/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt
index f0a2a03f2..91026b7b4 100644
--- a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt
@@ -1,6 +1,7 @@
package com.el.yello.presentation.main.profile.quit
import android.os.Bundle
+import android.util.Log
import androidx.activity.viewModels
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
@@ -36,7 +37,8 @@ class QuitReasonActivity :
isItemClicked = clicked
if (isItemClicked) {
if (clickedItemPosition == 7) {
- unclickedButtonUI()
+ //unClickedButtonUI()
+ clickedButtonUI()
} else {
clickedButtonUI()
}
@@ -59,23 +61,13 @@ class QuitReasonActivity :
private fun clickedButtonUI() {
binding.btnProfileQuitReasonDone.setBackgroundResource(R.drawable.shape_black_fill_grayscales700_line_100_rect)
- binding.btnProfileQuitReasonDone.setTextColor(
- ContextCompat.getColor(
- this,
- R.color.semantic_red_500,
- ),
- )
+ binding.btnProfileQuitReasonDone.setTextColor(ContextCompat.getColor(this, R.color.semantic_red_500))
binding.btnProfileQuitReasonDone.isEnabled = true
}
- private fun unclickedButtonUI() {
+ private fun unClickedButtonUI() {
binding.btnProfileQuitReasonDone.setBackgroundResource(R.drawable.shape_black_fill_grayscales600_line_100_rect)
- binding.btnProfileQuitReasonDone.setTextColor(
- ContextCompat.getColor(
- this,
- R.color.grayscales_600,
- ),
- )
+ binding.btnProfileQuitReasonDone.setTextColor(ContextCompat.getColor(this, R.color.grayscales_600))
binding.btnProfileQuitReasonDone.isEnabled = false
}
diff --git a/app/src/main/res/layout/item_profile_quit_reason.xml b/app/src/main/res/layout/item_profile_quit_reason.xml
index 07c385408..80af75566 100644
--- a/app/src/main/res/layout/item_profile_quit_reason.xml
+++ b/app/src/main/res/layout/item_profile_quit_reason.xml
@@ -60,11 +60,11 @@
android:hint="@string/profile_quit_reason_hint"
android:paddingHorizontal="14dp"
android:paddingTop="12dp"
- android:visibility="gone"
android:paddingBottom="44dp"
- android:lines="3"
+ android:maxLength="30"
android:singleLine="true"
android:text="@={vm.etcText}"
+ android:inputType="textMultiLine"
android:textAppearance="@style/TextAppearance.Yello.Body02"
android:textColor="@color/white"
android:textColorHint="@color/grayscales_600"
From 39e90de1ded87b4c0dc3c0e3f6da72da3e84f325 Mon Sep 17 00:00:00 2001
From: pmj1459 <76741702+minju1459@users.noreply.github.com>
Date: Thu, 1 Feb 2024 02:16:22 +0900
Subject: [PATCH 12/18] =?UTF-8?q?[FEAT/#350]=20setEtcText=20=EA=B3=A0?=
=?UTF-8?q?=EC=B0=A8=ED=95=A8=EC=88=98=20=EB=B3=80=EA=B2=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../main/profile/ProfileViewModel.kt | 11 ++++---
.../main/profile/quit/QuitReasonActivity.kt | 33 ++++++++++++-------
.../main/profile/quit/QuitReasonAdapter.kt | 31 +++++++++--------
.../res/layout/item_profile_quit_reason.xml | 5 +--
4 files changed, 46 insertions(+), 34 deletions(-)
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt b/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt
index 011ad83e6..b21e0a771 100644
--- a/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt
@@ -87,15 +87,16 @@ class ProfileViewModel @Inject constructor(
var clickedUserData = ProfileUserModel()
var clickedItemPosition: Int? = null
- val etcText = MutableLiveData("")
private val quitReasonText = MutableLiveData()
-
+ val etcText = MutableLiveData("")
+ private val _quitReasonData: MutableLiveData> = MutableLiveData()
+ val quitReasonData: LiveData> = _quitReasonData
+ fun setEtcText(etc: String) {
+ etcText.value = etc
+ }
fun setQuitReason(reason: String) {
quitReasonText.value = reason
}
-
- private val _quitReasonData: MutableLiveData> = MutableLiveData()
- val quitReasonData: LiveData> = _quitReasonData
fun addQuitReasonList() {
val quitReasonList = listOf(
"앱에 아는 사람들이 없어서",
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt b/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt
index 91026b7b4..fe7711d2a 100644
--- a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt
@@ -1,15 +1,14 @@
package com.el.yello.presentation.main.profile.quit
import android.os.Bundle
-import android.util.Log
import androidx.activity.viewModels
-import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import com.el.yello.R
import com.el.yello.databinding.ActivityProfileQuitReasonBinding
import com.el.yello.presentation.main.profile.ProfileViewModel
import com.el.yello.presentation.main.profile.manage.ProfileQuitDialog
import com.example.ui.base.BindingActivity
+import com.example.ui.context.colorOf
import com.example.ui.view.setOnSingleClickListener
import dagger.hilt.android.AndroidEntryPoint
@@ -32,13 +31,15 @@ class QuitReasonActivity :
private fun initQuitReasonAdapter() {
viewModel.addQuitReasonList()
quitReasonList = viewModel.quitReasonData.value ?: emptyList()
- val adapter = QuitReasonAdapter(storeQuitReason = ::storeQuitReason) { position, clicked ->
+ val adapter = QuitReasonAdapter(
+ storeQuitReason = ::storeQuitReason,
+ setEtcText = ::setEtcText,
+ ) { position, clicked ->
clickedItemPosition = position
isItemClicked = clicked
if (isItemClicked) {
if (clickedItemPosition == 7) {
- //unClickedButtonUI()
- clickedButtonUI()
+ nonClickedButtonUI()
} else {
clickedButtonUI()
}
@@ -60,21 +61,29 @@ class QuitReasonActivity :
}
private fun clickedButtonUI() {
- binding.btnProfileQuitReasonDone.setBackgroundResource(R.drawable.shape_black_fill_grayscales700_line_100_rect)
- binding.btnProfileQuitReasonDone.setTextColor(ContextCompat.getColor(this, R.color.semantic_red_500))
- binding.btnProfileQuitReasonDone.isEnabled = true
+ with(binding.btnProfileQuitReasonDone) {
+ setBackgroundResource(R.drawable.shape_black_fill_grayscales700_line_100_rect)
+ setTextColor(colorOf(R.color.semantic_red_500))
+ isEnabled = true
+ }
}
- private fun unClickedButtonUI() {
- binding.btnProfileQuitReasonDone.setBackgroundResource(R.drawable.shape_black_fill_grayscales600_line_100_rect)
- binding.btnProfileQuitReasonDone.setTextColor(ContextCompat.getColor(this, R.color.grayscales_600))
- binding.btnProfileQuitReasonDone.isEnabled = false
+ private fun nonClickedButtonUI() {
+ with(binding.btnProfileQuitReasonDone) {
+ setBackgroundResource(R.drawable.shape_black_fill_grayscales600_line_100_rect)
+ setTextColor(colorOf(R.color.grayscales_600))
+ isEnabled = false
+ }
}
private fun storeQuitReason(reason: String) {
viewModel.setQuitReason(reason)
}
+ private fun setEtcText(etc: String) {
+ viewModel.setEtcText(etc)
+ }
+
override fun onDestroy() {
super.onDestroy()
profileQuitDialog?.dismiss()
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonAdapter.kt b/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonAdapter.kt
index 4c592a1af..dc8d0ac3b 100644
--- a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonAdapter.kt
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonAdapter.kt
@@ -3,6 +3,7 @@ package com.el.yello.presentation.main.profile.quit
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
+import androidx.core.widget.addTextChangedListener
import androidx.recyclerview.widget.ListAdapter
import androidx.recyclerview.widget.RecyclerView
import com.el.yello.R
@@ -12,11 +13,10 @@ import com.example.ui.view.setOnSingleClickListener
class QuitReasonAdapter(
private val storeQuitReason: (String) -> Unit,
+ private val setEtcText: (String) -> Unit,
private val onItemClickListener: (Int, Boolean) -> Unit,
) : ListAdapter(diffUtil) {
-
private var selectedItemPosition: Int = RecyclerView.NO_POSITION
-
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): QuitReasonViewHolder {
return QuitReasonViewHolder(
ItemProfileQuitReasonBinding.inflate(
@@ -25,6 +25,7 @@ class QuitReasonAdapter(
false,
),
storeQuitReason,
+ setEtcText,
this::onItemClicked,
)
}
@@ -46,27 +47,31 @@ class QuitReasonAdapter(
class QuitReasonViewHolder(
private val binding: ItemProfileQuitReasonBinding,
private val storeQuitReason: (String) -> Unit,
+ private val setEtcText: (String) -> Unit,
private val onItemClicked: (Int) -> Unit,
) : RecyclerView.ViewHolder(binding.root) {
- fun bind(reason: String, isSelected: Boolean) {
+ fun bind(reason: String, isItemSelected: Boolean) {
binding.reason = reason
binding.root.setOnSingleClickListener {
onItemClicked(absoluteAdapterPosition)
}
- if (isSelected) {
- binding.ivQuitReasonCheckpoint.setBackgroundResource(R.drawable.ic_profile_quit_reason_check)
- binding.cvQuitReasonList.setBackgroundResource(R.drawable.shape_black_fill_white_line_8_rect)
- if (absoluteAdapterPosition == 7) {
- binding.etQuitEtc.visibility = View.VISIBLE
- } else {
- binding.etQuitEtc.visibility = View.GONE
+ binding.etQuitEtc.addTextChangedListener {
+ setEtcText(binding.etQuitEtc.text.toString())
+ }
+ if (isItemSelected) {
+ with(binding) {
+ ivQuitReasonCheckpoint.setBackgroundResource(R.drawable.ic_profile_quit_reason_check)
+ cvQuitReasonList.setBackgroundResource(R.drawable.shape_black_fill_white_line_8_rect)
+ etQuitEtc.visibility = if (absoluteAdapterPosition == 7) View.VISIBLE else View.GONE
}
storeQuitReason(reason)
} else {
- binding.ivQuitReasonCheckpoint.setBackgroundResource(R.drawable.ic_profile_quit_reason_uncheck)
- binding.cvQuitReasonList.setBackgroundResource(R.drawable.shape_grayscales900_fill_8_rect)
- binding.etQuitEtc.visibility = View.GONE
+ with(binding) {
+ ivQuitReasonCheckpoint.setBackgroundResource(R.drawable.ic_profile_quit_reason_uncheck)
+ cvQuitReasonList.setBackgroundResource(R.drawable.shape_grayscales900_fill_8_rect)
+ etQuitEtc.visibility = View.GONE
+ }
}
}
}
diff --git a/app/src/main/res/layout/item_profile_quit_reason.xml b/app/src/main/res/layout/item_profile_quit_reason.xml
index 80af75566..0f470bfa9 100644
--- a/app/src/main/res/layout/item_profile_quit_reason.xml
+++ b/app/src/main/res/layout/item_profile_quit_reason.xml
@@ -9,9 +9,6 @@
name="reason"
type="String" />
-
Date: Thu, 1 Feb 2024 02:43:01 +0900
Subject: [PATCH 13/18] =?UTF-8?q?[MOD/#350]=20=ED=83=88=ED=87=B4=20?=
=?UTF-8?q?=EC=82=AC=EC=9C=A0=EB=B7=B0=20manage=20=ED=8C=8C=EC=9D=BC?=
=?UTF-8?q?=EB=A1=9C=20=EC=9D=B4=EB=8F=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/src/main/AndroidManifest.xml | 2 +-
.../ProfileQuitReasonActivity.kt} | 7 +++----
.../ProfileQuitReasonAdapter.kt} | 6 +++---
.../main/profile/manage/ProfileQuitTwoActivity.kt | 3 +--
4 files changed, 8 insertions(+), 10 deletions(-)
rename app/src/main/java/com/el/yello/presentation/main/profile/{quit/QuitReasonActivity.kt => manage/ProfileQuitReasonActivity.kt} (94%)
rename app/src/main/java/com/el/yello/presentation/main/profile/{quit/QuitReasonAdapter.kt => manage/ProfileQuitReasonAdapter.kt} (95%)
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index c0b5916d4..e92723c46 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -173,7 +173,7 @@
android:screenOrientation="portrait" />
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt b/app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileQuitReasonActivity.kt
similarity index 94%
rename from app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt
rename to app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileQuitReasonActivity.kt
index fe7711d2a..622a93e3d 100644
--- a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonActivity.kt
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileQuitReasonActivity.kt
@@ -1,4 +1,4 @@
-package com.el.yello.presentation.main.profile.quit
+package com.el.yello.presentation.main.profile.manage
import android.os.Bundle
import androidx.activity.viewModels
@@ -6,14 +6,13 @@ import androidx.recyclerview.widget.RecyclerView
import com.el.yello.R
import com.el.yello.databinding.ActivityProfileQuitReasonBinding
import com.el.yello.presentation.main.profile.ProfileViewModel
-import com.el.yello.presentation.main.profile.manage.ProfileQuitDialog
import com.example.ui.base.BindingActivity
import com.example.ui.context.colorOf
import com.example.ui.view.setOnSingleClickListener
import dagger.hilt.android.AndroidEntryPoint
@AndroidEntryPoint
-class QuitReasonActivity :
+class ProfileQuitReasonActivity :
BindingActivity(R.layout.activity_profile_quit_reason) {
private lateinit var quitReasonList: List
private val viewModel by viewModels()
@@ -31,7 +30,7 @@ class QuitReasonActivity :
private fun initQuitReasonAdapter() {
viewModel.addQuitReasonList()
quitReasonList = viewModel.quitReasonData.value ?: emptyList()
- val adapter = QuitReasonAdapter(
+ val adapter = ProfileQuitReasonAdapter(
storeQuitReason = ::storeQuitReason,
setEtcText = ::setEtcText,
) { position, clicked ->
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonAdapter.kt b/app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileQuitReasonAdapter.kt
similarity index 95%
rename from app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonAdapter.kt
rename to app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileQuitReasonAdapter.kt
index dc8d0ac3b..1ed70c3f2 100644
--- a/app/src/main/java/com/el/yello/presentation/main/profile/quit/QuitReasonAdapter.kt
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileQuitReasonAdapter.kt
@@ -1,4 +1,4 @@
-package com.el.yello.presentation.main.profile.quit
+package com.el.yello.presentation.main.profile.manage
import android.view.LayoutInflater
import android.view.View
@@ -11,11 +11,11 @@ import com.el.yello.databinding.ItemProfileQuitReasonBinding
import com.example.ui.view.ItemDiffCallback
import com.example.ui.view.setOnSingleClickListener
-class QuitReasonAdapter(
+class ProfileQuitReasonAdapter(
private val storeQuitReason: (String) -> Unit,
private val setEtcText: (String) -> Unit,
private val onItemClickListener: (Int, Boolean) -> Unit,
-) : ListAdapter(diffUtil) {
+) : ListAdapter(diffUtil) {
private var selectedItemPosition: Int = RecyclerView.NO_POSITION
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): QuitReasonViewHolder {
return QuitReasonViewHolder(
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileQuitTwoActivity.kt b/app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileQuitTwoActivity.kt
index 90e0b4ec6..dfe2aa2c2 100644
--- a/app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileQuitTwoActivity.kt
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileQuitTwoActivity.kt
@@ -4,7 +4,6 @@ import android.content.Intent
import android.os.Bundle
import com.el.yello.R
import com.el.yello.databinding.ActivityProfileQuitTwoBinding
-import com.el.yello.presentation.main.profile.quit.QuitReasonActivity
import com.el.yello.util.amplitude.AmplitudeUtils
import com.example.ui.base.BindingActivity
import com.example.ui.view.setOnSingleClickListener
@@ -31,7 +30,7 @@ class ProfileQuitTwoActivity :
"click_profile_withdrawal",
JSONObject().put("withdrawal_button", "withdrawal3"),
)
- Intent(this, QuitReasonActivity::class.java).apply {
+ Intent(this, ProfileQuitReasonActivity::class.java).apply {
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
startActivity(this)
}
From 03fb523f2e4e50b8326cf24f07eba4faa5876aec Mon Sep 17 00:00:00 2001
From: pmj1459 <76741702+minju1459@users.noreply.github.com>
Date: Thu, 1 Feb 2024 15:45:54 +0900
Subject: [PATCH 14/18] =?UTF-8?q?[FIX/#350]=20(=EA=B5=AC=EB=8F=85=ED=95=B4?=
=?UTF-8?q?=EC=A7=80-=ED=98=84=EC=9E=AC)=20<=3D=201=20=EC=9D=BC=EB=95=8C?=
=?UTF-8?q?=EB=A7=8C=20=EB=9D=84=EC=9A=B0=EB=8F=84=EB=A1=9D=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
---
.../main/java/com/el/yello/presentation/main/MainActivity.kt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/src/main/java/com/el/yello/presentation/main/MainActivity.kt b/app/src/main/java/com/el/yello/presentation/main/MainActivity.kt
index 1e23766d5..c2e4938b4 100644
--- a/app/src/main/java/com/el/yello/presentation/main/MainActivity.kt
+++ b/app/src/main/java/com/el/yello/presentation/main/MainActivity.kt
@@ -87,7 +87,7 @@ class MainActivity : BindingActivity(R.layout.activity_main
expiredDate.time - currentDate.time,
TimeUnit.MILLISECONDS,
)
- if (daysDifference >= 1) {
+ if (daysDifference <= 1) {
val expiredDateString = state.data?.expiredDate.toString()
val payResubsNoticeFragment =
PayReSubsNoticeDialog.newInstance(expiredDateString)
From ececca78e7904c488fe9d8665e423c5dcee24598 Mon Sep 17 00:00:00 2001
From: pmj1459 <76741702+minju1459@users.noreply.github.com>
Date: Thu, 1 Feb 2024 16:14:53 +0900
Subject: [PATCH 15/18] =?UTF-8?q?[FIX/#350]=20EditText=20=EC=A4=84?=
=?UTF-8?q?=EB=B0=94=EA=BF=88=20=EB=B0=A9=EC=A7=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/src/main/res/layout/item_profile_quit_reason.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/src/main/res/layout/item_profile_quit_reason.xml b/app/src/main/res/layout/item_profile_quit_reason.xml
index 0f470bfa9..fb8099ac5 100644
--- a/app/src/main/res/layout/item_profile_quit_reason.xml
+++ b/app/src/main/res/layout/item_profile_quit_reason.xml
@@ -61,7 +61,7 @@
android:maxLength="30"
android:singleLine="true"
android:visibility="gone"
- android:inputType="textMultiLine"
+ android:inputType="text"
android:textAppearance="@style/TextAppearance.Yello.Body02"
android:textColor="@color/white"
android:textColorHint="@color/grayscales_600"
From 0ddbc0f5610d332479574b453d1b2eb5c06f0da8 Mon Sep 17 00:00:00 2001
From: pmj1459 <76741702+minju1459@users.noreply.github.com>
Date: Fri, 2 Feb 2024 15:46:00 +0900
Subject: [PATCH 16/18] =?UTF-8?q?[MOD/#350]=20=3D=3D=20->=20equals=20?=
=?UTF-8?q?=EB=8C=80=EC=B2=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/el/yello/presentation/main/profile/ProfileViewModel.kt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt b/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt
index bd93ea08d..c174e00dc 100644
--- a/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt
@@ -1,5 +1,6 @@
package com.el.yello.presentation.main.profile
+import android.util.Log
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
@@ -163,7 +164,7 @@ class ProfileViewModel @Inject constructor(
fun deleteUserDataToServer() {
viewModelScope.launch {
_deleteUserState.value = UiState.Loading
- val quitReason = if (quitReasonText.value.toString() == "기타") {
+ val quitReason = if (quitReasonText.value.toString().equals("기타")) {
etcText.value.toString()
} else {
quitReasonText.value.toString()
From c638d84024e93d4ea76579b0230dab98874ffe24 Mon Sep 17 00:00:00 2001
From: pmj1459 <76741702+minju1459@users.noreply.github.com>
Date: Fri, 2 Feb 2024 16:21:36 +0900
Subject: [PATCH 17/18] =?UTF-8?q?[MOD/#350]=20=ED=83=88=ED=87=B4=20?=
=?UTF-8?q?=EC=82=AC=EC=9C=A0=20string=20array=20=EC=B6=94=EC=B6=9C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../main/profile/ProfileViewModel.kt | 17 +++++------------
.../profile/manage/ProfileQuitReasonActivity.kt | 2 +-
app/src/main/res/values/strings.xml | 11 +++++++++++
3 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt b/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt
index c174e00dc..f13bd4475 100644
--- a/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt
@@ -1,10 +1,12 @@
package com.el.yello.presentation.main.profile
+import android.content.Context
import android.util.Log
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
+import com.el.yello.R
import com.el.yello.util.amplitude.AmplitudeUtils
import com.example.domain.entity.PayInfoModel
import com.example.domain.entity.ProfileFriendsListModel
@@ -85,18 +87,9 @@ class ProfileViewModel @Inject constructor(
fun setQuitReason(reason: String) {
quitReasonText.value = reason
}
- fun addQuitReasonList() {
- val quitReasonList = listOf(
- "앱에 아는 사람들이 없어서",
- "구독권과 열람권의 가격이 비싸서",
- "오류가 많아서",
- "재밌는 콘텐츠 또는 질문이 없어서",
- "포인트를 너무 적게 줘서",
- "내 정보를 삭제하고 싶어서",
- "다른 앱이 더 재밌어서",
- "기타",
- )
- _quitReasonData.value = quitReasonList
+ fun addQuitReasonList(context: Context) {
+ val quitReasonArray = context.resources.getStringArray(R.array.quit_reasons)
+ _quitReasonData.value = quitReasonArray.toList()
}
fun setItemPosition(position: Int) {
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileQuitReasonActivity.kt b/app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileQuitReasonActivity.kt
index 622a93e3d..d4b8c4a16 100644
--- a/app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileQuitReasonActivity.kt
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/manage/ProfileQuitReasonActivity.kt
@@ -28,7 +28,7 @@ class ProfileQuitReasonActivity :
}
private fun initQuitReasonAdapter() {
- viewModel.addQuitReasonList()
+ viewModel.addQuitReasonList(this)
quitReasonList = viewModel.quitReasonData.value ?: emptyList()
val adapter = ProfileQuitReasonAdapter(
storeQuitReason = ::storeQuitReason,
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 42dd1ff20..f012ca5ab 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -363,4 +363,15 @@
다시 보지 않기
닫기
다시 보지 않기 아이콘
+
+
+ - 앱에 아는 사람들이 없어서
+ - 구독권과 열람권의 가격이 비싸서
+ - 오류가 많아서
+ - 재밌는 콘텐츠 또는 질문이 없어서
+ - 포인트를 너무 적게 줘서
+ - 내 정보를 삭제하고 싶어서
+ - 다른 앱이 더 재밌어서
+ - 기타
+
From a5a990b0c1b285637ce935f1d5e250e9d889dcf1 Mon Sep 17 00:00:00 2001
From: pmj1459 <76741702+minju1459@users.noreply.github.com>
Date: Fri, 2 Feb 2024 17:02:37 +0900
Subject: [PATCH 18/18] [FIX/#350] _deleteFriendState UiState.Loading -> Empty
---
.../com/el/yello/presentation/main/profile/ProfileViewModel.kt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt b/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt
index 1039d542b..d83828529 100644
--- a/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt
+++ b/app/src/main/java/com/el/yello/presentation/main/profile/ProfileViewModel.kt
@@ -105,7 +105,7 @@ class ProfileViewModel @Inject constructor(
}
fun resetStateVariable() {
- _deleteFriendState.value = UiState.Loading
+ _deleteFriendState.value = UiState.Empty
_deleteUserState.value = UiState.Empty
_kakaoLogoutState.value = UiState.Empty
_kakaoQuitState.value = UiState.Empty