From ba99501e207f1d8c1d3aae0e93073061da0689ee Mon Sep 17 00:00:00 2001 From: kim0hoon Date: Sun, 3 Sep 2023 17:27:16 +0900 Subject: [PATCH 01/10] =?UTF-8?q?[FEAT]=20FullLoadingItem=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20https://github.com/POLZZAK/POLZZAK-Android/issues/9?= =?UTF-8?q?8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/item/FullLoadingItem.kt | 17 ++++++++++++++++ app/src/main/res/layout/item_full_loading.xml | 20 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 app/src/main/java/com/polzzak_android/presentation/common/item/FullLoadingItem.kt create mode 100644 app/src/main/res/layout/item_full_loading.xml diff --git a/app/src/main/java/com/polzzak_android/presentation/common/item/FullLoadingItem.kt b/app/src/main/java/com/polzzak_android/presentation/common/item/FullLoadingItem.kt new file mode 100644 index 00000000..5f54b704 --- /dev/null +++ b/app/src/main/java/com/polzzak_android/presentation/common/item/FullLoadingItem.kt @@ -0,0 +1,17 @@ +package com.polzzak_android.presentation.common.item + +import com.polzzak_android.R +import com.polzzak_android.databinding.ItemFullLoadingBinding +import com.polzzak_android.presentation.common.util.BindableItem + +class FullLoadingItem : BindableItem() { + override val layoutRes: Int = R.layout.item_full_loading + + override fun areItemsTheSame(other: BindableItem<*>): Boolean = other is FullLoadingItem + + override fun areContentsTheSame(other: BindableItem<*>): Boolean = other is FullLoadingItem + + override fun bind(binding: ItemFullLoadingBinding, position: Int) { + //do nothing + } +} \ No newline at end of file diff --git a/app/src/main/res/layout/item_full_loading.xml b/app/src/main/res/layout/item_full_loading.xml new file mode 100644 index 00000000..88b46c62 --- /dev/null +++ b/app/src/main/res/layout/item_full_loading.xml @@ -0,0 +1,20 @@ + + + + + + + + \ No newline at end of file From a1c2d12d4faba17c20064b44e15926e4981df1a7 Mon Sep 17 00:00:00 2001 From: kim0hoon Date: Sun, 3 Sep 2023 18:14:41 +0900 Subject: [PATCH 02/10] =?UTF-8?q?[FEAT]=20=EB=82=A0=EC=A7=9C=ED=91=9C?= =?UTF-8?q?=EC=8B=9C=20=ED=95=A8=EC=88=98=20=EC=B6=94=EA=B0=80=20https://g?= =?UTF-8?q?ithub.com/POLZZAK/POLZZAK-Android/issues/98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/common/util/Extensions.kt | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/polzzak_android/presentation/common/util/Extensions.kt b/app/src/main/java/com/polzzak_android/presentation/common/util/Extensions.kt index 25542d31..1b11c720 100644 --- a/app/src/main/java/com/polzzak_android/presentation/common/util/Extensions.kt +++ b/app/src/main/java/com/polzzak_android/presentation/common/util/Extensions.kt @@ -1,10 +1,10 @@ package com.polzzak_android.presentation.common.util import android.content.Context -import android.util.DisplayMetrics import java.time.Duration import java.time.LocalDate import java.time.LocalDateTime +import java.time.Period import java.time.format.DateTimeFormatter const val SERVER_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS" @@ -31,4 +31,22 @@ fun LocalDateTime.getRemainingSeconds(): Int { .between(LocalDateTime.now(), endTime) .seconds .toInt() -} \ No newline at end of file +} + +/** + * 날짜 규칙 + * 3달 미만의 공지: O월.O일 (ex. 06.24) + * 3개월 이상 1년 미만의 공지: O개월 전 (ex. 3개월 전 ~ 11개월 전) + * 1년 이상이 지난 공지: 1년 단위로 카운팅(ex. 1년 전, 2년 전) + */ +fun LocalDate.toDateString(): String { + val nowDate = LocalDate.now() + val diff = Period.between(this, nowDate) + val getDateStr = { date: Int -> String.format("%02d", date) } + return when { + this.isAfter(nowDate.minusMonths(3)) -> "${getDateStr(this.monthValue)}.${getDateStr(this.dayOfMonth)}" + this.isBefore(nowDate.minusYears(1)) || this.isEqual(nowDate.minusYears(1)) -> "${diff.years}년 전" + else -> "${diff.months}개월 전" + } +} + From f5dc4bdc1537ee1cf7222bbf4f5fb1c8a6b8dfe5 Mon Sep 17 00:00:00 2001 From: kim0hoon Date: Sun, 3 Sep 2023 18:16:01 +0900 Subject: [PATCH 03/10] =?UTF-8?q?[FEAT]=20=EA=B3=B5=EC=A7=80=EC=82=AC?= =?UTF-8?q?=ED=95=AD=20=ED=99=94=EB=A9=B4=20=EC=B6=94=EA=B0=80=20https://g?= =?UTF-8?q?ithub.com/POLZZAK/POLZZAK-Android/issues/98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/myPage/kid/KidMyPageFragment.kt | 3 +- .../feature/myPage/notice/MyNoticeFragment.kt | 91 +++++++++++++++++++ .../myPage/notice/MyNoticeItemDecoration.kt | 25 +++++ .../myPage/notice/MyNoticeViewModel.kt | 78 ++++++++++++++++ .../myPage/notice/item/MyNoticeEmptyItem.kt | 17 ++++ .../myPage/notice/item/MyNoticeItem.kt | 24 +++++ .../myPage/notice/model/MyNoticeModel.kt | 10 ++ .../myPage/notice/model/MyNoticesModel.kt | 7 ++ .../protector/ProtectorMyPageFragment.kt | 6 +- .../main/res/layout/fragment_my_notice.xml | 30 ++++++ app/src/main/res/layout/item_my_notice.xml | 69 ++++++++++++++ .../main/res/layout/item_my_noticie_empty.xml | 21 +++++ app/src/main/res/navigation/kid_nav_graph.xml | 14 ++- .../res/navigation/protector_nav_graph.xml | 13 ++- app/src/main/res/values/strings.xml | 4 +- 15 files changed, 406 insertions(+), 6 deletions(-) create mode 100644 app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeFragment.kt create mode 100644 app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeItemDecoration.kt create mode 100644 app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeViewModel.kt create mode 100644 app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/item/MyNoticeEmptyItem.kt create mode 100644 app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/item/MyNoticeItem.kt create mode 100644 app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/model/MyNoticeModel.kt create mode 100644 app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/model/MyNoticesModel.kt create mode 100644 app/src/main/res/layout/fragment_my_notice.xml create mode 100644 app/src/main/res/layout/item_my_notice.xml create mode 100644 app/src/main/res/layout/item_my_noticie_empty.xml diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/kid/KidMyPageFragment.kt b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/kid/KidMyPageFragment.kt index ea7ea6cf..d75c93ec 100644 --- a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/kid/KidMyPageFragment.kt +++ b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/kid/KidMyPageFragment.kt @@ -1,5 +1,6 @@ package com.polzzak_android.presentation.feature.myPage.kid +import androidx.navigation.fragment.findNavController import com.polzzak_android.R import com.polzzak_android.presentation.common.base.BaseFragment import com.polzzak_android.databinding.FragmentKidMyPageBinding @@ -73,7 +74,7 @@ class KidMyPageFragment : BaseFragment(), ToolbarIconI } fun onClickNotice() { - // todo: 공지사항 클릭 + findNavController().navigate(R.id.action_kidMyPageFragment_to_myNoticeFragment) } fun onClickManageAccount() { diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeFragment.kt b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeFragment.kt new file mode 100644 index 00000000..90a1fff5 --- /dev/null +++ b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeFragment.kt @@ -0,0 +1,91 @@ +package com.polzzak_android.presentation.feature.myPage.notice + +import androidx.fragment.app.viewModels +import androidx.navigation.fragment.findNavController +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView +import com.polzzak_android.R +import com.polzzak_android.databinding.FragmentMyNoticeBinding +import com.polzzak_android.presentation.common.base.BaseFragment +import com.polzzak_android.presentation.common.item.FullLoadingItem +import com.polzzak_android.presentation.common.item.LoadMoreLoadingSpinnerItem +import com.polzzak_android.presentation.common.model.ModelState +import com.polzzak_android.presentation.common.util.BindableItem +import com.polzzak_android.presentation.common.util.BindableItemAdapter +import com.polzzak_android.presentation.common.util.toPx +import com.polzzak_android.presentation.component.toolbar.ToolbarData +import com.polzzak_android.presentation.component.toolbar.ToolbarHelper +import com.polzzak_android.presentation.feature.myPage.notice.item.MyNoticeEmptyItem +import com.polzzak_android.presentation.feature.myPage.notice.item.MyNoticeItem +import com.polzzak_android.presentation.feature.myPage.notice.model.MyNoticesModel + +//TODO 바텀네비 invisible +class MyNoticeFragment : BaseFragment() { + override val layoutResId: Int = R.layout.fragment_my_notice + + private val noticeViewModel by viewModels() + + override fun initView() { + super.initView() + initToolbar() + initRecyclerView() + } + + private fun initToolbar() { + with(binding) { + ToolbarHelper( + data = ToolbarData( + popStack = findNavController(), + titleText = getString(R.string.common_notice) + ), + toolbar = inToolbar + ).set() + } + } + + private fun initRecyclerView() { + val context = binding.root.context ?: return + with(binding.rvNotices) { + layoutManager = LinearLayoutManager(context) + adapter = BindableItemAdapter() + val marginPx = ITEM_MARGIN_DP.toPx(context) + addItemDecoration(MyNoticeItemDecoration(marginPx = marginPx)) + addOnScrollListener(object : RecyclerView.OnScrollListener() { + override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { + super.onScrolled(recyclerView, dx, dy) + if (!recyclerView.canScrollVertically(1) && noticeViewModel.noticesLiveData.value is ModelState.Success) noticeViewModel.requestMoreNotices() + } + }) + } + } + + override fun initObserver() { + super.initObserver() + noticeViewModel.noticesLiveData.observe(viewLifecycleOwner) { + val adapter = (binding.rvNotices.adapter as? BindableItemAdapter) ?: return@observe + val noticeItem = createNoticeItem(it.data ?: MyNoticesModel()) + val items = mutableListOf>() + when (it) { + is ModelState.Loading -> { + if (it.data?.notices.isNullOrEmpty()) items.add(FullLoadingItem()) + else items.addAll(noticeItem + LoadMoreLoadingSpinnerItem()) + } + + is ModelState.Success -> items.addAll(noticeItem) + is ModelState.Error -> { + //TODO error handling + } + } + adapter.updateItem(item = items) + } + } + + private fun createNoticeItem(model: MyNoticesModel) = model.notices.map { + MyNoticeItem(model = it) + }.ifEmpty { listOf(MyNoticeEmptyItem()) } + + companion object { + private const val ITEM_MARGIN_DP = 16 + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeItemDecoration.kt b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeItemDecoration.kt new file mode 100644 index 00000000..226c974e --- /dev/null +++ b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeItemDecoration.kt @@ -0,0 +1,25 @@ +package com.polzzak_android.presentation.feature.myPage.notice + +import android.graphics.Rect +import android.view.View +import androidx.annotation.Px +import androidx.recyclerview.widget.RecyclerView +import androidx.recyclerview.widget.RecyclerView.ItemDecoration +import com.polzzak_android.presentation.common.util.BindableItemAdapter +import com.polzzak_android.presentation.feature.myPage.notice.item.MyNoticeItem + +class MyNoticeItemDecoration(@Px private val marginPx: Int) : ItemDecoration() { + override fun getItemOffsets( + outRect: Rect, + view: View, + parent: RecyclerView, + state: RecyclerView.State + ) { + super.getItemOffsets(outRect, view, parent, state) + val position = parent.getChildAdapterPosition(view) + val adapter = (parent.adapter as? BindableItemAdapter) ?: return + if (adapter.currentList.getOrNull(position) !is MyNoticeItem) return + outRect.top = marginPx + outRect.bottom = if (position == adapter.currentList.lastIndex) marginPx else 0 + } +} \ No newline at end of file diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeViewModel.kt b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeViewModel.kt new file mode 100644 index 00000000..3284f46a --- /dev/null +++ b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeViewModel.kt @@ -0,0 +1,78 @@ +package com.polzzak_android.presentation.feature.myPage.notice + +import androidx.lifecycle.LiveData +import androidx.lifecycle.MutableLiveData +import androidx.lifecycle.ViewModel +import androidx.lifecycle.viewModelScope +import com.polzzak_android.presentation.common.model.ModelState +import com.polzzak_android.presentation.common.util.toLocalDate +import com.polzzak_android.presentation.feature.myPage.notice.model.MyNoticeModel +import com.polzzak_android.presentation.feature.myPage.notice.model.MyNoticesModel +import kotlinx.coroutines.Job +import kotlinx.coroutines.delay +import kotlinx.coroutines.launch +import java.time.LocalDate + +//TODO api 연동 +class MyNoticeViewModel : ViewModel() { + private val _noticesLiveData = MutableLiveData>() + val noticesLiveData: LiveData> = _noticesLiveData + + private var requestNoticesJob: Job? = null + + init { + initNotices() + } + + private fun initNotices() { + requestNoticesJob?.cancel() + requestNoticesJob = viewModelScope.launch { + _noticesLiveData.value = ModelState.Loading(MyNoticesModel()) + requestNotices() + } + } + + fun requestMoreNotices() { + if (noticesLiveData.value?.data?.hasNextPage == false) return + if (requestNoticesJob?.isCompleted == false) return + requestNoticesJob = viewModelScope.launch { + _noticesLiveData.value = + ModelState.Loading(_noticesLiveData.value?.data ?: MyNoticesModel()) + requestNotices() + } + } + + private suspend fun requestNotices() { + val prevData = noticesLiveData.value?.data ?: MyNoticesModel() + delay(2000) + //TODO api 연동 + //on Success + val nextData = getMockNotices(nextId = prevData.nextId, pageSize = PAGE_SIZE) + val updatedData = nextData.copy(notices = prevData.notices + nextData.notices) + _noticesLiveData.value = ModelState.Success(updatedData) + } + + companion object { + private const val PAGE_SIZE = 10 + } +} + +private fun getMockNotices(nextId: Int?, pageSize: Int): MyNoticesModel { + val startIdx = nextId ?: 0 + val nextIdx = minOf(mockNotices.size, startIdx + pageSize) + val nId = mockNotices.getOrNull(nextIdx)?.id + return MyNoticesModel( + notices = mockNotices.subList(startIdx, nextIdx), + nextId = nId, + hasNextPage = (nId != null) + ) +} + +private val mockNotices = List(27) { + MyNoticeModel( + id = it, + title = "title$it".repeat((it % 12) + 1), + date = "2023-06-04T20:08:23.745393551".toLocalDate() ?: (LocalDate.now()), + content = "content \n\n\n content1 \n\n content \n" + ) +} \ No newline at end of file diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/item/MyNoticeEmptyItem.kt b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/item/MyNoticeEmptyItem.kt new file mode 100644 index 00000000..fd5e3f6e --- /dev/null +++ b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/item/MyNoticeEmptyItem.kt @@ -0,0 +1,17 @@ +package com.polzzak_android.presentation.feature.myPage.notice.item + +import com.polzzak_android.R +import com.polzzak_android.databinding.ItemMyNoticieEmptyBinding +import com.polzzak_android.presentation.common.util.BindableItem + +class MyNoticeEmptyItem : BindableItem() { + override val layoutRes: Int = R.layout.item_my_noticie_empty + override fun areItemsTheSame(other: BindableItem<*>): Boolean = other is MyNoticeEmptyItem + + override fun areContentsTheSame(other: BindableItem<*>): Boolean = other is MyNoticeEmptyItem + + override fun bind(binding: ItemMyNoticieEmptyBinding, position: Int) { + //do nothing + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/item/MyNoticeItem.kt b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/item/MyNoticeItem.kt new file mode 100644 index 00000000..776645fe --- /dev/null +++ b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/item/MyNoticeItem.kt @@ -0,0 +1,24 @@ +package com.polzzak_android.presentation.feature.myPage.notice.item + +import com.polzzak_android.R +import com.polzzak_android.databinding.ItemMyNoticeBinding +import com.polzzak_android.presentation.common.util.BindableItem +import com.polzzak_android.presentation.common.util.toDateString +import com.polzzak_android.presentation.feature.myPage.notice.model.MyNoticeModel + +class MyNoticeItem(private val model: MyNoticeModel) : BindableItem() { + override val layoutRes: Int = R.layout.item_my_notice + override fun areItemsTheSame(other: BindableItem<*>): Boolean = + other is MyNoticeItem && this.model.id == other.model.id + + override fun areContentsTheSame(other: BindableItem<*>): Boolean = + other is MyNoticeItem && this.model == other.model + + override fun bind(binding: ItemMyNoticeBinding, position: Int) { + with(binding) { + tvTitle.text = model.title + tvDate.text = model.date.toDateString() + tvContent.text = model.content.replace(Regex("(\\r\\n|\\r|\\n)+"), " ") + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/model/MyNoticeModel.kt b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/model/MyNoticeModel.kt new file mode 100644 index 00000000..d3fc316c --- /dev/null +++ b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/model/MyNoticeModel.kt @@ -0,0 +1,10 @@ +package com.polzzak_android.presentation.feature.myPage.notice.model + +import java.time.LocalDate + +data class MyNoticeModel( + val id: Int, + val title: String, + val date: LocalDate, + val content: String +) diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/model/MyNoticesModel.kt b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/model/MyNoticesModel.kt new file mode 100644 index 00000000..e3e176fc --- /dev/null +++ b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/model/MyNoticesModel.kt @@ -0,0 +1,7 @@ +package com.polzzak_android.presentation.feature.myPage.notice.model + +data class MyNoticesModel( + val notices: List = emptyList(), + val nextId: Int? = null, + val hasNextPage: Boolean = true +) \ No newline at end of file diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/protector/ProtectorMyPageFragment.kt b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/protector/ProtectorMyPageFragment.kt index 89bbdf1e..ed2e7105 100644 --- a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/protector/ProtectorMyPageFragment.kt +++ b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/protector/ProtectorMyPageFragment.kt @@ -1,5 +1,6 @@ package com.polzzak_android.presentation.feature.myPage.protector +import androidx.navigation.fragment.findNavController import com.polzzak_android.R import com.polzzak_android.databinding.FragmentProtectorMyPageBinding import com.polzzak_android.presentation.common.base.BaseFragment @@ -32,7 +33,7 @@ class ProtectorMyPageFragment : BaseFragment(), setUpPointView() } - private fun setUpPointView(){ + private fun setUpPointView() { with(binding.pointRanking) { text = "폴짝 랭킹" icon.setImageResource(R.drawable.ic_point_rank) @@ -74,7 +75,8 @@ class ProtectorMyPageFragment : BaseFragment(), } fun onClickNotice() { - // todo: 공지사항 클릭 + findNavController().navigate(R.id.action_protectorMyPageFragment_to_myNoticeFragment) + } fun onClickManageAccount() { diff --git a/app/src/main/res/layout/fragment_my_notice.xml b/app/src/main/res/layout/fragment_my_notice.xml new file mode 100644 index 00000000..294326bd --- /dev/null +++ b/app/src/main/res/layout/fragment_my_notice.xml @@ -0,0 +1,30 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_my_notice.xml b/app/src/main/res/layout/item_my_notice.xml new file mode 100644 index 00000000..e5b3e1ee --- /dev/null +++ b/app/src/main/res/layout/item_my_notice.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_my_noticie_empty.xml b/app/src/main/res/layout/item_my_noticie_empty.xml new file mode 100644 index 00000000..383fa36e --- /dev/null +++ b/app/src/main/res/layout/item_my_noticie_empty.xml @@ -0,0 +1,21 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/navigation/kid_nav_graph.xml b/app/src/main/res/navigation/kid_nav_graph.xml index 7948a3e3..35e5c1c5 100644 --- a/app/src/main/res/navigation/kid_nav_graph.xml +++ b/app/src/main/res/navigation/kid_nav_graph.xml @@ -59,6 +59,18 @@ + android:label="KidMyPageFragment"> + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/navigation/protector_nav_graph.xml b/app/src/main/res/navigation/protector_nav_graph.xml index c001a9de..f8c8e431 100644 --- a/app/src/main/res/navigation/protector_nav_graph.xml +++ b/app/src/main/res/navigation/protector_nav_graph.xml @@ -75,5 +75,16 @@ android:id="@+id/protectorMyPageFragment" android:name="com.polzzak_android.presentation.feature.myPage.protector.ProtectorMyPageFragment" android:label="ProtectorMyPageFragment" - tools:layout="@layout/fragment_protector_my_page"/> + tools:layout="@layout/fragment_protector_my_page"> + + + + + \ 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 60dc29de..6e4b3e11 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -26,6 +26,7 @@ 수락 거절 알림 + 공지사항 참 잘 했어요 도장 쾅! @@ -162,5 +163,6 @@ 선물 전달 확인 알림 선물 전달이 완료되었는지 확인하는 알림을 받을래요 - + + 업데이트된 소식이 없어요 \ No newline at end of file From 2ae1c9cd971d8897c436fbb425f5fba2207e1827 Mon Sep 17 00:00:00 2001 From: kim0hoon Date: Sun, 3 Sep 2023 20:34:13 +0900 Subject: [PATCH 04/10] =?UTF-8?q?[FEAT]=20=EA=B3=B5=EC=A7=80=EC=82=AC?= =?UTF-8?q?=ED=95=AD=20=EC=83=81=EC=84=B8=20=ED=99=94=EB=A9=B4=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20https://github.com/POLZZAK/POLZZAK-Android/issues/9?= =?UTF-8?q?8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/common/util/Extensions.kt | 2 +- .../myPage/notice/MyNoticeClickListener.kt | 7 ++ .../myPage/notice/MyNoticeDetailFragment.kt | 45 +++++++++ .../feature/myPage/notice/MyNoticeFragment.kt | 13 ++- .../myPage/notice/MyNoticeViewModel.kt | 8 +- .../myPage/notice/item/MyNoticeItem.kt | 13 ++- .../myPage/notice/model/MyNoticeModel.kt | 9 +- .../res/layout/fragment_my_notice_detail.xml | 99 +++++++++++++++++++ app/src/main/res/navigation/kid_nav_graph.xml | 30 ++++-- .../res/navigation/protector_nav_graph.xml | 13 ++- 10 files changed, 217 insertions(+), 22 deletions(-) create mode 100644 app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeClickListener.kt create mode 100644 app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeDetailFragment.kt create mode 100644 app/src/main/res/layout/fragment_my_notice_detail.xml diff --git a/app/src/main/java/com/polzzak_android/presentation/common/util/Extensions.kt b/app/src/main/java/com/polzzak_android/presentation/common/util/Extensions.kt index 1b11c720..ad0683a7 100644 --- a/app/src/main/java/com/polzzak_android/presentation/common/util/Extensions.kt +++ b/app/src/main/java/com/polzzak_android/presentation/common/util/Extensions.kt @@ -39,7 +39,7 @@ fun LocalDateTime.getRemainingSeconds(): Int { * 3개월 이상 1년 미만의 공지: O개월 전 (ex. 3개월 전 ~ 11개월 전) * 1년 이상이 지난 공지: 1년 단위로 카운팅(ex. 1년 전, 2년 전) */ -fun LocalDate.toDateString(): String { +fun LocalDate.toPublishedDateString(): String { val nowDate = LocalDate.now() val diff = Period.between(this, nowDate) val getDateStr = { date: Int -> String.format("%02d", date) } diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeClickListener.kt b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeClickListener.kt new file mode 100644 index 00000000..3a1abe52 --- /dev/null +++ b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeClickListener.kt @@ -0,0 +1,7 @@ +package com.polzzak_android.presentation.feature.myPage.notice + +import com.polzzak_android.presentation.feature.myPage.notice.model.MyNoticeModel + +interface MyNoticeClickListener { + fun onClickNotice(model: MyNoticeModel) +} \ No newline at end of file diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeDetailFragment.kt b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeDetailFragment.kt new file mode 100644 index 00000000..98c8da2e --- /dev/null +++ b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeDetailFragment.kt @@ -0,0 +1,45 @@ +package com.polzzak_android.presentation.feature.myPage.notice + +import androidx.navigation.fragment.findNavController +import com.polzzak_android.R +import com.polzzak_android.databinding.FragmentMyNoticeDetailBinding +import com.polzzak_android.presentation.common.base.BaseFragment +import com.polzzak_android.presentation.common.util.getParcelableOrNull +import com.polzzak_android.presentation.component.toolbar.ToolbarData +import com.polzzak_android.presentation.component.toolbar.ToolbarHelper +import com.polzzak_android.presentation.feature.myPage.notice.model.MyNoticeModel +import java.time.format.DateTimeFormatter + +class MyNoticeDetailFragment : BaseFragment() { + override val layoutResId: Int = R.layout.fragment_my_notice_detail + + override fun initView() { + super.initView() + initToolbar() + initContent() + } + + private fun initToolbar() { + ToolbarHelper( + data = ToolbarData( + popStack = findNavController(), + titleText = getString(R.string.common_notice) + ), + toolbar = binding.inToolbar + ).set() + } + + private fun initContent() { + val noticeModel = + arguments?.getParcelableOrNull(ARGUMENT_NOTICE_KEY, MyNoticeModel::class.java) ?: return + with(binding) { + tvTitle.text = noticeModel.title + tvDate.text = noticeModel.date.format(DateTimeFormatter.ofPattern("yyyy.MM.dd HH:mm")) + tvContent.text = noticeModel.content + } + } + + companion object { + const val ARGUMENT_NOTICE_KEY = "argument_notice_key" + } +} \ No newline at end of file diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeFragment.kt b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeFragment.kt index 90a1fff5..02646e6d 100644 --- a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeFragment.kt +++ b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeFragment.kt @@ -1,5 +1,6 @@ package com.polzzak_android.presentation.feature.myPage.notice +import android.os.Bundle import androidx.fragment.app.viewModels import androidx.navigation.fragment.findNavController import androidx.recyclerview.widget.LinearLayoutManager @@ -17,10 +18,11 @@ import com.polzzak_android.presentation.component.toolbar.ToolbarData import com.polzzak_android.presentation.component.toolbar.ToolbarHelper import com.polzzak_android.presentation.feature.myPage.notice.item.MyNoticeEmptyItem import com.polzzak_android.presentation.feature.myPage.notice.item.MyNoticeItem +import com.polzzak_android.presentation.feature.myPage.notice.model.MyNoticeModel import com.polzzak_android.presentation.feature.myPage.notice.model.MyNoticesModel //TODO 바텀네비 invisible -class MyNoticeFragment : BaseFragment() { +class MyNoticeFragment : BaseFragment(), MyNoticeClickListener { override val layoutResId: Int = R.layout.fragment_my_notice private val noticeViewModel by viewModels() @@ -81,9 +83,16 @@ class MyNoticeFragment : BaseFragment() { } private fun createNoticeItem(model: MyNoticesModel) = model.notices.map { - MyNoticeItem(model = it) + MyNoticeItem(model = it, clickListener = this) }.ifEmpty { listOf(MyNoticeEmptyItem()) } + override fun onClickNotice(model: MyNoticeModel) { + val bundle = Bundle().apply { + putParcelable(MyNoticeDetailFragment.ARGUMENT_NOTICE_KEY, model) + } + findNavController().navigate(R.id.action_myNoticeFragment_to_myNoticeDetailFragment, bundle) + } + companion object { private const val ITEM_MARGIN_DP = 16 } diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeViewModel.kt b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeViewModel.kt index 3284f46a..38de5fef 100644 --- a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeViewModel.kt +++ b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeViewModel.kt @@ -5,13 +5,13 @@ import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.polzzak_android.presentation.common.model.ModelState -import com.polzzak_android.presentation.common.util.toLocalDate +import com.polzzak_android.presentation.common.util.toLocalDateTime import com.polzzak_android.presentation.feature.myPage.notice.model.MyNoticeModel import com.polzzak_android.presentation.feature.myPage.notice.model.MyNoticesModel import kotlinx.coroutines.Job import kotlinx.coroutines.delay import kotlinx.coroutines.launch -import java.time.LocalDate +import java.time.LocalDateTime //TODO api 연동 class MyNoticeViewModel : ViewModel() { @@ -72,7 +72,7 @@ private val mockNotices = List(27) { MyNoticeModel( id = it, title = "title$it".repeat((it % 12) + 1), - date = "2023-06-04T20:08:23.745393551".toLocalDate() ?: (LocalDate.now()), - content = "content \n\n\n content1 \n\n content \n" + date = "2023-06-04T20:08:23.745393551".toLocalDateTime() ?: (LocalDateTime.now()), + content = "content\n\n\ncontent1\n\ncontent\ncontent".repeat(7) ) } \ No newline at end of file diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/item/MyNoticeItem.kt b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/item/MyNoticeItem.kt index 776645fe..de6528ad 100644 --- a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/item/MyNoticeItem.kt +++ b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/item/MyNoticeItem.kt @@ -3,10 +3,14 @@ package com.polzzak_android.presentation.feature.myPage.notice.item import com.polzzak_android.R import com.polzzak_android.databinding.ItemMyNoticeBinding import com.polzzak_android.presentation.common.util.BindableItem -import com.polzzak_android.presentation.common.util.toDateString +import com.polzzak_android.presentation.common.util.toPublishedDateString +import com.polzzak_android.presentation.feature.myPage.notice.MyNoticeClickListener import com.polzzak_android.presentation.feature.myPage.notice.model.MyNoticeModel -class MyNoticeItem(private val model: MyNoticeModel) : BindableItem() { +class MyNoticeItem( + private val model: MyNoticeModel, + private val clickListener: MyNoticeClickListener +) : BindableItem() { override val layoutRes: Int = R.layout.item_my_notice override fun areItemsTheSame(other: BindableItem<*>): Boolean = other is MyNoticeItem && this.model.id == other.model.id @@ -16,8 +20,11 @@ class MyNoticeItem(private val model: MyNoticeModel) : BindableItem + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/navigation/kid_nav_graph.xml b/app/src/main/res/navigation/kid_nav_graph.xml index 35e5c1c5..b86ef92e 100644 --- a/app/src/main/res/navigation/kid_nav_graph.xml +++ b/app/src/main/res/navigation/kid_nav_graph.xml @@ -5,7 +5,8 @@ app:startDestination="@id/kid_main_nav_graph"> - + android:defaultValue="-1" + app:argType="integer" /> - - - + app:destination="@id/myNoticeFragment" /> + android:label="MyNoticeFragment"> + + + + + diff --git a/app/src/main/res/navigation/protector_nav_graph.xml b/app/src/main/res/navigation/protector_nav_graph.xml index f8c8e431..4c2d88b4 100644 --- a/app/src/main/res/navigation/protector_nav_graph.xml +++ b/app/src/main/res/navigation/protector_nav_graph.xml @@ -86,5 +86,16 @@ android:id="@+id/myNoticeFragment" android:name="com.polzzak_android.presentation.feature.myPage.notice.MyNoticeFragment" android:label="MyNoticeFragment" - tools:layout="@layout/fragment_my_notice" /> + tools:layout="@layout/fragment_my_notice"> + + + + + \ No newline at end of file From 21b8b245f6d9e70165c8ae41952eab5027f886f0 Mon Sep 17 00:00:00 2001 From: kim0hoon Date: Sun, 3 Sep 2023 20:46:48 +0900 Subject: [PATCH 05/10] =?UTF-8?q?[FEAT]=20=EA=B3=B5=EC=A7=80=EC=82=AC?= =?UTF-8?q?=ED=95=AD=20=EC=95=84=EC=9D=B4=ED=85=9C=20background=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9,=20=ED=88=B4=EB=B0=94=20=ED=95=98=EB=8B=A8?= =?UTF-8?q?=20divider=20=EC=B6=94=EA=B0=80=20https://github.com/POLZZAK/PO?= =?UTF-8?q?LZZAK-Android/issues/98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/myPage/notice/MyNoticeFragment.kt | 4 ++-- app/src/main/res/layout/fragment_my_notice.xml | 9 +++++++++ app/src/main/res/layout/item_my_notice.xml | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeFragment.kt b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeFragment.kt index 02646e6d..326d93a2 100644 --- a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeFragment.kt +++ b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/notice/MyNoticeFragment.kt @@ -50,7 +50,7 @@ class MyNoticeFragment : BaseFragment(), MyNoticeClickL with(binding.rvNotices) { layoutManager = LinearLayoutManager(context) adapter = BindableItemAdapter() - val marginPx = ITEM_MARGIN_DP.toPx(context) + val marginPx = NOTICE_ITEM_MARGIN_DP.toPx(context) addItemDecoration(MyNoticeItemDecoration(marginPx = marginPx)) addOnScrollListener(object : RecyclerView.OnScrollListener() { override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { @@ -94,7 +94,7 @@ class MyNoticeFragment : BaseFragment(), MyNoticeClickL } companion object { - private const val ITEM_MARGIN_DP = 16 + private const val NOTICE_ITEM_MARGIN_DP = 8 } } \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_my_notice.xml b/app/src/main/res/layout/fragment_my_notice.xml index 294326bd..4c5bab7c 100644 --- a/app/src/main/res/layout/fragment_my_notice.xml +++ b/app/src/main/res/layout/fragment_my_notice.xml @@ -14,6 +14,15 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> + + Date: Mon, 4 Sep 2023 22:06:35 +0900 Subject: [PATCH 06/10] =?UTF-8?q?[FEAT]=20=EA=B3=84=EC=A0=95=EA=B4=80?= =?UTF-8?q?=EB=A6=AC=20>=20=EB=A1=9C=EA=B7=B8=EC=95=84=EC=9B=83=20https://?= =?UTF-8?q?github.com/POLZZAK/POLZZAK-Android/issues/98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyAccountManagementFragment.kt | 76 +++++++++++++++++++ .../feature/myPage/kid/KidMyPageFragment.kt | 2 +- .../protector/ProtectorMyPageFragment.kt | 2 +- .../feature/root/MainViewModel.kt | 4 + .../feature/root/host/KidHostFragment.kt | 8 +- .../root/host/ProtectorHostFragment.kt | 7 +- .../root/host/RootNavigationController.kt | 5 ++ .../layout/fragment_my_account_management.xml | 54 +++++++++++++ app/src/main/res/navigation/kid_nav_graph.xml | 10 +++ .../res/navigation/protector_nav_graph.xml | 12 ++- .../main/res/navigation/root_nav_graph.xml | 7 -- app/src/main/res/values/strings.xml | 8 +- 12 files changed, 182 insertions(+), 13 deletions(-) create mode 100644 app/src/main/java/com/polzzak_android/presentation/feature/myPage/accountmanagement/MyAccountManagementFragment.kt create mode 100644 app/src/main/java/com/polzzak_android/presentation/feature/root/host/RootNavigationController.kt create mode 100644 app/src/main/res/layout/fragment_my_account_management.xml diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/accountmanagement/MyAccountManagementFragment.kt b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/accountmanagement/MyAccountManagementFragment.kt new file mode 100644 index 00000000..ff02a245 --- /dev/null +++ b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/accountmanagement/MyAccountManagementFragment.kt @@ -0,0 +1,76 @@ +package com.polzzak_android.presentation.feature.myPage.accountmanagement + +import androidx.fragment.app.activityViewModels +import androidx.navigation.fragment.findNavController +import com.polzzak_android.R +import com.polzzak_android.databinding.FragmentMyAccountManagementBinding +import com.polzzak_android.presentation.common.base.BaseFragment +import com.polzzak_android.presentation.common.model.ButtonCount +import com.polzzak_android.presentation.common.model.CommonButtonModel +import com.polzzak_android.presentation.component.dialog.CommonDialogContent +import com.polzzak_android.presentation.component.dialog.CommonDialogHelper +import com.polzzak_android.presentation.component.dialog.CommonDialogModel +import com.polzzak_android.presentation.component.dialog.DialogStyleType +import com.polzzak_android.presentation.component.dialog.OnButtonClickListener +import com.polzzak_android.presentation.component.toolbar.ToolbarData +import com.polzzak_android.presentation.component.toolbar.ToolbarHelper +import com.polzzak_android.presentation.feature.root.MainViewModel +import com.polzzak_android.presentation.feature.root.host.RootNavigationController + +class MyAccountManagementFragment : BaseFragment() { + override val layoutResId: Int = R.layout.fragment_my_account_management + + private val mainViewModel by activityViewModels() + + override fun initView() { + super.initView() + initToolbar() + binding.tvBtnLogout.setOnClickListener { + CommonDialogHelper.getInstance( + content = CommonDialogModel( + type = DialogStyleType.ALERT, + content = CommonDialogContent(title = getString(R.string.my_account_management_logout_dialog_title)), + button = CommonButtonModel( + buttonCount = ButtonCount.TWO, + positiveButtonText = getString(R.string.my_account_management_logout_dialog_btn_positive) + ) + ), + onConfirmListener = { + object : OnButtonClickListener { + override fun setBusinessLogic() { + findRootNavigationController()?.let { + mainViewModel.logout() + it.backToTheLoginFragment() + } + } + + override fun getReturnValue(value: Any) { + //do nothing + } + } + } + ).show(childFragmentManager, null) + } + binding.tvBtnDeleteAccount.setOnClickListener { + + } + } + + private fun initToolbar() { + ToolbarHelper( + data = ToolbarData( + popStack = findNavController(), + titleText = getString(R.string.my_account_management) + ), toolbar = binding.inToolbar + ).set() + } + + private fun findRootNavigationController(): RootNavigationController? { + var parentFragment = parentFragment + while (parentFragment != null) { + if (parentFragment is RootNavigationController) return parentFragment + parentFragment = parentFragment.parentFragment + } + return null + } +} \ No newline at end of file diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/kid/KidMyPageFragment.kt b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/kid/KidMyPageFragment.kt index d75c93ec..7739435f 100644 --- a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/kid/KidMyPageFragment.kt +++ b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/kid/KidMyPageFragment.kt @@ -78,7 +78,7 @@ class KidMyPageFragment : BaseFragment(), ToolbarIconI } fun onClickManageAccount() { - // todo: 계정관리 클릭 + findNavController().navigate(R.id.action_kidMyPageFragment_to_myAccountManagementFragment) } fun onClickUsingTerms() { diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/protector/ProtectorMyPageFragment.kt b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/protector/ProtectorMyPageFragment.kt index ed2e7105..73d140cc 100644 --- a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/protector/ProtectorMyPageFragment.kt +++ b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/protector/ProtectorMyPageFragment.kt @@ -80,7 +80,7 @@ class ProtectorMyPageFragment : BaseFragment(), } fun onClickManageAccount() { - // todo: 계정관리 클릭 + findNavController().navigate(R.id.action_protectorMyPageFragment_to_myAccountManagementFragment) } fun onClickUsingTerms() { diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/root/MainViewModel.kt b/app/src/main/java/com/polzzak_android/presentation/feature/root/MainViewModel.kt index bc4221c8..65a936cb 100644 --- a/app/src/main/java/com/polzzak_android/presentation/feature/root/MainViewModel.kt +++ b/app/src/main/java/com/polzzak_android/presentation/feature/root/MainViewModel.kt @@ -4,4 +4,8 @@ import androidx.lifecycle.ViewModel class MainViewModel : ViewModel() { var accessToken: String? = null + + fun logout() { + accessToken = null + } } \ No newline at end of file diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/root/host/KidHostFragment.kt b/app/src/main/java/com/polzzak_android/presentation/feature/root/host/KidHostFragment.kt index 213705ef..9974fdf5 100644 --- a/app/src/main/java/com/polzzak_android/presentation/feature/root/host/KidHostFragment.kt +++ b/app/src/main/java/com/polzzak_android/presentation/feature/root/host/KidHostFragment.kt @@ -4,6 +4,7 @@ import androidx.activity.OnBackPressedCallback import androidx.navigation.NavController import androidx.navigation.NavGraph.Companion.findStartDestination import androidx.navigation.fragment.NavHostFragment +import androidx.navigation.fragment.findNavController import androidx.navigation.ui.NavigationUI import com.polzzak_android.R import com.polzzak_android.presentation.common.base.BaseFragment @@ -11,7 +12,7 @@ import com.polzzak_android.databinding.FragmentKidHostBinding import dagger.hilt.android.AndroidEntryPoint @AndroidEntryPoint -class KidHostFragment : BaseFragment() { +class KidHostFragment : BaseFragment(), RootNavigationController { override val layoutResId = R.layout.fragment_kid_host private lateinit var navController: NavController @@ -39,10 +40,15 @@ class KidHostFragment : BaseFragment() { destination.parent?.findStartDestination()?.id -> { backPressedCallback.isEnabled = false } + else -> { backPressedCallback.isEnabled = true } } } } + + override fun backToTheLoginFragment() { + findNavController().popBackStack(R.id.loginFragment, false) + } } \ No newline at end of file diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/root/host/ProtectorHostFragment.kt b/app/src/main/java/com/polzzak_android/presentation/feature/root/host/ProtectorHostFragment.kt index 37e8d812..2a82cb4a 100644 --- a/app/src/main/java/com/polzzak_android/presentation/feature/root/host/ProtectorHostFragment.kt +++ b/app/src/main/java/com/polzzak_android/presentation/feature/root/host/ProtectorHostFragment.kt @@ -3,12 +3,14 @@ package com.polzzak_android.presentation.feature.root.host import androidx.activity.OnBackPressedCallback import androidx.navigation.NavController import androidx.navigation.fragment.NavHostFragment +import androidx.navigation.fragment.findNavController import androidx.navigation.ui.setupWithNavController import com.polzzak_android.R import com.polzzak_android.databinding.FragmentProtectorHostBinding import com.polzzak_android.presentation.common.base.BaseFragment -class ProtectorHostFragment() : BaseFragment() { +class ProtectorHostFragment() : BaseFragment(), + RootNavigationController { override val layoutResId = R.layout.fragment_protector_host private lateinit var protectorNavController: NavController @@ -34,4 +36,7 @@ class ProtectorHostFragment() : BaseFragment() { } } + override fun backToTheLoginFragment() { + findNavController().popBackStack(R.id.loginFragment, true) + } } \ No newline at end of file diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/root/host/RootNavigationController.kt b/app/src/main/java/com/polzzak_android/presentation/feature/root/host/RootNavigationController.kt new file mode 100644 index 00000000..d9361188 --- /dev/null +++ b/app/src/main/java/com/polzzak_android/presentation/feature/root/host/RootNavigationController.kt @@ -0,0 +1,5 @@ +package com.polzzak_android.presentation.feature.root.host + +interface RootNavigationController { + fun backToTheLoginFragment() +} \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_my_account_management.xml b/app/src/main/res/layout/fragment_my_account_management.xml new file mode 100644 index 00000000..8453fd1a --- /dev/null +++ b/app/src/main/res/layout/fragment_my_account_management.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/navigation/kid_nav_graph.xml b/app/src/main/res/navigation/kid_nav_graph.xml index b86ef92e..a14e7dc1 100644 --- a/app/src/main/res/navigation/kid_nav_graph.xml +++ b/app/src/main/res/navigation/kid_nav_graph.xml @@ -68,6 +68,10 @@ + + + + + diff --git a/app/src/main/res/navigation/protector_nav_graph.xml b/app/src/main/res/navigation/protector_nav_graph.xml index 4c2d88b4..e0d32cb9 100644 --- a/app/src/main/res/navigation/protector_nav_graph.xml +++ b/app/src/main/res/navigation/protector_nav_graph.xml @@ -80,6 +80,10 @@ + + + tools:layout="@layout/fragment_my_notice_detail" /> + + \ No newline at end of file diff --git a/app/src/main/res/navigation/root_nav_graph.xml b/app/src/main/res/navigation/root_nav_graph.xml index 45838340..7851e912 100644 --- a/app/src/main/res/navigation/root_nav_graph.xml +++ b/app/src/main/res/navigation/root_nav_graph.xml @@ -5,8 +5,6 @@ android:id="@+id/root_nav_graph" app:startDestination="@id/splashFragment"> - - - - - 선물 전달 확인 알림 선물 전달이 완료되었는지 확인하는 알림을 받을래요 - + 업데이트된 소식이 없어요 + 계정관리 + 로그아웃 + 회원탈퇴 + 정말로 로그아웃 하시겠어요? + 로그아웃 할래요 + \ No newline at end of file From 5b8052556e3d08fbe003dacf98b5e15f1dc73735 Mon Sep 17 00:00:00 2001 From: kim0hoon Date: Mon, 4 Sep 2023 23:03:36 +0900 Subject: [PATCH 07/10] =?UTF-8?q?[FEAT]=20protector=20=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=95=84=EC=9B=83=20stack=20inclusive=20=EC=88=98=EC=A0=95=20h?= =?UTF-8?q?ttps://github.com/POLZZAK/POLZZAK-Android/issues/98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/feature/root/host/ProtectorHostFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/root/host/ProtectorHostFragment.kt b/app/src/main/java/com/polzzak_android/presentation/feature/root/host/ProtectorHostFragment.kt index 2a82cb4a..de4be074 100644 --- a/app/src/main/java/com/polzzak_android/presentation/feature/root/host/ProtectorHostFragment.kt +++ b/app/src/main/java/com/polzzak_android/presentation/feature/root/host/ProtectorHostFragment.kt @@ -37,6 +37,6 @@ class ProtectorHostFragment() : BaseFragment(), } override fun backToTheLoginFragment() { - findNavController().popBackStack(R.id.loginFragment, true) + findNavController().popBackStack(R.id.loginFragment, false) } } \ No newline at end of file From fc84e3c0172d8746a2215cc54fb7989e0f4d4611 Mon Sep 17 00:00:00 2001 From: kim0hoon Date: Wed, 6 Sep 2023 22:13:34 +0900 Subject: [PATCH 08/10] =?UTF-8?q?[FEAT]=20=ED=9A=8C=EC=9B=90=ED=83=88?= =?UTF-8?q?=ED=87=B4=20https://github.com/POLZZAK/POLZZAK-Android/issues/9?= =?UTF-8?q?8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyAccountDeleteFragment.kt | 155 ++++++++++++++++++ .../MyAccountDeleteViewModel.kt | 60 +++++++ .../MyAccountManagementFragment.kt | 26 +-- .../base/BaseMyAccountFragment.kt | 16 ++ .../model/MyAccountDeleteMenuModel.kt | 11 ++ .../feature/myPage/kid/KidMyPageFragment.kt | 11 +- .../protector/ProtectorMyPageFragment.kt | 11 +- .../feature/root/host/KidHostFragment.kt | 2 +- .../root/host/ProtectorHostFragment.kt | 2 +- ...onController.kt => RootNavigationOwner.kt} | 2 +- ..._of_service_checked.xml => ic_checked.xml} | 0 ...service_unchecked.xml => ic_unchecked.xml} | 0 .../res/drawable/selector_menu_checked.xml | 5 + ..._rectangle_r8_enabled_primary_gray_300.xml | 15 ++ ...selector_signup_terms_of_service_check.xml | 5 - .../res/layout/fragment_my_account_delete.xml | 130 +++++++++++++++ ...item_my_account_management_delete_menu.xml | 33 ++++ .../layout/layout_signup_terms_of_service.xml | 12 +- app/src/main/res/navigation/kid_nav_graph.xml | 8 + .../res/navigation/protector_nav_graph.xml | 11 +- app/src/main/res/values/strings.xml | 11 ++ 21 files changed, 497 insertions(+), 29 deletions(-) create mode 100644 app/src/main/java/com/polzzak_android/presentation/feature/myPage/accountmanagement/MyAccountDeleteFragment.kt create mode 100644 app/src/main/java/com/polzzak_android/presentation/feature/myPage/accountmanagement/MyAccountDeleteViewModel.kt create mode 100644 app/src/main/java/com/polzzak_android/presentation/feature/myPage/accountmanagement/base/BaseMyAccountFragment.kt create mode 100644 app/src/main/java/com/polzzak_android/presentation/feature/myPage/accountmanagement/model/MyAccountDeleteMenuModel.kt rename app/src/main/java/com/polzzak_android/presentation/feature/root/host/{RootNavigationController.kt => RootNavigationOwner.kt} (71%) rename app/src/main/res/drawable/{ic_signup_terms_of_service_checked.xml => ic_checked.xml} (100%) rename app/src/main/res/drawable/{ic_signup_terms_of_service_unchecked.xml => ic_unchecked.xml} (100%) create mode 100644 app/src/main/res/drawable/selector_menu_checked.xml create mode 100644 app/src/main/res/drawable/selector_rectangle_r8_enabled_primary_gray_300.xml delete mode 100644 app/src/main/res/drawable/selector_signup_terms_of_service_check.xml create mode 100644 app/src/main/res/layout/fragment_my_account_delete.xml create mode 100644 app/src/main/res/layout/item_my_account_management_delete_menu.xml diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/accountmanagement/MyAccountDeleteFragment.kt b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/accountmanagement/MyAccountDeleteFragment.kt new file mode 100644 index 00000000..196315c0 --- /dev/null +++ b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/accountmanagement/MyAccountDeleteFragment.kt @@ -0,0 +1,155 @@ +package com.polzzak_android.presentation.feature.myPage.accountmanagement + +import androidx.fragment.app.DialogFragment +import androidx.fragment.app.viewModels +import androidx.navigation.fragment.findNavController +import com.polzzak_android.R +import com.polzzak_android.databinding.FragmentMyAccountDeleteBinding +import com.polzzak_android.presentation.common.model.ButtonCount +import com.polzzak_android.presentation.common.model.CommonButtonModel +import com.polzzak_android.presentation.common.model.ModelState +import com.polzzak_android.presentation.component.dialog.CommonDialogContent +import com.polzzak_android.presentation.component.dialog.CommonDialogHelper +import com.polzzak_android.presentation.component.dialog.CommonDialogModel +import com.polzzak_android.presentation.component.dialog.DialogStyleType +import com.polzzak_android.presentation.component.dialog.OnButtonClickListener +import com.polzzak_android.presentation.component.toolbar.ToolbarData +import com.polzzak_android.presentation.component.toolbar.ToolbarHelper +import com.polzzak_android.presentation.feature.myPage.accountmanagement.MyAccountManagementFragment.Companion.ARGUMENT_NICKNAME_KEY +import com.polzzak_android.presentation.feature.myPage.accountmanagement.base.BaseMyAccountFragment +import timber.log.Timber + +class MyAccountDeleteFragment : BaseMyAccountFragment() { + override val layoutResId: Int = R.layout.fragment_my_account_delete + + private val myAccountDeleteViewModel by viewModels() + + private var currentDialog: DialogFragment? = null + + override fun initView() { + super.initView() + initToolbar() + with(binding) { + val nickName = arguments?.getString(ARGUMENT_NICKNAME_KEY) ?: "" + tvTitle.text = getString(R.string.my_account_management_delete_title, nickName) + with(inMenuDeleteLink) { + tvContent.text = + getText(R.string.my_account_management_delete_menu_delete_link) + root.setOnClickListener { + myAccountDeleteViewModel.toggleDeleteLink() + } + } + with(inMenuDeletePoint) { + tvContent.text = + getText(R.string.my_account_management_delete_menu_delete_point) + root.setOnClickListener { + myAccountDeleteViewModel.toggleDeletePoint() + } + } + with(inMenuDeleteSocialAccountData) { + tvContent.text = + getText(R.string.my_account_management_delete_menu_delete_social_account_data) + root.setOnClickListener { + myAccountDeleteViewModel.toggleDeleteSocialAccountData() + } + } + with(inMenuDeleteStampAndCoupon) { + tvContent.text = + getText(R.string.my_account_management_delete_menu_delete_stamp_and_coupon) + root.setOnClickListener { + myAccountDeleteViewModel.toggleDeleteStampAndCoupon() + } + } + tvBtnDeleteAccount.setOnClickListener { + val dialog = CommonDialogHelper.getInstance( + content = CommonDialogModel( + type = DialogStyleType.ALERT, + content = CommonDialogContent(title = getString(R.string.my_account_management_delete_dialog_title)), + button = CommonButtonModel( + buttonCount = ButtonCount.TWO, + positiveButtonText = getString(R.string.my_account_management_delete_dialog_btn_positive), + negativeButtonText = getString(R.string.my_account_management_delete_dialog_btn_negative) + ) + ), + onConfirmListener = { + object : OnButtonClickListener { + override fun setBusinessLogic() { + myAccountDeleteViewModel.deleteAccount() + } + + override fun getReturnValue(value: Any) { + //do nothing + } + } + } + ) + showDialog(dialogFragment = dialog) + } + } + } + + private fun initToolbar() { + ToolbarHelper( + data = ToolbarData( + popStack = findNavController(), + titleText = getString(R.string.my_account_management) + ), + toolbar = binding.inToolbar + ).set() + } + + override fun initObserver() { + super.initObserver() + myAccountDeleteViewModel.myAccountMenuLiveData.observe(viewLifecycleOwner) { + with(binding) { + inMenuDeleteLink.ivBtnCheck.isSelected = it.isCheckedDeleteLink + inMenuDeletePoint.ivBtnCheck.isSelected = it.isCheckedDeletePoint + inMenuDeleteSocialAccountData.ivBtnCheck.isSelected = + it.isCheckedDeleteSocialAccountData + inMenuDeleteStampAndCoupon.ivBtnCheck.isSelected = it.isCheckedDeleteStampAndCoupon + tvBtnDeleteAccount.isEnabled = it.isAllChecked() + } + } + + myAccountDeleteViewModel.deleteAccountLiveData.observe(viewLifecycleOwner) { + when (it) { + is ModelState.Loading -> { + val loadingDialog = CommonDialogHelper.getInstance( + content = CommonDialogModel( + type = DialogStyleType.LOADING, + content = CommonDialogContent(title = getString(R.string.my_account_management_delete_dialog_title)), + button = CommonButtonModel(ButtonCount.ZERO) + ) + ) + showDialog(dialogFragment = loadingDialog) + } + + is ModelState.Success -> { + dismissCurrentDialog() + Timber.d("회원탈퇴") + findRootNavigationOwner()?.backToTheLoginFragment() + } + + is ModelState.Error -> { + //TODO error handling + } + } + } + } + + private fun showDialog(dialogFragment: DialogFragment) { + currentDialog?.dismiss() + currentDialog = dialogFragment + dialogFragment.show(childFragmentManager, null) + } + + private fun dismissCurrentDialog() { + currentDialog?.dismiss() + currentDialog = null + } + + override fun onPause() { + super.onPause() + currentDialog?.dismiss() + } +} \ No newline at end of file diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/accountmanagement/MyAccountDeleteViewModel.kt b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/accountmanagement/MyAccountDeleteViewModel.kt new file mode 100644 index 00000000..1854c51d --- /dev/null +++ b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/accountmanagement/MyAccountDeleteViewModel.kt @@ -0,0 +1,60 @@ +package com.polzzak_android.presentation.feature.myPage.accountmanagement + +import androidx.lifecycle.LiveData +import androidx.lifecycle.MutableLiveData +import androidx.lifecycle.ViewModel +import androidx.lifecycle.viewModelScope +import com.polzzak_android.presentation.common.model.ModelState +import com.polzzak_android.presentation.feature.myPage.accountmanagement.model.MyAccountDeleteMenuModel +import kotlinx.coroutines.Job +import kotlinx.coroutines.delay +import kotlinx.coroutines.launch + +class MyAccountDeleteViewModel : ViewModel() { + private val _myAccountMenuLiveData = MutableLiveData() + val myAccountMenuLiveData: LiveData = _myAccountMenuLiveData + + private val _deleteAccountLiveData = MutableLiveData>() + val deleteAccountLiveData: LiveData> = _deleteAccountLiveData + private var deleteAccountJob: Job? = null + + fun toggleDeleteSocialAccountData() { + _myAccountMenuLiveData.value = + (myAccountMenuLiveData.value ?: MyAccountDeleteMenuModel()).run { + copy(isCheckedDeleteSocialAccountData = !isCheckedDeleteSocialAccountData) + } + } + + fun toggleDeleteLink() { + _myAccountMenuLiveData.value = + (myAccountMenuLiveData.value ?: MyAccountDeleteMenuModel()).run { + copy(isCheckedDeleteLink = !isCheckedDeleteLink) + } + } + + fun toggleDeletePoint() { + _myAccountMenuLiveData.value = + (myAccountMenuLiveData.value ?: MyAccountDeleteMenuModel()).run { + copy(isCheckedDeletePoint = !isCheckedDeletePoint) + } + } + + fun toggleDeleteStampAndCoupon() { + _myAccountMenuLiveData.value = + (myAccountMenuLiveData.value ?: MyAccountDeleteMenuModel()).run { + copy(isCheckedDeleteStampAndCoupon = !isCheckedDeleteStampAndCoupon) + } + } + + fun deleteAccount() { + if (deleteAccountJob?.isCompleted == false) return + deleteAccountJob = viewModelScope.launch { + //TODO 회원탈퇴 API 호출 + _deleteAccountLiveData.value = ModelState.Loading() + delay(2000) + //onSuccess + _deleteAccountLiveData.value = ModelState.Success(Unit) + } + + } +} \ No newline at end of file diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/accountmanagement/MyAccountManagementFragment.kt b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/accountmanagement/MyAccountManagementFragment.kt index ff02a245..cfcd3b52 100644 --- a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/accountmanagement/MyAccountManagementFragment.kt +++ b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/accountmanagement/MyAccountManagementFragment.kt @@ -1,10 +1,10 @@ package com.polzzak_android.presentation.feature.myPage.accountmanagement +import android.os.Bundle import androidx.fragment.app.activityViewModels import androidx.navigation.fragment.findNavController import com.polzzak_android.R import com.polzzak_android.databinding.FragmentMyAccountManagementBinding -import com.polzzak_android.presentation.common.base.BaseFragment import com.polzzak_android.presentation.common.model.ButtonCount import com.polzzak_android.presentation.common.model.CommonButtonModel import com.polzzak_android.presentation.component.dialog.CommonDialogContent @@ -14,10 +14,10 @@ import com.polzzak_android.presentation.component.dialog.DialogStyleType import com.polzzak_android.presentation.component.dialog.OnButtonClickListener import com.polzzak_android.presentation.component.toolbar.ToolbarData import com.polzzak_android.presentation.component.toolbar.ToolbarHelper +import com.polzzak_android.presentation.feature.myPage.accountmanagement.base.BaseMyAccountFragment import com.polzzak_android.presentation.feature.root.MainViewModel -import com.polzzak_android.presentation.feature.root.host.RootNavigationController -class MyAccountManagementFragment : BaseFragment() { +class MyAccountManagementFragment : BaseMyAccountFragment() { override val layoutResId: Int = R.layout.fragment_my_account_management private val mainViewModel by activityViewModels() @@ -38,7 +38,7 @@ class MyAccountManagementFragment : BaseFragment : BaseFragment() { + protected fun findRootNavigationOwner(): RootNavigationOwner? { + var parentFragment = parentFragment + while (parentFragment != null) { + if (parentFragment is RootNavigationOwner) return parentFragment + parentFragment = parentFragment.parentFragment + } + return null + } +} \ No newline at end of file diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/accountmanagement/model/MyAccountDeleteMenuModel.kt b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/accountmanagement/model/MyAccountDeleteMenuModel.kt new file mode 100644 index 00000000..5db35e69 --- /dev/null +++ b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/accountmanagement/model/MyAccountDeleteMenuModel.kt @@ -0,0 +1,11 @@ +package com.polzzak_android.presentation.feature.myPage.accountmanagement.model + +data class MyAccountDeleteMenuModel( + val isCheckedDeleteSocialAccountData: Boolean = false, + val isCheckedDeleteLink: Boolean = false, + val isCheckedDeletePoint: Boolean = false, + val isCheckedDeleteStampAndCoupon: Boolean = false +) { + fun isAllChecked() = + isCheckedDeleteLink && isCheckedDeletePoint && isCheckedDeleteSocialAccountData && isCheckedDeleteStampAndCoupon +} diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/kid/KidMyPageFragment.kt b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/kid/KidMyPageFragment.kt index 7739435f..c69b17c0 100644 --- a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/kid/KidMyPageFragment.kt +++ b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/kid/KidMyPageFragment.kt @@ -1,5 +1,6 @@ package com.polzzak_android.presentation.feature.myPage.kid +import android.os.Bundle import androidx.navigation.fragment.findNavController import com.polzzak_android.R import com.polzzak_android.presentation.common.base.BaseFragment @@ -7,6 +8,7 @@ import com.polzzak_android.databinding.FragmentKidMyPageBinding import com.polzzak_android.presentation.component.toolbar.ToolbarData import com.polzzak_android.presentation.component.toolbar.ToolbarHelper import com.polzzak_android.presentation.component.toolbar.ToolbarIconInteraction +import com.polzzak_android.presentation.feature.myPage.accountmanagement.MyAccountManagementFragment.Companion.ARGUMENT_NICKNAME_KEY class KidMyPageFragment : BaseFragment(), ToolbarIconInteraction { override val layoutResId: Int = R.layout.fragment_kid_my_page @@ -78,7 +80,14 @@ class KidMyPageFragment : BaseFragment(), ToolbarIconI } fun onClickManageAccount() { - findNavController().navigate(R.id.action_kidMyPageFragment_to_myAccountManagementFragment) + //TODO 닉네임 추가 + val bundle = Bundle().apply { + putString(ARGUMENT_NICKNAME_KEY, "nickname") + } + findNavController().navigate( + R.id.action_kidMyPageFragment_to_myAccountManagementFragment, + bundle + ) } fun onClickUsingTerms() { diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/protector/ProtectorMyPageFragment.kt b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/protector/ProtectorMyPageFragment.kt index 73d140cc..b5da664e 100644 --- a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/protector/ProtectorMyPageFragment.kt +++ b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/protector/ProtectorMyPageFragment.kt @@ -1,5 +1,6 @@ package com.polzzak_android.presentation.feature.myPage.protector +import android.os.Bundle import androidx.navigation.fragment.findNavController import com.polzzak_android.R import com.polzzak_android.databinding.FragmentProtectorMyPageBinding @@ -7,6 +8,7 @@ import com.polzzak_android.presentation.common.base.BaseFragment import com.polzzak_android.presentation.component.toolbar.ToolbarData import com.polzzak_android.presentation.component.toolbar.ToolbarHelper import com.polzzak_android.presentation.component.toolbar.ToolbarIconInteraction +import com.polzzak_android.presentation.feature.myPage.accountmanagement.MyAccountManagementFragment class ProtectorMyPageFragment : BaseFragment(), ToolbarIconInteraction { @@ -80,7 +82,14 @@ class ProtectorMyPageFragment : BaseFragment(), } fun onClickManageAccount() { - findNavController().navigate(R.id.action_protectorMyPageFragment_to_myAccountManagementFragment) + //TODO 닉네임 추가 + val bundle = Bundle().apply { + putString(MyAccountManagementFragment.ARGUMENT_NICKNAME_KEY, "nickname") + } + findNavController().navigate( + R.id.action_protectorMyPageFragment_to_myAccountManagementFragment, + bundle + ) } fun onClickUsingTerms() { diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/root/host/KidHostFragment.kt b/app/src/main/java/com/polzzak_android/presentation/feature/root/host/KidHostFragment.kt index 9974fdf5..e7a6d425 100644 --- a/app/src/main/java/com/polzzak_android/presentation/feature/root/host/KidHostFragment.kt +++ b/app/src/main/java/com/polzzak_android/presentation/feature/root/host/KidHostFragment.kt @@ -12,7 +12,7 @@ import com.polzzak_android.databinding.FragmentKidHostBinding import dagger.hilt.android.AndroidEntryPoint @AndroidEntryPoint -class KidHostFragment : BaseFragment(), RootNavigationController { +class KidHostFragment : BaseFragment(), RootNavigationOwner { override val layoutResId = R.layout.fragment_kid_host private lateinit var navController: NavController diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/root/host/ProtectorHostFragment.kt b/app/src/main/java/com/polzzak_android/presentation/feature/root/host/ProtectorHostFragment.kt index de4be074..d01beb5a 100644 --- a/app/src/main/java/com/polzzak_android/presentation/feature/root/host/ProtectorHostFragment.kt +++ b/app/src/main/java/com/polzzak_android/presentation/feature/root/host/ProtectorHostFragment.kt @@ -10,7 +10,7 @@ import com.polzzak_android.databinding.FragmentProtectorHostBinding import com.polzzak_android.presentation.common.base.BaseFragment class ProtectorHostFragment() : BaseFragment(), - RootNavigationController { + RootNavigationOwner { override val layoutResId = R.layout.fragment_protector_host private lateinit var protectorNavController: NavController diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/root/host/RootNavigationController.kt b/app/src/main/java/com/polzzak_android/presentation/feature/root/host/RootNavigationOwner.kt similarity index 71% rename from app/src/main/java/com/polzzak_android/presentation/feature/root/host/RootNavigationController.kt rename to app/src/main/java/com/polzzak_android/presentation/feature/root/host/RootNavigationOwner.kt index d9361188..03a853e4 100644 --- a/app/src/main/java/com/polzzak_android/presentation/feature/root/host/RootNavigationController.kt +++ b/app/src/main/java/com/polzzak_android/presentation/feature/root/host/RootNavigationOwner.kt @@ -1,5 +1,5 @@ package com.polzzak_android.presentation.feature.root.host -interface RootNavigationController { +interface RootNavigationOwner { fun backToTheLoginFragment() } \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_signup_terms_of_service_checked.xml b/app/src/main/res/drawable/ic_checked.xml similarity index 100% rename from app/src/main/res/drawable/ic_signup_terms_of_service_checked.xml rename to app/src/main/res/drawable/ic_checked.xml diff --git a/app/src/main/res/drawable/ic_signup_terms_of_service_unchecked.xml b/app/src/main/res/drawable/ic_unchecked.xml similarity index 100% rename from app/src/main/res/drawable/ic_signup_terms_of_service_unchecked.xml rename to app/src/main/res/drawable/ic_unchecked.xml diff --git a/app/src/main/res/drawable/selector_menu_checked.xml b/app/src/main/res/drawable/selector_menu_checked.xml new file mode 100644 index 00000000..a8e3d659 --- /dev/null +++ b/app/src/main/res/drawable/selector_menu_checked.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/selector_rectangle_r8_enabled_primary_gray_300.xml b/app/src/main/res/drawable/selector_rectangle_r8_enabled_primary_gray_300.xml new file mode 100644 index 00000000..ac4a47fa --- /dev/null +++ b/app/src/main/res/drawable/selector_rectangle_r8_enabled_primary_gray_300.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/selector_signup_terms_of_service_check.xml b/app/src/main/res/drawable/selector_signup_terms_of_service_check.xml deleted file mode 100644 index 7e81f529..00000000 --- a/app/src/main/res/drawable/selector_signup_terms_of_service_check.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_my_account_delete.xml b/app/src/main/res/layout/fragment_my_account_delete.xml new file mode 100644 index 00000000..30434b5f --- /dev/null +++ b/app/src/main/res/layout/fragment_my_account_delete.xml @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_my_account_management_delete_menu.xml b/app/src/main/res/layout/item_my_account_management_delete_menu.xml new file mode 100644 index 00000000..9ef73f11 --- /dev/null +++ b/app/src/main/res/layout/item_my_account_management_delete_menu.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/layout_signup_terms_of_service.xml b/app/src/main/res/layout/layout_signup_terms_of_service.xml index aa6c0487..3d497c00 100644 --- a/app/src/main/res/layout/layout_signup_terms_of_service.xml +++ b/app/src/main/res/layout/layout_signup_terms_of_service.xml @@ -41,13 +41,13 @@ android:drawablePadding="8dp" android:text="@string/signup_terms_of_service_agree_all" android:textColor="@color/selector_signup_terms_of_service_checklist" - app:drawableStartCompat="@drawable/selector_signup_terms_of_service_check" + app:drawableStartCompat="@drawable/selector_menu_checked" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" - tools:drawableStart="@drawable/selector_signup_terms_of_service_check" /> + tools:drawableStart="@drawable/selector_menu_checked" /> + tools:drawableStart="@drawable/selector_menu_checked" /> + tools:drawableStart="@drawable/selector_menu_checked" /> + + + diff --git a/app/src/main/res/navigation/protector_nav_graph.xml b/app/src/main/res/navigation/protector_nav_graph.xml index e0d32cb9..25e2c38b 100644 --- a/app/src/main/res/navigation/protector_nav_graph.xml +++ b/app/src/main/res/navigation/protector_nav_graph.xml @@ -94,7 +94,7 @@ + app:destination="@id/myNoticeDetailFragment" /> + + + \ 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 546c7dde..e60a1541 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -170,5 +170,16 @@ 회원탈퇴 정말로 로그아웃 하시겠어요? 로그아웃 할래요 + %s 회원님\n폴짝을 떠나시나요? + 다음 안내사항을 확인하고 동의해주세요 + 가입한 소셜 계정 정보가 삭제돼요. + 연동 목록이 모두 삭제돼요. + 도장판과 쿠폰들이 모두 사라져요. + 열심히 모은 포인트가 모두 사라져요. + 탈퇴하기 + 정말로 탈퇴하시겠어요? + 아니요 + 네,탈퇴할래요 + \ No newline at end of file From e9131395b51cb10e617515cb9a801ce8e1058301 Mon Sep 17 00:00:00 2001 From: kim0hoon Date: Wed, 6 Sep 2023 23:46:37 +0900 Subject: [PATCH 09/10] =?UTF-8?q?[FEAT]=20=EC=9D=B4=EC=9A=A9=EC=95=BD?= =?UTF-8?q?=EA=B4=80=20https://github.com/POLZZAK/POLZZAK-Android/issues/9?= =?UTF-8?q?8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/auth/signup/SignUpFragment.kt | 26 +++++-------------- .../feature/myPage/kid/KidMyPageFragment.kt | 12 +++++++-- .../protector/ProtectorMyPageFragment.kt | 18 +++++++++++-- .../TermDetailFragment.kt} | 21 +++++++++------ .../feature/term/model/TermType.kt | 13 ++++++++++ ...rm_detail.xml => fragment_term_detail.xml} | 0 app/src/main/res/navigation/kid_nav_graph.xml | 9 +++++++ .../res/navigation/protector_nav_graph.xml | 10 +++++++ .../main/res/navigation/sign_up_nav_graph.xml | 12 ++++----- app/src/main/res/values/strings.xml | 6 ++--- 10 files changed, 86 insertions(+), 41 deletions(-) rename app/src/main/java/com/polzzak_android/presentation/feature/{auth/signup/SignUpTermDetailFragment.kt => term/TermDetailFragment.kt} (61%) create mode 100644 app/src/main/java/com/polzzak_android/presentation/feature/term/model/TermType.kt rename app/src/main/res/layout/{fragment_signup_term_detail.xml => fragment_term_detail.xml} (100%) diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/auth/signup/SignUpFragment.kt b/app/src/main/java/com/polzzak_android/presentation/feature/auth/signup/SignUpFragment.kt index d38784bc..64c3bf15 100644 --- a/app/src/main/java/com/polzzak_android/presentation/feature/auth/signup/SignUpFragment.kt +++ b/app/src/main/java/com/polzzak_android/presentation/feature/auth/signup/SignUpFragment.kt @@ -30,6 +30,8 @@ import com.polzzak_android.presentation.feature.root.MainViewModel import com.polzzak_android.presentation.common.base.BaseFragment import com.polzzak_android.presentation.common.model.ModelState import com.polzzak_android.presentation.common.util.hideKeyboard +import com.polzzak_android.presentation.feature.term.TermDetailFragment +import com.polzzak_android.presentation.feature.term.model.TermType import dagger.hilt.android.AndroidEntryPoint import timber.log.Timber import javax.inject.Inject @@ -233,35 +235,19 @@ class SignUpFragment : BaseFragment() { } ivBtnServiceDetail.setOnClickListener { val detailDataBundle = Bundle().apply { - putString( - SignUpTermDetailFragment.ARGUMENT_TITLE_KEY, - getString(R.string.signup_terms_of_service_detail_service_title) - ) - //TODO 약관 url 추가 - putString( - SignUpTermDetailFragment.ARGUMENT_URL_KEY, - "http://google.co.kr" - ) + putParcelable(TermDetailFragment.ARGUMENT_TYPE_KEY, TermType.SERVICE) } findNavController().navigate( - R.id.action_signUpFragment_to_signUpTermDetailFragment, + R.id.action_signUpFragment_to_termDetailFragment, detailDataBundle ) } ivBtnPrivacyDetail.setOnClickListener { val detailDataBundle = Bundle().apply { - putString( - SignUpTermDetailFragment.ARGUMENT_TITLE_KEY, - getString(R.string.signup_terms_of_service_detail_privacy_title) - ) - //TODO 약관 url 추가 - putString( - SignUpTermDetailFragment.ARGUMENT_URL_KEY, - "http://naver.com" - ) + putParcelable(TermDetailFragment.ARGUMENT_TYPE_KEY, TermType.PRIVACY) } findNavController().navigate( - R.id.action_signUpFragment_to_signUpTermDetailFragment, + R.id.action_signUpFragment_to_termDetailFragment, detailDataBundle ) } diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/kid/KidMyPageFragment.kt b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/kid/KidMyPageFragment.kt index c69b17c0..5a040346 100644 --- a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/kid/KidMyPageFragment.kt +++ b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/kid/KidMyPageFragment.kt @@ -9,6 +9,8 @@ import com.polzzak_android.presentation.component.toolbar.ToolbarData import com.polzzak_android.presentation.component.toolbar.ToolbarHelper import com.polzzak_android.presentation.component.toolbar.ToolbarIconInteraction import com.polzzak_android.presentation.feature.myPage.accountmanagement.MyAccountManagementFragment.Companion.ARGUMENT_NICKNAME_KEY +import com.polzzak_android.presentation.feature.term.TermDetailFragment +import com.polzzak_android.presentation.feature.term.model.TermType class KidMyPageFragment : BaseFragment(), ToolbarIconInteraction { override val layoutResId: Int = R.layout.fragment_kid_my_page @@ -91,11 +93,17 @@ class KidMyPageFragment : BaseFragment(), ToolbarIconI } fun onClickUsingTerms() { - // todo: 이용약관 클릭 + val bundle = Bundle().apply { + putParcelable(TermDetailFragment.ARGUMENT_TYPE_KEY, TermType.SERVICE) + } + findNavController().navigate(R.id.action_kidMyPageFragment_to_termDetailFragment, bundle) } fun onClickPrivacyPolicy() { - // todo: 개인정보처리방침 클릭 + val bundle = Bundle().apply { + putParcelable(TermDetailFragment.ARGUMENT_TYPE_KEY, TermType.PRIVACY) + } + findNavController().navigate(R.id.action_kidMyPageFragment_to_termDetailFragment, bundle) } override fun onToolbarIconClicked() { diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/protector/ProtectorMyPageFragment.kt b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/protector/ProtectorMyPageFragment.kt index b5da664e..4f67ff6e 100644 --- a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/protector/ProtectorMyPageFragment.kt +++ b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/protector/ProtectorMyPageFragment.kt @@ -9,6 +9,8 @@ import com.polzzak_android.presentation.component.toolbar.ToolbarData import com.polzzak_android.presentation.component.toolbar.ToolbarHelper import com.polzzak_android.presentation.component.toolbar.ToolbarIconInteraction import com.polzzak_android.presentation.feature.myPage.accountmanagement.MyAccountManagementFragment +import com.polzzak_android.presentation.feature.term.TermDetailFragment +import com.polzzak_android.presentation.feature.term.model.TermType class ProtectorMyPageFragment : BaseFragment(), ToolbarIconInteraction { @@ -93,11 +95,23 @@ class ProtectorMyPageFragment : BaseFragment(), } fun onClickUsingTerms() { - // todo: 이용약관 클릭 + val bundle = Bundle().apply { + putParcelable(TermDetailFragment.ARGUMENT_TYPE_KEY, TermType.SERVICE) + } + findNavController().navigate( + R.id.action_protectorMyPageFragment_to_termDetailFragment, + bundle + ) } fun onClickPrivacyPolicy() { - // todo: 개인정보처리방침 클릭 + val bundle = Bundle().apply { + putParcelable(TermDetailFragment.ARGUMENT_TYPE_KEY, TermType.PRIVACY) + } + findNavController().navigate( + R.id.action_protectorMyPageFragment_to_termDetailFragment, + bundle + ) } override fun onToolbarIconClicked() { diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/auth/signup/SignUpTermDetailFragment.kt b/app/src/main/java/com/polzzak_android/presentation/feature/term/TermDetailFragment.kt similarity index 61% rename from app/src/main/java/com/polzzak_android/presentation/feature/auth/signup/SignUpTermDetailFragment.kt rename to app/src/main/java/com/polzzak_android/presentation/feature/term/TermDetailFragment.kt index 567cda6b..07635855 100644 --- a/app/src/main/java/com/polzzak_android/presentation/feature/auth/signup/SignUpTermDetailFragment.kt +++ b/app/src/main/java/com/polzzak_android/presentation/feature/term/TermDetailFragment.kt @@ -1,15 +1,21 @@ -package com.polzzak_android.presentation.feature.auth.signup +package com.polzzak_android.presentation.feature.term import android.webkit.WebViewClient import androidx.navigation.fragment.findNavController import com.polzzak_android.R -import com.polzzak_android.databinding.FragmentSignupTermDetailBinding +import com.polzzak_android.databinding.FragmentTermDetailBinding import com.polzzak_android.presentation.common.base.BaseFragment +import com.polzzak_android.presentation.common.util.getParcelableOrNull import com.polzzak_android.presentation.component.toolbar.ToolbarData import com.polzzak_android.presentation.component.toolbar.ToolbarHelper +import com.polzzak_android.presentation.feature.term.model.TermType -class SignUpTermDetailFragment : BaseFragment() { - override val layoutResId: Int = R.layout.fragment_signup_term_detail +class TermDetailFragment : BaseFragment() { + override val layoutResId: Int = R.layout.fragment_term_detail + + private val type by lazy { + arguments?.getParcelableOrNull(ARGUMENT_TYPE_KEY, TermType::class.java) + } override fun initView() { super.initView() @@ -19,7 +25,7 @@ class SignUpTermDetailFragment : BaseFragment() private fun initToolbar() { with(binding.inToolbar) { - val title = arguments?.getString(ARGUMENT_TITLE_KEY) ?: "" + val title = type?.let { getString(it.titleStrRes) } ?: "" val toolbarData = ToolbarData(popStack = findNavController(), titleText = title) ToolbarHelper(data = toolbarData, toolbar = this).run { @@ -31,7 +37,7 @@ class SignUpTermDetailFragment : BaseFragment() private fun initWebView() { with(binding.wbContent) { - val url = arguments?.getString(ARGUMENT_URL_KEY) ?: "" + val url = type?.url ?: "" webViewClient = WebViewClient() settings.loadWithOverviewMode = true settings.useWideViewPort = true @@ -40,7 +46,6 @@ class SignUpTermDetailFragment : BaseFragment() } companion object { - const val ARGUMENT_TITLE_KEY = "argument_title_key" - const val ARGUMENT_URL_KEY = "argument_url_key" + const val ARGUMENT_TYPE_KEY = "argument_type_key" } } \ No newline at end of file diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/term/model/TermType.kt b/app/src/main/java/com/polzzak_android/presentation/feature/term/model/TermType.kt new file mode 100644 index 00000000..901a6fa3 --- /dev/null +++ b/app/src/main/java/com/polzzak_android/presentation/feature/term/model/TermType.kt @@ -0,0 +1,13 @@ +package com.polzzak_android.presentation.feature.term.model + +import android.os.Parcelable +import androidx.annotation.StringRes +import com.polzzak_android.R +import kotlinx.parcelize.Parcelize + +//TODO 웹뷰 주소 +@Parcelize +enum class TermType(@StringRes val titleStrRes: Int, val url: String) : Parcelable { + SERVICE(R.string.terms_of_service_detail_service_title, "http://google.co.kr"), + PRIVACY(R.string.terms_of_service_detail_privacy_title, "http://naver.com"), +} \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_signup_term_detail.xml b/app/src/main/res/layout/fragment_term_detail.xml similarity index 100% rename from app/src/main/res/layout/fragment_signup_term_detail.xml rename to app/src/main/res/layout/fragment_term_detail.xml diff --git a/app/src/main/res/navigation/kid_nav_graph.xml b/app/src/main/res/navigation/kid_nav_graph.xml index 9f66f5f1..e6cb9692 100644 --- a/app/src/main/res/navigation/kid_nav_graph.xml +++ b/app/src/main/res/navigation/kid_nav_graph.xml @@ -72,6 +72,10 @@ + + + + diff --git a/app/src/main/res/navigation/protector_nav_graph.xml b/app/src/main/res/navigation/protector_nav_graph.xml index 25e2c38b..fd80aa01 100644 --- a/app/src/main/res/navigation/protector_nav_graph.xml +++ b/app/src/main/res/navigation/protector_nav_graph.xml @@ -84,6 +84,10 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/navigation/sign_up_nav_graph.xml b/app/src/main/res/navigation/sign_up_nav_graph.xml index b7f85865..9bcc4e90 100644 --- a/app/src/main/res/navigation/sign_up_nav_graph.xml +++ b/app/src/main/res/navigation/sign_up_nav_graph.xml @@ -17,15 +17,15 @@ android:id="@+id/action_signUpFragment_to_protectorOnBoardingFragment" app:destination="@id/protectorOnBoardingFragment" /> + android:id="@+id/action_signUpFragment_to_termDetailFragment" + app:destination="@id/termDetailFragment" /> + android:id="@+id/termDetailFragment" + android:name="com.polzzak_android.presentation.feature.term.TermDetailFragment" + android:label="termDetailFragment" + tools:layout="@layout/fragment_term_detail" /> 모두 동의 서비스 이용약관에 동의합니다. 개인정보처리방침에 동의합니다. - 이용약관 - 개인정보처리방침 폴짝!\n회원이 되신 것을 환영해요 @@ -181,5 +179,7 @@ 아니요 네,탈퇴할래요 - + + 이용약관 + 개인정보처리방침 \ No newline at end of file From b24b4795680afc3e9842dbbe1d8517ae59a06a26 Mon Sep 17 00:00:00 2001 From: kim0hoon Date: Thu, 7 Sep 2023 00:13:30 +0900 Subject: [PATCH 10/10] resolve conflict --- .../common/util/PermissionManager.kt | 6 ++++-- .../MyAccountDeleteFragment.kt | 21 +++++++++++++++++-- .../MyAccountManagementFragment.kt | 11 +++++++++- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/polzzak_android/presentation/common/util/PermissionManager.kt b/app/src/main/java/com/polzzak_android/presentation/common/util/PermissionManager.kt index 0626c9da..5a2436c1 100644 --- a/app/src/main/java/com/polzzak_android/presentation/common/util/PermissionManager.kt +++ b/app/src/main/java/com/polzzak_android/presentation/common/util/PermissionManager.kt @@ -59,11 +59,13 @@ class PermissionManager(private val activity: AppCompatActivity) { permission ) != PackageManager.PERMISSION_GRANTED }) return true - + val dialogTitleSpannable = SpannableBuilder.build(activity) { + span(text = dialogTitle, textColor = R.color.gray_700, style = R.style.subtitle_18_600) + } CommonDialogHelper.getInstance( content = CommonDialogModel( type = DialogStyleType.ALERT, - content = CommonDialogContent(title = dialogTitle), + content = CommonDialogContent(title = dialogTitleSpannable), button = CommonButtonModel( buttonCount = ButtonCount.TWO, negativeButtonText = activity.getString(R.string.permission_manager_dialog_btn_negative_text), diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/accountmanagement/MyAccountDeleteFragment.kt b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/accountmanagement/MyAccountDeleteFragment.kt index 196315c0..6debafac 100644 --- a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/accountmanagement/MyAccountDeleteFragment.kt +++ b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/accountmanagement/MyAccountDeleteFragment.kt @@ -8,6 +8,7 @@ import com.polzzak_android.databinding.FragmentMyAccountDeleteBinding import com.polzzak_android.presentation.common.model.ButtonCount import com.polzzak_android.presentation.common.model.CommonButtonModel import com.polzzak_android.presentation.common.model.ModelState +import com.polzzak_android.presentation.common.util.SpannableBuilder import com.polzzak_android.presentation.component.dialog.CommonDialogContent import com.polzzak_android.presentation.component.dialog.CommonDialogHelper import com.polzzak_android.presentation.component.dialog.CommonDialogModel @@ -61,10 +62,18 @@ class MyAccountDeleteFragment : BaseMyAccountFragment { + val dialogTitleSpannable = SpannableBuilder.build(context) { + span( + text = getString(R.string.my_account_management_delete_dialog_title), + style = R.style.subtitle_18_600, + textColor = R.color.gray_700 + ) + } val loadingDialog = CommonDialogHelper.getInstance( content = CommonDialogModel( type = DialogStyleType.LOADING, - content = CommonDialogContent(title = getString(R.string.my_account_management_delete_dialog_title)), + content = CommonDialogContent(title = dialogTitleSpannable), button = CommonButtonModel(ButtonCount.ZERO) ) ) diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/accountmanagement/MyAccountManagementFragment.kt b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/accountmanagement/MyAccountManagementFragment.kt index cfcd3b52..4608efb3 100644 --- a/app/src/main/java/com/polzzak_android/presentation/feature/myPage/accountmanagement/MyAccountManagementFragment.kt +++ b/app/src/main/java/com/polzzak_android/presentation/feature/myPage/accountmanagement/MyAccountManagementFragment.kt @@ -7,6 +7,7 @@ import com.polzzak_android.R import com.polzzak_android.databinding.FragmentMyAccountManagementBinding import com.polzzak_android.presentation.common.model.ButtonCount import com.polzzak_android.presentation.common.model.CommonButtonModel +import com.polzzak_android.presentation.common.util.SpannableBuilder import com.polzzak_android.presentation.component.dialog.CommonDialogContent import com.polzzak_android.presentation.component.dialog.CommonDialogHelper import com.polzzak_android.presentation.component.dialog.CommonDialogModel @@ -26,10 +27,18 @@ class MyAccountManagementFragment : BaseMyAccountFragment