From 1787cda80b159c601695eb6427483843c4e5a8fb Mon Sep 17 00:00:00 2001 From: pmj1459 <76741702+minju1459@users.noreply.github.com> Date: Fri, 13 Oct 2023 17:19:52 +0900 Subject: [PATCH 01/10] =?UTF-8?q?[ADD/#301]=20=EC=98=A8=EB=B3=B4=EB=94=A9?= =?UTF-8?q?=20=EC=9D=B4=ED=83=88=20=EC=9C=A0=EB=AC=B4=20Amplitude=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fragment/highschoolinfo/HighSchoolInfoFragment.kt | 10 ++++++++++ .../fragment/studenttype/SelectStudentFragment.kt | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/HighSchoolInfoFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/HighSchoolInfoFragment.kt index 3385bedaf..24dad1e03 100644 --- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/HighSchoolInfoFragment.kt +++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/HighSchoolInfoFragment.kt @@ -10,10 +10,12 @@ import com.el.yello.presentation.onboarding.activity.OnBoardingActivity import com.el.yello.presentation.onboarding.activity.OnBoardingViewModel import com.el.yello.presentation.onboarding.fragment.highschoolinfo.group.GroupDialogFragment import com.el.yello.presentation.onboarding.fragment.highschoolinfo.school.SearchDialogHighSchoolFragment +import com.el.yello.util.amplitude.AmplitudeUtils import com.el.yello.util.context.yelloSnackbar import com.example.domain.enum.GradeEnum import com.example.ui.base.BindingFragment import com.example.ui.view.setOnSingleClickListener +import org.json.JSONObject class HighSchoolInfoFragment : BindingFragment(R.layout.fragment_highschool) { @@ -98,8 +100,16 @@ class HighSchoolInfoFragment : private fun setConfirmBtnClickListener() { binding.btnHighschoolinfoNextBtn.setOnSingleClickListener { findNavController().navigate(R.id.action_highschoolInfoFragment_to_yelIoIdFragment) + amplitudeHighSchoolInfo() val activity = requireActivity() as OnBoardingActivity activity.progressBarPlus() } } + + private fun amplitudeHighSchoolInfo() { + AmplitudeUtils.trackEventWithProperties( + "click_onboarding_next", + JSONObject().put("onboard_view", "school"), + ) + } } diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/studenttype/SelectStudentFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/studenttype/SelectStudentFragment.kt index 4c3de9da9..b9f22d148 100644 --- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/studenttype/SelectStudentFragment.kt +++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/studenttype/SelectStudentFragment.kt @@ -8,9 +8,11 @@ import com.el.yello.R import com.el.yello.databinding.FragmentSelectStudentTypeBinding import com.el.yello.presentation.onboarding.activity.OnBoardingActivity import com.el.yello.presentation.onboarding.activity.OnBoardingViewModel +import com.el.yello.util.amplitude.AmplitudeUtils import com.example.domain.enum.StudentTypeEnum import com.example.ui.base.BindingFragment import com.example.ui.view.setOnSingleClickListener +import org.json.JSONObject class SelectStudentFragment : BindingFragment(R.layout.fragment_select_student_type) { @@ -53,6 +55,7 @@ class SelectStudentFragment : binding.tvStudentHighschool.setTextColor(resources.getColor(R.color.grayscales_700)) binding.btnSelectTypeNext.setOnSingleClickListener { findNavController().navigate(R.id.action_selectStudentFragment_to_universityInfoFragment) + amplitudeSelectStudent() val activity = requireActivity() as OnBoardingActivity activity.progressBarPlus() } @@ -60,4 +63,10 @@ class SelectStudentFragment : } } } + private fun amplitudeSelectStudent() { + AmplitudeUtils.trackEventWithProperties( + "click_onboarding_next", + JSONObject().put("onboard_view", "student_type"), + ) + } } From f00d0f42f6886332d2b3dd0af25151dfa5617991 Mon Sep 17 00:00:00 2001 From: pmj1459 <76741702+minju1459@users.noreply.github.com> Date: Fri, 13 Oct 2023 17:34:58 +0900 Subject: [PATCH 02/10] =?UTF-8?q?[ADD/#301]=20=ED=95=99=EB=A0=A5=20?= =?UTF-8?q?=EC=84=A0=ED=83=9D,=20=EA=B3=A0=EB=94=A9=20user=20properties=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/onboarding/activity/OnBoardingViewModel.kt | 3 ++- .../fragment/highschoolinfo/HighSchoolInfoFragment.kt | 3 +++ .../onboarding/fragment/studenttype/SelectStudentFragment.kt | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/activity/OnBoardingViewModel.kt b/app/src/main/java/com/el/yello/presentation/onboarding/activity/OnBoardingViewModel.kt index bd2dbae62..b0b606aea 100644 --- a/app/src/main/java/com/el/yello/presentation/onboarding/activity/OnBoardingViewModel.kt +++ b/app/src/main/java/com/el/yello/presentation/onboarding/activity/OnBoardingViewModel.kt @@ -50,7 +50,7 @@ class OnBoardingViewModel @Inject constructor( val studentType = MutableLiveData("") val university: String get() = universityText.value?.trim() ?: "" val universityText = MutableLiveData("") - private val highSchool: String get() = highSchoolText.value?.trim() ?: "" + val highSchool: String get() = highSchoolText.value?.trim() ?: "" val highSchoolText = MutableLiveData("") val departmentText = MutableLiveData("") @@ -77,6 +77,7 @@ class OnBoardingViewModel @Inject constructor( val departmentState: StateFlow> = _departmentState private val _highSchoolGroupState = MutableLiveData>() + val highSchoolGroupState: LiveData> = _highSchoolGroupState private val _highSchoolGroupList: MutableLiveData> = MutableLiveData() val highSchoolGroupList: LiveData> = _highSchoolGroupList diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/HighSchoolInfoFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/HighSchoolInfoFragment.kt index 24dad1e03..924622d12 100644 --- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/HighSchoolInfoFragment.kt +++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/HighSchoolInfoFragment.kt @@ -111,5 +111,8 @@ class HighSchoolInfoFragment : "click_onboarding_next", JSONObject().put("onboard_view", "school"), ) + AmplitudeUtils.updateUserProperties("user_school", viewModel.highSchool) + AmplitudeUtils.updateUserProperties("user_department", viewModel.highSchoolGroupState.toString()) + AmplitudeUtils.updateUserIntProperties("user_grade", viewModel.studentId) } } diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/studenttype/SelectStudentFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/studenttype/SelectStudentFragment.kt index b9f22d148..78f959369 100644 --- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/studenttype/SelectStudentFragment.kt +++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/studenttype/SelectStudentFragment.kt @@ -42,6 +42,8 @@ class SelectStudentFragment : binding.tvStudentUniversity.setTextColor(resources.getColor(R.color.grayscales_700)) binding.btnSelectTypeNext.setOnSingleClickListener { findNavController().navigate(R.id.action_selectStudentFragment_to_highschoolInfoFragment) + amplitudeSelectStudent() + AmplitudeUtils.updateUserProperties("user_student_type", "highschool") val activity = requireActivity() as OnBoardingActivity activity.progressBarPlus() } @@ -56,6 +58,7 @@ class SelectStudentFragment : binding.btnSelectTypeNext.setOnSingleClickListener { findNavController().navigate(R.id.action_selectStudentFragment_to_universityInfoFragment) amplitudeSelectStudent() + AmplitudeUtils.updateUserProperties("user_student_type", "university") val activity = requireActivity() as OnBoardingActivity activity.progressBarPlus() } From 6c3a841de2669e25c9486cb0d2a39ea1d71d86a9 Mon Sep 17 00:00:00 2001 From: pmj1459 <76741702+minju1459@users.noreply.github.com> Date: Sun, 15 Oct 2023 21:34:02 +0900 Subject: [PATCH 03/10] =?UTF-8?q?[FIX/#301]=20=EA=B3=A0=EB=93=B1=ED=95=99?= =?UTF-8?q?=EA=B5=90=20user=20properties=20value=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fragment/highschoolinfo/HighSchoolInfoFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/HighSchoolInfoFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/HighSchoolInfoFragment.kt index 924622d12..031592664 100644 --- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/HighSchoolInfoFragment.kt +++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/HighSchoolInfoFragment.kt @@ -112,7 +112,7 @@ class HighSchoolInfoFragment : JSONObject().put("onboard_view", "school"), ) AmplitudeUtils.updateUserProperties("user_school", viewModel.highSchool) - AmplitudeUtils.updateUserProperties("user_department", viewModel.highSchoolGroupState.toString()) + AmplitudeUtils.updateUserProperties("user_department", viewModel.highSchoolGroupText.value.toString()) AmplitudeUtils.updateUserIntProperties("user_grade", viewModel.studentId) } } From db0b2fdceb58e17d69d9605b6dc16881c55c606e Mon Sep 17 00:00:00 2001 From: pmj1459 <76741702+minju1459@users.noreply.github.com> Date: Sun, 15 Oct 2023 21:39:00 +0900 Subject: [PATCH 04/10] =?UTF-8?q?[MOD/#301]=20SearchDialogDepartmentFragme?= =?UTF-8?q?nt=20warning=20=EB=B3=B4=EC=99=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../department/SearchDialogDepartmentFragment.kt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/department/SearchDialogDepartmentFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/department/SearchDialogDepartmentFragment.kt index 92a4cc32c..1cc116772 100644 --- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/department/SearchDialogDepartmentFragment.kt +++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/department/SearchDialogDepartmentFragment.kt @@ -144,14 +144,18 @@ class SearchDialogDepartmentFragment : } private fun recyclerviewScroll() { - binding.rvDepartmentList.setOnTouchListener { view, motionEvent -> - when (motionEvent.action) { - MotionEvent.ACTION_MOVE -> { - binding.layoutDepartmentDialog.requestDisallowInterceptTouchEvent(true) + binding.rvDepartmentList.addOnItemTouchListener(object : RecyclerView.OnItemTouchListener { + override fun onInterceptTouchEvent(rv: RecyclerView, e: MotionEvent): Boolean { + when (e.action) { + MotionEvent.ACTION_MOVE -> { + binding.layoutDepartmentDialog.requestDisallowInterceptTouchEvent(true) + } } + return false } - return@setOnTouchListener false - } + override fun onTouchEvent(rv: RecyclerView, e: MotionEvent) {} + override fun onRequestDisallowInterceptTouchEvent(disallowIntercept: Boolean) {} + }) } override fun onDestroyView() { From a99601df58d09c8e8649da3e532784588636f196 Mon Sep 17 00:00:00 2001 From: pmj1459 <76741702+minju1459@users.noreply.github.com> Date: Mon, 16 Oct 2023 14:53:41 +0900 Subject: [PATCH 05/10] =?UTF-8?q?[DEL/#301]=20=EC=82=AC=EC=9A=A9=ED=95=98?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EB=8A=94=20=EB=B3=80=EC=88=98=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/onboarding/activity/OnBoardingViewModel.kt | 1 - .../universityinfo/department/SearchDialogDepartmentFragment.kt | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/activity/OnBoardingViewModel.kt b/app/src/main/java/com/el/yello/presentation/onboarding/activity/OnBoardingViewModel.kt index b0b606aea..150260e77 100644 --- a/app/src/main/java/com/el/yello/presentation/onboarding/activity/OnBoardingViewModel.kt +++ b/app/src/main/java/com/el/yello/presentation/onboarding/activity/OnBoardingViewModel.kt @@ -77,7 +77,6 @@ class OnBoardingViewModel @Inject constructor( val departmentState: StateFlow> = _departmentState private val _highSchoolGroupState = MutableLiveData>() - val highSchoolGroupState: LiveData> = _highSchoolGroupState private val _highSchoolGroupList: MutableLiveData> = MutableLiveData() val highSchoolGroupList: LiveData> = _highSchoolGroupList diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/department/SearchDialogDepartmentFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/department/SearchDialogDepartmentFragment.kt index 1cc116772..717927119 100644 --- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/department/SearchDialogDepartmentFragment.kt +++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/department/SearchDialogDepartmentFragment.kt @@ -4,6 +4,7 @@ import android.app.Dialog import android.content.Intent import android.net.Uri import android.os.Bundle +import android.util.Log import android.view.MotionEvent import android.view.View import android.view.WindowManager From b74710960fb3d47d4ca63159fdc02c3cd7a87467 Mon Sep 17 00:00:00 2001 From: pmj1459 <76741702+minju1459@users.noreply.github.com> Date: Tue, 17 Oct 2023 07:24:06 +0900 Subject: [PATCH 06/10] =?UTF-8?q?[FIX/#301]=20flow=20=EB=B6=80=EB=B6=84=20?= =?UTF-8?q?flowWithLifecycle=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../school/SearchDialogHighSchoolFragment.kt | 31 ++++++++++------- .../SearchDialogDepartmentFragment.kt | 34 +++++++++++-------- .../SearchDialogUniversityFragment.kt | 14 +++++--- 3 files changed, 46 insertions(+), 33 deletions(-) diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/school/SearchDialogHighSchoolFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/school/SearchDialogHighSchoolFragment.kt index 58b91fc87..c77590c65 100644 --- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/school/SearchDialogHighSchoolFragment.kt +++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/school/SearchDialogHighSchoolFragment.kt @@ -9,6 +9,7 @@ import android.view.View import android.view.WindowManager import androidx.core.widget.doAfterTextChanged import androidx.fragment.app.activityViewModels +import androidx.lifecycle.flowWithLifecycle import androidx.lifecycle.lifecycleScope import androidx.lifecycle.viewModelScope import androidx.recyclerview.widget.LinearLayoutManager @@ -25,7 +26,8 @@ import com.google.android.material.bottomsheet.BottomSheetBehavior import com.google.android.material.bottomsheet.BottomSheetDialog import kotlinx.coroutines.Job import kotlinx.coroutines.delay -import kotlinx.coroutines.flow.collectLatest +import kotlinx.coroutines.flow.launchIn +import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.launch class SearchDialogHighSchoolFragment : @@ -78,19 +80,22 @@ class SearchDialogHighSchoolFragment : } private fun setupHighSchoolData() { - lifecycleScope.launch { - viewModel.highSchoolState.collectLatest { state -> - when (state) { - is UiState.Success -> { - adapter?.submitList(state.data.groupNameList) - } - is UiState.Failure -> { - yelloSnackbar(binding.root, getString(R.string.msg_error)) + viewLifecycleOwner.lifecycleScope.launch { + viewModel.highSchoolState.flowWithLifecycle(viewLifecycleOwner.lifecycle) + .onEach { state -> + when (state) { + is UiState.Success -> { + adapter?.submitList(state.data.groupNameList) + } + + is UiState.Failure -> { + yelloSnackbar(binding.root, getString(R.string.msg_error)) + } + + is UiState.Loading -> return@onEach + is UiState.Empty -> return@onEach } - is UiState.Loading -> {} - is UiState.Empty -> {} - } - } + }.launchIn(viewLifecycleOwner.lifecycleScope) } } diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/department/SearchDialogDepartmentFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/department/SearchDialogDepartmentFragment.kt index 717927119..cce9a5601 100644 --- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/department/SearchDialogDepartmentFragment.kt +++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/department/SearchDialogDepartmentFragment.kt @@ -4,12 +4,12 @@ import android.app.Dialog import android.content.Intent import android.net.Uri import android.os.Bundle -import android.util.Log import android.view.MotionEvent import android.view.View import android.view.WindowManager import androidx.core.widget.doAfterTextChanged import androidx.fragment.app.activityViewModels +import androidx.lifecycle.flowWithLifecycle import androidx.lifecycle.lifecycleScope import androidx.lifecycle.viewModelScope import androidx.recyclerview.widget.LinearLayoutManager @@ -26,7 +26,8 @@ import com.google.android.material.bottomsheet.BottomSheetBehavior import com.google.android.material.bottomsheet.BottomSheetDialog import kotlinx.coroutines.Job import kotlinx.coroutines.delay -import kotlinx.coroutines.flow.collectLatest +import kotlinx.coroutines.flow.launchIn +import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.launch import timber.log.Timber @@ -81,20 +82,23 @@ class SearchDialogDepartmentFragment : } private fun setupDepartmentData() { - lifecycleScope.launch { - viewModel.departmentState.collectLatest { state -> - Timber.d("GET GROUP LIST OBSERVE : $state") - when (state) { - is UiState.Success -> { - adapter?.submitList(state.data.groupList) - } - is UiState.Failure -> { - yelloSnackbar(binding.root, getString(R.string.msg_error)) + viewLifecycleOwner.lifecycleScope.launch { + viewModel.departmentState.flowWithLifecycle(viewLifecycleOwner.lifecycle) + .onEach { state -> + Timber.d("GET GROUP LIST OBSERVE : $state") + when (state) { + is UiState.Success -> { + adapter?.submitList(state.data.groupList) + } + + is UiState.Failure -> { + yelloSnackbar(binding.root, getString(R.string.msg_error)) + } + + is UiState.Loading -> return@onEach + is UiState.Empty -> return@onEach } - is UiState.Loading -> {} - is UiState.Empty -> {} - } - } + }.launchIn(viewLifecycleOwner.lifecycleScope) } } diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/university/SearchDialogUniversityFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/university/SearchDialogUniversityFragment.kt index d2c927ddd..d1f06e2bb 100644 --- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/university/SearchDialogUniversityFragment.kt +++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/university/SearchDialogUniversityFragment.kt @@ -9,6 +9,7 @@ import android.view.View import android.view.WindowManager import androidx.core.widget.doAfterTextChanged import androidx.fragment.app.activityViewModels +import androidx.lifecycle.flowWithLifecycle import androidx.lifecycle.lifecycleScope import androidx.lifecycle.viewModelScope import androidx.recyclerview.widget.LinearLayoutManager @@ -26,6 +27,8 @@ import com.google.android.material.bottomsheet.BottomSheetDialog import kotlinx.coroutines.Job import kotlinx.coroutines.delay import kotlinx.coroutines.flow.collectLatest +import kotlinx.coroutines.flow.launchIn +import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.launch class SearchDialogUniversityFragment : @@ -78,8 +81,9 @@ class SearchDialogUniversityFragment : } private fun setupUniversityData() { - lifecycleScope.launch { - viewModel.universityState.collectLatest { state -> + viewLifecycleOwner.lifecycleScope.launch { + viewModel.universityState.flowWithLifecycle(viewLifecycleOwner.lifecycle) + .onEach { state -> when (state) { is UiState.Success -> { adapter?.submitList(state.data.schoolList) @@ -87,10 +91,10 @@ class SearchDialogUniversityFragment : is UiState.Failure -> { yelloSnackbar(binding.root, getString(R.string.msg_error)) } - is UiState.Loading -> {} - is UiState.Empty -> {} + is UiState.Loading -> return@onEach + is UiState.Empty -> return@onEach } - } + }.launchIn(viewLifecycleOwner.lifecycleScope) } } From c34908eefd33de79e7d98386c336b2bb54b74a64 Mon Sep 17 00:00:00 2001 From: pmj1459 <76741702+minju1459@users.noreply.github.com> Date: Tue, 17 Oct 2023 12:33:04 +0900 Subject: [PATCH 07/10] =?UTF-8?q?[FIX/#301]=20university=20department=20us?= =?UTF-8?q?er=20properties=20=EA=B0=92=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fragment/universityinfo/UniversityInfoFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/UniversityInfoFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/UniversityInfoFragment.kt index bd92966f5..e3b0f6bcb 100644 --- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/UniversityInfoFragment.kt +++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/UniversityInfoFragment.kt @@ -93,7 +93,7 @@ class UniversityInfoFragment : JSONObject().put("onboard_view", "school"), ) AmplitudeUtils.updateUserProperties("user_school", viewModel.university) - AmplitudeUtils.updateUserProperties("user_department", viewModel.departmentState.toString()) + AmplitudeUtils.updateUserProperties("user_department", viewModel.departmentText.value.toString()) AmplitudeUtils.updateUserIntProperties("user_grade", viewModel.studentId) } companion object { From 28d5db1f1d4c2873b692352bd527a30604b56f0f Mon Sep 17 00:00:00 2001 From: pmj1459 <76741702+minju1459@users.noreply.github.com> Date: Wed, 18 Oct 2023 14:10:33 +0900 Subject: [PATCH 08/10] =?UTF-8?q?[FIX/#301]=20Flow=20=EC=A0=81=EC=9A=A9=20?= =?UTF-8?q?=EB=B6=80=EB=B6=84=20=EC=A4=91=EB=B3=B5=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../school/SearchDialogHighSchoolFragment.kt | 28 ++++++++--------- .../SearchDialogDepartmentFragment.kt | 30 +++++++++---------- .../SearchDialogUniversityFragment.kt | 7 ++--- 3 files changed, 29 insertions(+), 36 deletions(-) diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/school/SearchDialogHighSchoolFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/school/SearchDialogHighSchoolFragment.kt index c77590c65..36bffac47 100644 --- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/school/SearchDialogHighSchoolFragment.kt +++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/school/SearchDialogHighSchoolFragment.kt @@ -80,23 +80,21 @@ class SearchDialogHighSchoolFragment : } private fun setupHighSchoolData() { - viewLifecycleOwner.lifecycleScope.launch { - viewModel.highSchoolState.flowWithLifecycle(viewLifecycleOwner.lifecycle) - .onEach { state -> - when (state) { - is UiState.Success -> { - adapter?.submitList(state.data.groupNameList) - } - - is UiState.Failure -> { - yelloSnackbar(binding.root, getString(R.string.msg_error)) - } + viewModel.highSchoolState.flowWithLifecycle(viewLifecycleOwner.lifecycle) + .onEach { state -> + when (state) { + is UiState.Success -> { + adapter?.submitList(state.data.groupNameList) + } - is UiState.Loading -> return@onEach - is UiState.Empty -> return@onEach + is UiState.Failure -> { + yelloSnackbar(binding.root, getString(R.string.msg_error)) } - }.launchIn(viewLifecycleOwner.lifecycleScope) - } + + is UiState.Loading -> return@onEach + is UiState.Empty -> return@onEach + } + }.launchIn(viewLifecycleOwner.lifecycleScope) } private fun storeHighSchool(school: String) { diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/department/SearchDialogDepartmentFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/department/SearchDialogDepartmentFragment.kt index cce9a5601..5c070fed3 100644 --- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/department/SearchDialogDepartmentFragment.kt +++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/department/SearchDialogDepartmentFragment.kt @@ -82,24 +82,22 @@ class SearchDialogDepartmentFragment : } private fun setupDepartmentData() { - viewLifecycleOwner.lifecycleScope.launch { - viewModel.departmentState.flowWithLifecycle(viewLifecycleOwner.lifecycle) - .onEach { state -> - Timber.d("GET GROUP LIST OBSERVE : $state") - when (state) { - is UiState.Success -> { - adapter?.submitList(state.data.groupList) - } - - is UiState.Failure -> { - yelloSnackbar(binding.root, getString(R.string.msg_error)) - } + viewModel.departmentState.flowWithLifecycle(viewLifecycleOwner.lifecycle) + .onEach { state -> + Timber.d("GET GROUP LIST OBSERVE : $state") + when (state) { + is UiState.Success -> { + adapter?.submitList(state.data.groupList) + } - is UiState.Loading -> return@onEach - is UiState.Empty -> return@onEach + is UiState.Failure -> { + yelloSnackbar(binding.root, getString(R.string.msg_error)) } - }.launchIn(viewLifecycleOwner.lifecycleScope) - } + + is UiState.Loading -> return@onEach + is UiState.Empty -> return@onEach + } + }.launchIn(viewLifecycleOwner.lifecycleScope) } private fun storeUniversityGroup(department: String, groupId: Long) { diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/university/SearchDialogUniversityFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/university/SearchDialogUniversityFragment.kt index d1f06e2bb..5f4d3cdf9 100644 --- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/university/SearchDialogUniversityFragment.kt +++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/university/SearchDialogUniversityFragment.kt @@ -26,7 +26,6 @@ import com.google.android.material.bottomsheet.BottomSheetBehavior import com.google.android.material.bottomsheet.BottomSheetDialog import kotlinx.coroutines.Job import kotlinx.coroutines.delay -import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.launch @@ -81,9 +80,8 @@ class SearchDialogUniversityFragment : } private fun setupUniversityData() { - viewLifecycleOwner.lifecycleScope.launch { - viewModel.universityState.flowWithLifecycle(viewLifecycleOwner.lifecycle) - .onEach { state -> + viewModel.universityState.flowWithLifecycle(viewLifecycleOwner.lifecycle) + .onEach { state -> when (state) { is UiState.Success -> { adapter?.submitList(state.data.schoolList) @@ -95,7 +93,6 @@ class SearchDialogUniversityFragment : is UiState.Empty -> return@onEach } }.launchIn(viewLifecycleOwner.lifecycleScope) - } } private fun storeUniversity(school: String) { From d2bb78be67f11ad30e484bae7d8a5f68fb4886b6 Mon Sep 17 00:00:00 2001 From: pmj1459 <76741702+minju1459@users.noreply.github.com> Date: Wed, 18 Oct 2023 16:12:39 +0900 Subject: [PATCH 09/10] =?UTF-8?q?[MOD/#301]=20onboarding=20amplitude=20?= =?UTF-8?q?=EC=83=81=EC=88=98=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../onboarding/activity/GetAlarmActivity.kt | 10 +++-- .../fragment/addfriend/AddFriendFragment.kt | 14 ++++++- .../onboarding/fragment/code/CodeFragment.kt | 41 +++++++++++++------ .../highschoolinfo/HighSchoolInfoFragment.kt | 22 +++++++--- .../studenttype/SelectStudentFragment.kt | 11 ++++- .../universityinfo/UniversityInfoFragment.kt | 20 +++++---- .../fragment/yelloid/YelIoIdFragment.kt | 13 ++++-- 7 files changed, 96 insertions(+), 35 deletions(-) diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/activity/GetAlarmActivity.kt b/app/src/main/java/com/el/yello/presentation/onboarding/activity/GetAlarmActivity.kt index b424e8b12..e547a602c 100644 --- a/app/src/main/java/com/el/yello/presentation/onboarding/activity/GetAlarmActivity.kt +++ b/app/src/main/java/com/el/yello/presentation/onboarding/activity/GetAlarmActivity.kt @@ -28,10 +28,10 @@ class GetAlarmActivity : private val requestPermissionLauncher = registerForActivityResult(ActivityResultContracts.RequestPermission()) { isGranted: Boolean -> if (isGranted) { - AmplitudeUtils.updateUserProperties("user_pushnotification", "enabled") + AmplitudeUtils.updateUserProperties(EVENT_PUSH_NOTIFICATION, VALUE_ENABLED) startTutorialActivity() } else { - AmplitudeUtils.updateUserProperties("user_pushnotification", "disabled") + AmplitudeUtils.updateUserProperties(EVENT_PUSH_NOTIFICATION, VALUE_DISABLED) startTutorialActivity() } } @@ -50,7 +50,7 @@ class GetAlarmActivity : private fun askNotificationPermission() { binding.btnStartYello.setOnSingleClickListener { - AmplitudeUtils.trackEventWithProperties("click_onboarding_notification") + AmplitudeUtils.trackEventWithProperties(EVENT_CLICK_ONBOARDING_NOTIFICATION) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { if (ContextCompat.checkSelfPermission( this, @@ -81,5 +81,9 @@ class GetAlarmActivity : putExtra("isFromOnBoarding", isFromOnBoarding) } private const val NONE_ANIMATION = 0 + private const val EVENT_PUSH_NOTIFICATION = "user_pushnotification" + private const val VALUE_ENABLED = "enabled" + private const val VALUE_DISABLED = "disabled" + private const val EVENT_CLICK_ONBOARDING_NOTIFICATION = "click_onboarding_notification" } } diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/addfriend/AddFriendFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/addfriend/AddFriendFragment.kt index 60c67b3a3..a6defcabd 100644 --- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/addfriend/AddFriendFragment.kt +++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/addfriend/AddFriendFragment.kt @@ -62,8 +62,8 @@ class AddFriendFragment : BindingFragment(R.layout.fra private fun setConfirmBtnClickListener() { binding.btnAddFriendNext.setOnSingleClickListener { AmplitudeUtils.trackEventWithProperties( - "click_onboarding_next", - JSONObject().put("onboard_view", "friends"), + EVENT_CLICK_ONBOARDING_NEXT, + JSONObject().put(NAME_ONBOARD_VIEW, VALUE_FRIENDS), ) val activity = requireActivity() as OnBoardingActivity activity.progressBarPlus() @@ -78,6 +78,7 @@ class AddFriendFragment : BindingFragment(R.layout.fra viewModel.initFriendPagingVariable() viewModel.addListWithKakaoIdList() } + private fun setInfinityScroll() { binding.rvFriendList.addOnScrollListener(object : RecyclerView.OnScrollListener() { override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { @@ -108,13 +109,16 @@ class AddFriendFragment : BindingFragment(R.layout.fra selectedItemIdList.addAll(friendsList.map { friend -> friend.id }) viewModel.selectedFriendCount.value = friendsList.size } + is UiState.Failure -> { stopShimmerView() yelloSnackbar(binding.root, getString(R.string.onboarding_add_friend_error)) } + is UiState.Loading -> { startShimmerView() } + is UiState.Empty -> {} } } @@ -141,4 +145,10 @@ class AddFriendFragment : BindingFragment(R.layout.fra super.onDestroyView() _adapter = null } + + companion object { + private const val EVENT_CLICK_ONBOARDING_NEXT = "click_onboarding_next" + private const val NAME_ONBOARD_VIEW = "onboard_view" + private const val VALUE_FRIENDS = "friends" + } } diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/code/CodeFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/code/CodeFragment.kt index 9c616efb1..4b74b221d 100644 --- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/code/CodeFragment.kt +++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/code/CodeFragment.kt @@ -74,7 +74,7 @@ class CodeFragment : BindingFragment(R.layout.fragment_code viewModel.postSignupState.observe(viewLifecycleOwner) { state -> when (state) { is UiState.Success -> { - AmplitudeUtils.setUserDataProperties("user_signup_date") + AmplitudeUtils.setUserDataProperties(PROPERTY_USER_SIGHUP_DATE) val intent = Intent(activity, GetAlarmActivity::class.java) startActivity(intent) (activity as? OnBoardingActivity)?.endTutorialActivity() @@ -107,24 +107,39 @@ class CodeFragment : BindingFragment(R.layout.fragment_code } private fun amplitudeCodeSkipInfo() { - AmplitudeUtils.trackEventWithProperties("complete_onboarding_finish") + AmplitudeUtils.trackEventWithProperties(EVENT_COMPLETE_ONBOARDING_FINISH) AmplitudeUtils.trackEventWithProperties( - "click_onboarding_recommend", - JSONObject().put("rec_exist", "pass"), + EVENT_CLICK_ONBOARDING_RECOMMEND, + JSONObject().put(NAME_REC_EXIST, VALUE_PASS), ) - AmplitudeUtils.updateUserProperties("user_recommend", "no") - AmplitudeUtils.updateUserProperties("user_name", viewModel.name) - AmplitudeUtils.updateUserProperties("user_sex", viewModel.gender) + AmplitudeUtils.updateUserProperties(PROPERTY_USER_RECOMMEND, VALUE_NO) + AmplitudeUtils.updateUserProperties(PROPERTY_USER_NAME, viewModel.name) + AmplitudeUtils.updateUserProperties(PROPERTY_USER_SEX, viewModel.gender) } private fun amplitudeCodeNextInfo() { - AmplitudeUtils.trackEventWithProperties("complete_onboarding_finish") + AmplitudeUtils.trackEventWithProperties(EVENT_COMPLETE_ONBOARDING_FINISH) AmplitudeUtils.trackEventWithProperties( - "click_onboarding_recommend", - JSONObject().put("rec_exist", "next"), + EVENT_CLICK_ONBOARDING_RECOMMEND, + JSONObject().put(NAME_REC_EXIST,VALUE_NEXT), ) - AmplitudeUtils.updateUserProperties("user_recommend", "yes") - AmplitudeUtils.updateUserProperties("user_sex", viewModel.gender) - AmplitudeUtils.updateUserProperties("user_name", viewModel.name) + AmplitudeUtils.updateUserProperties(PROPERTY_USER_RECOMMEND, VALUE_YES) + AmplitudeUtils.updateUserProperties(PROPERTY_USER_NAME, viewModel.name) + AmplitudeUtils.updateUserProperties(PROPERTY_USER_SEX, viewModel.gender) + } + + companion object { + private const val PROPERTY_USER_SIGHUP_DATE = "user_signup_date" + private const val EVENT_COMPLETE_ONBOARDING_FINISH = "complete_onboarding_finish" + private const val EVENT_CLICK_ONBOARDING_RECOMMEND = "click_onboarding_recommend" + private const val NAME_REC_EXIST = "rec_exist" + private const val VALUE_PASS = "pass" + private const val VALUE_NEXT = "next" + private const val PROPERTY_USER_RECOMMEND = "user_recommend" + private const val VALUE_NO = "no" + private const val VALUE_YES = "yes" + private const val PROPERTY_USER_NAME = "user_name" + private const val PROPERTY_USER_SEX = "user_sex" + } } diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/HighSchoolInfoFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/HighSchoolInfoFragment.kt index 031592664..9bf9defe6 100644 --- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/HighSchoolInfoFragment.kt +++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/highschoolinfo/HighSchoolInfoFragment.kt @@ -108,11 +108,23 @@ class HighSchoolInfoFragment : private fun amplitudeHighSchoolInfo() { AmplitudeUtils.trackEventWithProperties( - "click_onboarding_next", - JSONObject().put("onboard_view", "school"), + EVENT_CLICK_ONBOARDING_NEXT, + JSONObject().put(NAME_ONBOARD_VIEW, VALUE_SCHOOL), ) - AmplitudeUtils.updateUserProperties("user_school", viewModel.highSchool) - AmplitudeUtils.updateUserProperties("user_department", viewModel.highSchoolGroupText.value.toString()) - AmplitudeUtils.updateUserIntProperties("user_grade", viewModel.studentId) + AmplitudeUtils.updateUserProperties(PROPERTY_USER_SCHOOL, viewModel.highSchool) + AmplitudeUtils.updateUserProperties( + PROPERTY_USER_DEPARTMENT, + viewModel.highSchoolGroupText.value.toString(), + ) + AmplitudeUtils.updateUserIntProperties(PROPERTY_USER_GRADE, viewModel.studentId) + } + + companion object { + private const val EVENT_CLICK_ONBOARDING_NEXT = "click_onboarding_next" + private const val NAME_ONBOARD_VIEW = "onboard_view" + private const val VALUE_SCHOOL = "school" + private const val PROPERTY_USER_SCHOOL = "user_school" + private const val PROPERTY_USER_DEPARTMENT = "user_department" + private const val PROPERTY_USER_GRADE = "user_grade" } } diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/studenttype/SelectStudentFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/studenttype/SelectStudentFragment.kt index 78f959369..cf7b7e035 100644 --- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/studenttype/SelectStudentFragment.kt +++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/studenttype/SelectStudentFragment.kt @@ -43,7 +43,7 @@ class SelectStudentFragment : binding.btnSelectTypeNext.setOnSingleClickListener { findNavController().navigate(R.id.action_selectStudentFragment_to_highschoolInfoFragment) amplitudeSelectStudent() - AmplitudeUtils.updateUserProperties("user_student_type", "highschool") + AmplitudeUtils.updateUserProperties(EVENT_STUDENT_TYPE, VALUE_HIGH_SCHOOL) val activity = requireActivity() as OnBoardingActivity activity.progressBarPlus() } @@ -58,7 +58,7 @@ class SelectStudentFragment : binding.btnSelectTypeNext.setOnSingleClickListener { findNavController().navigate(R.id.action_selectStudentFragment_to_universityInfoFragment) amplitudeSelectStudent() - AmplitudeUtils.updateUserProperties("user_student_type", "university") + AmplitudeUtils.updateUserProperties(EVENT_STUDENT_TYPE, VALUE_UNIVERSITY) val activity = requireActivity() as OnBoardingActivity activity.progressBarPlus() } @@ -66,10 +66,17 @@ class SelectStudentFragment : } } } + private fun amplitudeSelectStudent() { AmplitudeUtils.trackEventWithProperties( "click_onboarding_next", JSONObject().put("onboard_view", "student_type"), ) } + + companion object { + private const val EVENT_STUDENT_TYPE = "user_student_type" + private const val VALUE_HIGH_SCHOOL = "highschool" + private const val VALUE_UNIVERSITY = "university" + } } diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/UniversityInfoFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/UniversityInfoFragment.kt index e3b0f6bcb..f59a67847 100644 --- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/UniversityInfoFragment.kt +++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/universityinfo/UniversityInfoFragment.kt @@ -89,15 +89,21 @@ class UniversityInfoFragment : private fun amplitudeUniversityInfo() { AmplitudeUtils.trackEventWithProperties( - "click_onboarding_next", - JSONObject().put("onboard_view", "school"), + EVENT_CLICK_ONBOARDING_NEXT, + JSONObject().put(NAME_ONBOARD_VIEW, VALUE_SCHOOL), ) - AmplitudeUtils.updateUserProperties("user_school", viewModel.university) - AmplitudeUtils.updateUserProperties("user_department", viewModel.departmentText.value.toString()) - AmplitudeUtils.updateUserIntProperties("user_grade", viewModel.studentId) + AmplitudeUtils.updateUserProperties(PROPERTY_USER_SCHOOL, viewModel.university) + AmplitudeUtils.updateUserProperties(PROPERTY_USER_DEPARTMENT, viewModel.departmentText.value.toString()) + AmplitudeUtils.updateUserIntProperties(PROPERTY_USER_GRADE, viewModel.studentId) } companion object { - const val OVERLAP_MIN_ID = 1 - const val OVERLAP_MAX_ID = 3 + private const val OVERLAP_MIN_ID = 1 + private const val OVERLAP_MAX_ID = 3 + private const val EVENT_CLICK_ONBOARDING_NEXT = "click_onboarding_next" + private const val NAME_ONBOARD_VIEW = "onboard_view" + private const val VALUE_SCHOOL = "school" + private const val PROPERTY_USER_SCHOOL = "user_school" + private const val PROPERTY_USER_DEPARTMENT = "user_department" + private const val PROPERTY_USER_GRADE = "user_grade" } } diff --git a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/yelloid/YelIoIdFragment.kt b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/yelloid/YelIoIdFragment.kt index c8f490f58..2c31f26a5 100644 --- a/app/src/main/java/com/el/yello/presentation/onboarding/fragment/yelloid/YelIoIdFragment.kt +++ b/app/src/main/java/com/el/yello/presentation/onboarding/fragment/yelloid/YelIoIdFragment.kt @@ -80,9 +80,16 @@ class YelIoIdFragment : BindingFragment(R.layout.fragmen private fun amplitudeYelloIdInfo() { AmplitudeUtils.trackEventWithProperties( - "click_onboarding_next", - JSONObject().put("onboard_view", "id"), + EVENT_CLICK_ONBOARDING_NEXT, + JSONObject().put(NAME_ONBOARD_VIEW, VALUE_ID), ) - AmplitudeUtils.updateUserProperties("user_id", viewModel.id) + AmplitudeUtils.updateUserProperties(PROPERTY_USER_ID, viewModel.id) + } + + companion object { + private const val EVENT_CLICK_ONBOARDING_NEXT = "click_onboarding_next" + private const val NAME_ONBOARD_VIEW = "onboard_view" + private const val VALUE_ID = "id" + private const val PROPERTY_USER_ID = "user_id" } } From d3fa56502631bee7c863377278156419b1dde759 Mon Sep 17 00:00:00 2001 From: pmj1459 <76741702+minju1459@users.noreply.github.com> Date: Wed, 18 Oct 2023 16:17:30 +0900 Subject: [PATCH 10/10] =?UTF-8?q?[MOD/#301]=20tutorial=20amplitude=20?= =?UTF-8?q?=EC=83=81=EC=88=98=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../el/yello/presentation/tutorial/TutorialAActivity.kt | 7 +++++-- .../el/yello/presentation/tutorial/TutorialBActivity.kt | 7 +++++-- .../el/yello/presentation/tutorial/TutorialCActivity.kt | 7 +++++-- .../el/yello/presentation/tutorial/TutorialDActivity.kt | 7 +++++-- .../el/yello/presentation/tutorial/TutorialEndActivity.kt | 3 ++- .../yello/presentation/tutorial/TutorialEndPlusActivity.kt | 3 ++- 6 files changed, 24 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/com/el/yello/presentation/tutorial/TutorialAActivity.kt b/app/src/main/java/com/el/yello/presentation/tutorial/TutorialAActivity.kt index 9adabffb1..7875e93cb 100644 --- a/app/src/main/java/com/el/yello/presentation/tutorial/TutorialAActivity.kt +++ b/app/src/main/java/com/el/yello/presentation/tutorial/TutorialAActivity.kt @@ -20,8 +20,8 @@ class TutorialAActivity : BindingActivity(R.layout.act super.onCreate(savedInstanceState) AmplitudeUtils.trackEventWithProperties( - "view_onboarding_tutorial", - JSONObject().put("tutorial_step", "1"), + EVENT_VIEW_ONBOARDING_TUTORIAL, + JSONObject().put(NAME_TUTORIAL_STEP, VALUE_TUTORIAL_ONE), ) setClickListener() } @@ -51,5 +51,8 @@ class TutorialAActivity : BindingActivity(R.layout.act } const val EXTRA_FROM_ONBOARDING = "isFromOnBoarding" private const val NONE_ANIMATION = 0 + private const val EVENT_VIEW_ONBOARDING_TUTORIAL = "view_onboarding_tutorial" + private const val NAME_TUTORIAL_STEP = "tutorial_step" + private const val VALUE_TUTORIAL_ONE = "1" } } diff --git a/app/src/main/java/com/el/yello/presentation/tutorial/TutorialBActivity.kt b/app/src/main/java/com/el/yello/presentation/tutorial/TutorialBActivity.kt index 74edfb934..a4837d84d 100644 --- a/app/src/main/java/com/el/yello/presentation/tutorial/TutorialBActivity.kt +++ b/app/src/main/java/com/el/yello/presentation/tutorial/TutorialBActivity.kt @@ -17,8 +17,8 @@ class TutorialBActivity : BindingActivity(R.layout.act super.onCreate(savedInstanceState) AmplitudeUtils.trackEventWithProperties( - "view_onboarding_tutorial", - JSONObject().put("tutorial_step", "2"), + EVENT_VIEW_ONBOARDING_TUTORIAL, + JSONObject().put(NAME_TUTORIAL_STEP, VALUE_TUTORIAL_TWO), ) setClickListener() } @@ -44,5 +44,8 @@ class TutorialBActivity : BindingActivity(R.layout.act companion object { private const val NONE_ANIMATION = 0 + private const val EVENT_VIEW_ONBOARDING_TUTORIAL = "view_onboarding_tutorial" + private const val NAME_TUTORIAL_STEP = "tutorial_step" + private const val VALUE_TUTORIAL_TWO = "2" } } diff --git a/app/src/main/java/com/el/yello/presentation/tutorial/TutorialCActivity.kt b/app/src/main/java/com/el/yello/presentation/tutorial/TutorialCActivity.kt index 93417e2ea..22e999902 100644 --- a/app/src/main/java/com/el/yello/presentation/tutorial/TutorialCActivity.kt +++ b/app/src/main/java/com/el/yello/presentation/tutorial/TutorialCActivity.kt @@ -15,8 +15,8 @@ class TutorialCActivity : BindingActivity(R.layout.act super.onCreate(savedInstanceState) AmplitudeUtils.trackEventWithProperties( - "view_onboarding_tutorial", - JSONObject().put("tutorial_step", "3"), + EVENT_VIEW_ONBOARDING_TUTORIAL, + JSONObject().put(NAME_TUTORIAL_STEP, VALUE_TUTORIAL_THREE), ) setClickListener() } @@ -42,5 +42,8 @@ class TutorialCActivity : BindingActivity(R.layout.act companion object { private const val NONE_ANIMATION = 0 + private const val EVENT_VIEW_ONBOARDING_TUTORIAL = "view_onboarding_tutorial" + private const val NAME_TUTORIAL_STEP = "tutorial_step" + private const val VALUE_TUTORIAL_THREE = "3" } } diff --git a/app/src/main/java/com/el/yello/presentation/tutorial/TutorialDActivity.kt b/app/src/main/java/com/el/yello/presentation/tutorial/TutorialDActivity.kt index 5275dec71..6577b2b25 100644 --- a/app/src/main/java/com/el/yello/presentation/tutorial/TutorialDActivity.kt +++ b/app/src/main/java/com/el/yello/presentation/tutorial/TutorialDActivity.kt @@ -17,8 +17,8 @@ class TutorialDActivity : BindingActivity(R.layout.act super.onCreate(savedInstanceState) AmplitudeUtils.trackEventWithProperties( - "view_onboarding_tutorial", - JSONObject().put("tutorial_step", "4"), + EVENT_VIEW_ONBOARDING_TUTORIAL, + JSONObject().put(NAME_TUTORIAL_STEP, VALUE_TUTORIAL_FOUR), ) setClickListener() } @@ -52,5 +52,8 @@ class TutorialDActivity : BindingActivity(R.layout.act companion object { private const val NONE_ANIMATION = 0 + private const val EVENT_VIEW_ONBOARDING_TUTORIAL = "view_onboarding_tutorial" + private const val NAME_TUTORIAL_STEP = "tutorial_step" + private const val VALUE_TUTORIAL_FOUR = "4" } } diff --git a/app/src/main/java/com/el/yello/presentation/tutorial/TutorialEndActivity.kt b/app/src/main/java/com/el/yello/presentation/tutorial/TutorialEndActivity.kt index 39ae1dc59..10822ad03 100644 --- a/app/src/main/java/com/el/yello/presentation/tutorial/TutorialEndActivity.kt +++ b/app/src/main/java/com/el/yello/presentation/tutorial/TutorialEndActivity.kt @@ -15,7 +15,7 @@ class TutorialEndActivity : override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding.btnEndTutorial.setOnSingleClickListener { - AmplitudeUtils.trackEventWithProperties("click_onboarding_yellostart") + AmplitudeUtils.trackEventWithProperties(EVENT_CLICK_ONBOARDING_YELLO_START) val intent = Intent(this, MainActivity::class.java) startActivity(intent) } @@ -27,5 +27,6 @@ class TutorialEndActivity : companion object { private const val NONE_ANIMATION = 0 + private const val EVENT_CLICK_ONBOARDING_YELLO_START = "click_onboarding_yellostart" } } diff --git a/app/src/main/java/com/el/yello/presentation/tutorial/TutorialEndPlusActivity.kt b/app/src/main/java/com/el/yello/presentation/tutorial/TutorialEndPlusActivity.kt index 63b9db260..6116bb512 100644 --- a/app/src/main/java/com/el/yello/presentation/tutorial/TutorialEndPlusActivity.kt +++ b/app/src/main/java/com/el/yello/presentation/tutorial/TutorialEndPlusActivity.kt @@ -15,7 +15,7 @@ class TutorialEndPlusActivity : override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding.btnEndTutorial.setOnSingleClickListener { - AmplitudeUtils.trackEventWithProperties("click_onboarding_yellostart") + AmplitudeUtils.trackEventWithProperties(EVENT_CLICK_ONBOARDING_YELLO_START) val intent = Intent(this, MainActivity::class.java) startActivity(intent) } @@ -27,5 +27,6 @@ class TutorialEndPlusActivity : companion object { private const val NONE_ANIMATION = 0 + private const val EVENT_CLICK_ONBOARDING_YELLO_START = "click_onboarding_yellostart" } }