From 6382940fe1ba7f76fc797fd30b1e297b8b965ea2 Mon Sep 17 00:00:00 2001 From: pmj1459 <76741702+minju1459@users.noreply.github.com> Date: Thu, 6 Jun 2024 21:41:24 +0900 Subject: [PATCH 1/5] =?UTF-8?q?[FEAT]=20=EA=B3=84=EC=A0=95=ED=83=88?= =?UTF-8?q?=ED=87=B4=20=EC=8B=9C=20=EC=B9=9C=EA=B5=AC=EC=B4=88=EB=8C=80=20?= =?UTF-8?q?=ED=8C=9D=EC=97=85=20UI=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../setting/ProfileQuitInviteDialog.kt | 39 ++++++++++ .../res/drawable/img_quit_invite_friend.xml | 42 ++++++++++ .../fragment_profile_quit_invite_friend.xml | 77 +++++++++++++++++++ app/src/main/res/values/strings.xml | 3 + 4 files changed, 161 insertions(+) create mode 100644 app/src/main/java/com/el/yello/presentation/setting/ProfileQuitInviteDialog.kt create mode 100644 app/src/main/res/drawable/img_quit_invite_friend.xml create mode 100644 app/src/main/res/layout/fragment_profile_quit_invite_friend.xml diff --git a/app/src/main/java/com/el/yello/presentation/setting/ProfileQuitInviteDialog.kt b/app/src/main/java/com/el/yello/presentation/setting/ProfileQuitInviteDialog.kt new file mode 100644 index 00000000..13beab45 --- /dev/null +++ b/app/src/main/java/com/el/yello/presentation/setting/ProfileQuitInviteDialog.kt @@ -0,0 +1,39 @@ +package com.el.yello.presentation.setting + +import android.content.res.Resources +import android.os.Bundle +import android.view.View +import android.view.WindowManager +import com.el.yello.R +import com.el.yello.databinding.FragmentProfileQuitInviteFriendBinding +import com.example.ui.base.BindingDialogFragment +import dagger.hilt.android.AndroidEntryPoint + +@AndroidEntryPoint +class ProfileQuitInviteDialog : + BindingDialogFragment(R.layout.fragment_profile_quit_invite_friend) { + + override fun onStart() { + super.onStart() + setDialogBackground() + } + + private fun setDialogBackground() { + val deviceWidth = Resources.getSystem().displayMetrics.widthPixels + val dialogHorizontalMargin = (Resources.getSystem().displayMetrics.density * 16) * 2 + + dialog?.window?.apply { + setLayout( + (deviceWidth - dialogHorizontalMargin * 2).toInt(), + WindowManager.LayoutParams.WRAP_CONTENT, + ) + setBackgroundDrawableResource(R.color.transparent) + } + dialog?.setCanceledOnTouchOutside(false) + dialog?.setCancelable(true) + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + } +} diff --git a/app/src/main/res/drawable/img_quit_invite_friend.xml b/app/src/main/res/drawable/img_quit_invite_friend.xml new file mode 100644 index 00000000..e0c50a96 --- /dev/null +++ b/app/src/main/res/drawable/img_quit_invite_friend.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/fragment_profile_quit_invite_friend.xml b/app/src/main/res/layout/fragment_profile_quit_invite_friend.xml new file mode 100644 index 00000000..72843afd --- /dev/null +++ b/app/src/main/res/layout/fragment_profile_quit_invite_friend.xml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4f734657..2e682638 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -222,6 +222,9 @@ 친구 수 받은 쪽지 친구 끊기 + 친구가 없다면\n친구를 초대할 수도 있어요. + 다음에 할게요 + 오,그런 방법이! 정말 탈퇴하시겠습니까? 아니요 네, 탈퇴합니다 From 769671b7b986a1b5cdf2bb9d118f08f3635e4271 Mon Sep 17 00:00:00 2001 From: pmj1459 <76741702+minju1459@users.noreply.github.com> Date: Fri, 7 Jun 2024 02:54:20 +0900 Subject: [PATCH 2/5] =?UTF-8?q?[FEAT]=20=EC=B9=9C=EA=B5=AC=EC=B4=88?= =?UTF-8?q?=EB=8C=80=20=ED=8C=9D=EC=97=85=20->=20=EC=B6=94=EC=B2=9C?= =?UTF-8?q?=EC=B9=9C=EA=B5=AC=EB=B7=B0=20=EC=9D=B4=EB=8F=99=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yello/presentation/main/MainActivity.kt | 14 +++++++++++ .../yello/presentation/main/MainViewModel.kt | 2 ++ .../main/dialog/invite/InviteFriendDialog.kt | 2 +- .../setting/ProfileQuitInviteDialog.kt | 25 +++++++++++++++++-- .../setting/ProfileQuitReasonActivity.kt | 8 +++--- .../fragment_profile_quit_invite_friend.xml | 11 ++++---- 6 files changed, 49 insertions(+), 13 deletions(-) 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 6f50227c..2d90de35 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 @@ -15,6 +15,7 @@ import com.el.yello.R import com.el.yello.databinding.ActivityMainBinding import com.el.yello.presentation.event.EventActivity import com.el.yello.presentation.main.MainViewModel.Companion.CODE_UNAVAILABLE_EVENT +import com.el.yello.presentation.main.dialog.invite.InviteFriendDialog import com.el.yello.presentation.main.dialog.notice.NoticeDialog import com.el.yello.presentation.main.myyello.MyYelloFragment import com.el.yello.presentation.main.myyello.read.MyYelloReadActivity @@ -76,6 +77,16 @@ class MainActivity : BindingActivity(R.layout.activity_main setupGetNoticeState() setupGetVoteCountState() setupGetEventState() + navigateToRecommendShowDialog() + } + + private fun navigateToRecommendShowDialog() { + if (intent.getBooleanExtra(RECOMMEND_FRAGMENT, false)) { + binding.bnvMain.selectedItemId = R.id.menu_recommend + navigateTo() + val inviteFriendDialog = InviteFriendDialog.newInstance(viewModel.getYelloId(), "Previous Screen") + inviteFriendDialog.show(supportFragmentManager, INVITE_FRIEND_DIALOG) + } } private fun initBackPressedCallback() { @@ -354,6 +365,9 @@ class MainActivity : BindingActivity(R.layout.activity_main private const val EVENT_CLICK_RECOMMEND_NAVIGATION = "click_recommend_navigation" private const val TAG_NOTICE_DIALOG = "NOTICE_DIALOG" + private const val RECOMMEND_FRAGMENT = "RecommendFragment" + private const val INVITE_FRIEND_DIALOG = "InviteFriendDialog" + @JvmStatic fun getIntent(context: Context, type: String? = null, path: String? = null) = Intent(context, MainActivity::class.java).apply { diff --git a/app/src/main/java/com/el/yello/presentation/main/MainViewModel.kt b/app/src/main/java/com/el/yello/presentation/main/MainViewModel.kt index 4ed0a5f1..fa09520e 100644 --- a/app/src/main/java/com/el/yello/presentation/main/MainViewModel.kt +++ b/app/src/main/java/com/el/yello/presentation/main/MainViewModel.kt @@ -182,6 +182,8 @@ class MainViewModel @Inject constructor( } } + fun getYelloId() = authRepository.getYelloId() + companion object { const val CODE_UNAVAILABLE_EVENT = "100" } diff --git a/app/src/main/java/com/el/yello/presentation/main/dialog/invite/InviteFriendDialog.kt b/app/src/main/java/com/el/yello/presentation/main/dialog/invite/InviteFriendDialog.kt index d680fe0f..85df17a3 100644 --- a/app/src/main/java/com/el/yello/presentation/main/dialog/invite/InviteFriendDialog.kt +++ b/app/src/main/java/com/el/yello/presentation/main/dialog/invite/InviteFriendDialog.kt @@ -14,8 +14,8 @@ import com.el.yello.R import com.el.yello.databinding.FragmentInviteFriendDialogBinding import com.el.yello.util.manager.AmplitudeManager import com.example.ui.base.BindingDialogFragment -import com.example.ui.extension.toast import com.example.ui.extension.setOnSingleClickListener +import com.example.ui.extension.toast import com.kakao.sdk.common.util.KakaoCustomTabsClient import com.kakao.sdk.share.ShareClient import com.kakao.sdk.share.WebSharerClient diff --git a/app/src/main/java/com/el/yello/presentation/setting/ProfileQuitInviteDialog.kt b/app/src/main/java/com/el/yello/presentation/setting/ProfileQuitInviteDialog.kt index 13beab45..ef117e60 100644 --- a/app/src/main/java/com/el/yello/presentation/setting/ProfileQuitInviteDialog.kt +++ b/app/src/main/java/com/el/yello/presentation/setting/ProfileQuitInviteDialog.kt @@ -1,12 +1,15 @@ package com.el.yello.presentation.setting +import android.content.Intent import android.content.res.Resources import android.os.Bundle import android.view.View import android.view.WindowManager import com.el.yello.R import com.el.yello.databinding.FragmentProfileQuitInviteFriendBinding +import com.el.yello.presentation.main.MainActivity import com.example.ui.base.BindingDialogFragment +import com.example.ui.extension.setOnSingleClickListener import dagger.hilt.android.AndroidEntryPoint @AndroidEntryPoint @@ -18,6 +21,23 @@ class ProfileQuitInviteDialog : setDialogBackground() } + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + + binding.btnProfileInviteNo.setOnSingleClickListener { + ProfileQuitDialog().show(parentFragmentManager, QUIT_DIALOG) + dismiss() + } + binding.btnProfileInviteYes.setOnSingleClickListener { + val intent = Intent(requireContext(), MainActivity::class.java).apply { + flags = Intent.FLAG_ACTIVITY_CLEAR_TASK + putExtra(RECOMMEND_FRAGMENT, true) + } + startActivity(intent) + dismiss() + } + } + private fun setDialogBackground() { val deviceWidth = Resources.getSystem().displayMetrics.widthPixels val dialogHorizontalMargin = (Resources.getSystem().displayMetrics.density * 16) * 2 @@ -33,7 +53,8 @@ class ProfileQuitInviteDialog : dialog?.setCancelable(true) } - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) + private companion object { + const val QUIT_DIALOG = "quitDialog" + private const val RECOMMEND_FRAGMENT = "RecommendFragment" } } diff --git a/app/src/main/java/com/el/yello/presentation/setting/ProfileQuitReasonActivity.kt b/app/src/main/java/com/el/yello/presentation/setting/ProfileQuitReasonActivity.kt index 8f5429cb..7be47ab3 100644 --- a/app/src/main/java/com/el/yello/presentation/setting/ProfileQuitReasonActivity.kt +++ b/app/src/main/java/com/el/yello/presentation/setting/ProfileQuitReasonActivity.kt @@ -22,7 +22,7 @@ class ProfileQuitReasonActivity : private var clickedItemPosition: Int = RecyclerView.NO_POSITION private var isItemClicked: Boolean = false - private var profileQuitDialog: ProfileQuitDialog? = null + private var profileQuitInviteDialog: ProfileQuitInviteDialog? = null override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -65,8 +65,8 @@ class ProfileQuitReasonActivity : private fun initInviteDialogBtnListener() { binding.btnProfileQuitReasonDone.setOnSingleClickListener { - profileQuitDialog = ProfileQuitDialog() - profileQuitDialog?.show(supportFragmentManager, QUIT_DIALOG) + profileQuitInviteDialog = ProfileQuitInviteDialog() + profileQuitInviteDialog?.show(supportFragmentManager, QUIT_DIALOG) } } @@ -96,7 +96,7 @@ class ProfileQuitReasonActivity : override fun onDestroy() { super.onDestroy() - profileQuitDialog?.dismiss() + profileQuitInviteDialog?.dismiss() _adapter = null } diff --git a/app/src/main/res/layout/fragment_profile_quit_invite_friend.xml b/app/src/main/res/layout/fragment_profile_quit_invite_friend.xml index 72843afd..24a1a25b 100644 --- a/app/src/main/res/layout/fragment_profile_quit_invite_friend.xml +++ b/app/src/main/res/layout/fragment_profile_quit_invite_friend.xml @@ -38,25 +38,24 @@ app:layout_constraintTop_toBottomOf="@id/tv_profile_invite_dialog_title" /> + app:layout_constraintStart_toEndOf="@id/btn_profile_invite_no" + app:layout_constraintTop_toTopOf="@id/btn_profile_invite_no" /> From b5f7d6830373180fecb14acf6a29b2e4110c28dc Mon Sep 17 00:00:00 2001 From: pmj1459 <76741702+minju1459@users.noreply.github.com> Date: Fri, 7 Jun 2024 03:00:02 +0900 Subject: [PATCH 3/5] =?UTF-8?q?[ADD]=20=ED=83=88=ED=87=B4=20=EB=B0=A9?= =?UTF-8?q?=EC=A7=80=20Amplitude=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../el/yello/presentation/setting/ProfileQuitInviteDialog.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/com/el/yello/presentation/setting/ProfileQuitInviteDialog.kt b/app/src/main/java/com/el/yello/presentation/setting/ProfileQuitInviteDialog.kt index ef117e60..d96f1e2c 100644 --- a/app/src/main/java/com/el/yello/presentation/setting/ProfileQuitInviteDialog.kt +++ b/app/src/main/java/com/el/yello/presentation/setting/ProfileQuitInviteDialog.kt @@ -8,6 +8,7 @@ import android.view.WindowManager import com.el.yello.R import com.el.yello.databinding.FragmentProfileQuitInviteFriendBinding import com.el.yello.presentation.main.MainActivity +import com.el.yello.util.manager.AmplitudeManager import com.example.ui.base.BindingDialogFragment import com.example.ui.extension.setOnSingleClickListener import dagger.hilt.android.AndroidEntryPoint @@ -29,6 +30,7 @@ class ProfileQuitInviteDialog : dismiss() } binding.btnProfileInviteYes.setOnSingleClickListener { + AmplitudeManager.trackEventWithProperties(EVENT_CLICK_WITHDRAWAL_RECOMMEND) val intent = Intent(requireContext(), MainActivity::class.java).apply { flags = Intent.FLAG_ACTIVITY_CLEAR_TASK putExtra(RECOMMEND_FRAGMENT, true) @@ -56,5 +58,6 @@ class ProfileQuitInviteDialog : private companion object { const val QUIT_DIALOG = "quitDialog" private const val RECOMMEND_FRAGMENT = "RecommendFragment" + private const val EVENT_CLICK_WITHDRAWAL_RECOMMEND = "click_withdrawal_recommend" } } From f5ae0ee85e821b90c049003c48debcc8c44d5564 Mon Sep 17 00:00:00 2001 From: pmj1459 <76741702+minju1459@users.noreply.github.com> Date: Fri, 7 Jun 2024 12:14:20 +0900 Subject: [PATCH 4/5] =?UTF-8?q?[MOD]=20InviteFriendDialog=20=EB=A9=94?= =?UTF-8?q?=EB=AA=A8=EB=A6=AC=20=EB=88=84=EC=88=98=20=EB=B0=A9=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/el/yello/presentation/main/MainActivity.kt | 6 ++++++ 1 file changed, 6 insertions(+) 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 2d90de35..265e521e 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 @@ -53,6 +53,7 @@ class MainActivity : BindingActivity(R.layout.activity_main private var backPressedTime: Long = 0 private var userSubsStateJob: Job? = null + private var inviteFriendDialog: InviteFriendDialog? = null private val onBackPressedCallback = object : OnBackPressedCallback(true) { override fun handleOnBackPressed() { @@ -345,6 +346,11 @@ class MainActivity : BindingActivity(R.layout.activity_main } } + override fun onDestroy() { + super.onDestroy() + inviteFriendDialog = null + } + companion object { private const val EXTRA_TYPE = "type" private const val EXTRA_PATH = "path" From a6a850cd4af700ef4bd22abcc60f7e32140c19e4 Mon Sep 17 00:00:00 2001 From: pmj1459 <76741702+minju1459@users.noreply.github.com> Date: Fri, 7 Jun 2024 12:16:09 +0900 Subject: [PATCH 5/5] =?UTF-8?q?[MOD]=20previous=20screen=20=EC=83=81?= =?UTF-8?q?=EC=88=98=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/el/yello/presentation/main/MainActivity.kt | 3 ++- 1 file changed, 2 insertions(+), 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 265e521e..037f5cc4 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 @@ -85,7 +85,7 @@ class MainActivity : BindingActivity(R.layout.activity_main if (intent.getBooleanExtra(RECOMMEND_FRAGMENT, false)) { binding.bnvMain.selectedItemId = R.id.menu_recommend navigateTo() - val inviteFriendDialog = InviteFriendDialog.newInstance(viewModel.getYelloId(), "Previous Screen") + val inviteFriendDialog = InviteFriendDialog.newInstance(viewModel.getYelloId(), PREVIOUS_Screen) inviteFriendDialog.show(supportFragmentManager, INVITE_FRIEND_DIALOG) } } @@ -373,6 +373,7 @@ class MainActivity : BindingActivity(R.layout.activity_main private const val RECOMMEND_FRAGMENT = "RecommendFragment" private const val INVITE_FRIEND_DIALOG = "InviteFriendDialog" + private const val PREVIOUS_Screen = "Previous Screen" @JvmStatic fun getIntent(context: Context, type: String? = null, path: String? = null) =