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 520d6c19..77cdb199 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 @@ -204,6 +204,13 @@ class MainActivity : BindingActivity(R.layout.activity_main } } + fun navigateToVote() { + supportFragmentManager.commit { + replace(R.id.fcv_main) + } + initBnvItemIconTintList() + } + private fun setupGetUserSubsState() { userSubsStateJob = viewModel.getUserSubsState.flowWithLifecycle(lifecycle).onEach { state -> when (state) { diff --git a/app/src/main/java/com/el/yello/presentation/main/dialog/notice/NoticeDialog.kt b/app/src/main/java/com/el/yello/presentation/main/dialog/notice/NoticeDialog.kt index 94a1acb5..5223f4e7 100644 --- a/app/src/main/java/com/el/yello/presentation/main/dialog/notice/NoticeDialog.kt +++ b/app/src/main/java/com/el/yello/presentation/main/dialog/notice/NoticeDialog.kt @@ -91,12 +91,7 @@ class NoticeDialog : } private fun initCloseBtnClickListener() { - binding.tvNoticeClose.setOnSingleClickListener { - if (viewModel.isNoticeDisabled.value) { - AmplitudeManager.trackEventWithProperties(EVENT_CLICK_POP_UP_NO) - } - dismiss() - } + binding.tvNoticeClose.setOnSingleClickListener { dismiss() } } override fun onDestroyView() { @@ -108,7 +103,6 @@ class NoticeDialog : private const val ARGS_IMAGE_URL = "IMAGE_URL" private const val ARGS_REDIRECT_URL = "REDIRECT_URL" private const val EVENT_CLICK_POP_UP = "click_notice_popup" - private const val EVENT_CLICK_POP_UP_NO = "click_notice_popup_no" @JvmStatic fun newInstance( diff --git a/app/src/main/java/com/el/yello/presentation/main/dialog/notice/NoticeViewModel.kt b/app/src/main/java/com/el/yello/presentation/main/dialog/notice/NoticeViewModel.kt index f71f0999..00627813 100644 --- a/app/src/main/java/com/el/yello/presentation/main/dialog/notice/NoticeViewModel.kt +++ b/app/src/main/java/com/el/yello/presentation/main/dialog/notice/NoticeViewModel.kt @@ -1,6 +1,7 @@ package com.el.yello.presentation.main.dialog.notice import androidx.lifecycle.ViewModel +import com.el.yello.util.manager.AmplitudeManager import com.example.domain.repository.NoticeRepository import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.flow.MutableStateFlow @@ -19,6 +20,13 @@ class NoticeViewModel @Inject constructor( } fun setDisabledNotice(url: String) { - if (isNoticeDisabled.value) noticeRepository.setDisabledNoticeUrl(url) + if (isNoticeDisabled.value) { + noticeRepository.setDisabledNoticeUrl(url) + AmplitudeManager.trackEventWithProperties(EVENT_CLICK_POP_UP_NO) + } + } + + companion object { + private const val EVENT_CLICK_POP_UP_NO = "click_notice_popup_no" } } diff --git a/app/src/main/java/com/el/yello/presentation/main/timeline/TimelineFragment.kt b/app/src/main/java/com/el/yello/presentation/main/timeline/TimelineFragment.kt index 6794a106..a9e153dc 100644 --- a/app/src/main/java/com/el/yello/presentation/main/timeline/TimelineFragment.kt +++ b/app/src/main/java/com/el/yello/presentation/main/timeline/TimelineFragment.kt @@ -12,6 +12,7 @@ import androidx.paging.LoadState import androidx.recyclerview.widget.RecyclerView import com.el.yello.R import com.el.yello.databinding.FragmentTimelineBinding +import com.el.yello.presentation.main.MainActivity import com.el.yello.presentation.main.dialog.invite.InviteFriendDialog import com.el.yello.util.extension.BaseLinearRcvItemDeco import com.el.yello.util.extension.setPullToScrollColor @@ -73,13 +74,17 @@ class TimelineFragment : BindingFragment(R.layout.fragm private fun initInviteBtnListener() { binding.btnLookNoFriend.setOnSingleClickListener { - inviteFriendDialog = - InviteFriendDialog.newInstance(viewModel.getYelloId(), TIMELINE_NO_FRIEND) - AmplitudeManager.trackEventWithProperties( - EVENT_CLICK_INVITE, - JSONObject().put(NAME_INVITE_VIEW, TIMELINE_NO_FRIEND), - ) - inviteFriendDialog?.show(parentFragmentManager, INVITE_DIALOG) + if (isFilterSelected) { + (requireActivity() as MainActivity).navigateToVote() + } else { + inviteFriendDialog = + InviteFriendDialog.newInstance(viewModel.getYelloId(), TIMELINE_NO_FRIEND) + AmplitudeManager.trackEventWithProperties( + "click_invite", + JSONObject().put("invite_view", TIMELINE_NO_FRIEND), + ) + inviteFriendDialog?.show(parentFragmentManager, INVITE_DIALOG) + } } } @@ -89,25 +94,28 @@ class TimelineFragment : BindingFragment(R.layout.fragm adapter.refresh() viewModel.setFirstLoading(true) observeTimelinePagingList(isFilterSelected) - with(binding) { - if (isFilterSelected) { - AmplitudeManager.trackEventWithProperties(EVENT_VIEW_TIMELINE_MY_MESSAGE) - tvLookFilterType.text = TYPE_MINE - tvLookNoFriendTitle.text = stringOf(R.string.look_invite_no_title_mine) - } else { - AmplitudeManager.trackEventWithProperties(EVENT_VIEW_TIMELINE) - tvLookFilterType.text = TYPE_ALL - tvLookNoFriendTitle.text = stringOf(R.string.look_invite_no_title) - } - } + setEmptyViewByFilter(isFilterSelected) } } private fun initFromPushNotification() { isFilterSelected = arguments?.getBoolean(IS_FILTER_SELECTED, false) ?: false - if (isFilterSelected) { - binding.tvLookFilterType.text = TYPE_MINE - binding.tvLookNoFriendTitle.text = stringOf(R.string.look_invite_no_title_mine) + setEmptyViewByFilter(isFilterSelected) + } + + private fun setEmptyViewByFilter(isFilterSelected: Boolean) { + with(binding) { + if (isFilterSelected) { + AmplitudeManager.trackEventWithProperties(EVENT_VIEW_TIMELINE_MY_MESSAGE) + tvLookFilterType.text = TYPE_MINE + tvLookNoFriendTitle.text = stringOf(R.string.look_invite_no_title_mine) + btnLookNoFriend.text = stringOf(R.string.look_btn_vote) + } else { + AmplitudeManager.trackEventWithProperties(EVENT_VIEW_TIMELINE) + tvLookFilterType.text = TYPE_ALL + tvLookNoFriendTitle.text = stringOf(R.string.look_invite_no_title) + btnLookNoFriend.text = stringOf(R.string.look_btn_invite) + } } } diff --git a/app/src/main/res/layout/fragment_timeline.xml b/app/src/main/res/layout/fragment_timeline.xml index 18197850..10214a16 100644 --- a/app/src/main/res/layout/fragment_timeline.xml +++ b/app/src/main/res/layout/fragment_timeline.xml @@ -208,7 +208,7 @@ android:gravity="center" android:paddingHorizontal="30dp" android:paddingVertical="17dp" - android:text="@string/recommend_invite_no_subtitle" + android:text="@string/look_btn_invite" android:textAppearance="?textAppearanceButton" android:textColor="@color/yello_main_500" android:textSize="15sp" diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 78ea90e3..f0e4450e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -146,7 +146,9 @@ 타임라인 친구들이 받은 쪽지가 궁금하다면\n친구를 초대해볼까요? - 쪽지를 보낼 친구가 없다면\n친구를 초대하세요! + 전하고 싶은 말이 있는 친구에게\n쪽지를 보내 보세요! + 친구 초대하고 리워드 받기 + 지금 바로 쪽지 보내기 쪽지를 보낸 사람의 이름은 공개되지 않아요. 모든 쪽지 diff --git a/build-logic/convention/src/main/kotlin/Constants.kt b/build-logic/convention/src/main/kotlin/Constants.kt index 4ddb5fc8..a4de33da 100644 --- a/build-logic/convention/src/main/kotlin/Constants.kt +++ b/build-logic/convention/src/main/kotlin/Constants.kt @@ -3,7 +3,7 @@ object Constants { const val compileSdk = 33 const val minSdk = 28 const val targetSdk = 33 - const val versionCode = 43 - const val versionName = "2.0" + const val versionCode = 44 + const val versionName = "2.1" const val jvmVersion = "17" }