Skip to content

Commit

Permalink
[mod] #207 필터 페이지 버튼 누를때마다 생기는 이벤트 온보딩에서 필터 설정할때만 찍히도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan2dani committed Sep 29, 2023
1 parent 73af54a commit 163baf1
Showing 1 changed file with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 +68,24 @@ class FilterSettingActivity : BindingActivity<ActivityFilterBinding>(R.layout.ac
}

binding.btnFilterNext.setOnSingleClickListener {
when (binding.vpFilterContainer.currentItem) {
0 -> {
AmplitudeUtils.trackEvent(FILTER_SETTING_FIRST_PAGE)
binding.vpFilterContainer.currentItem++
}

1 -> {
AmplitudeUtils.trackEvent(FILTER_SETTING_SECOND_PAGE)
binding.vpFilterContainer.currentItem++
}

val currentPosition = binding.vpFilterContainer.currentItem
val eventToTrack = when (currentPosition) {
0 -> FILTER_SETTING_FIRST_PAGE
1 -> FILTER_SETTING_SECOND_PAGE
2 -> {
viewModel.setUserFilter()
AmplitudeUtils.trackEvent(FILTER_SETTING_LAST_PAGE)
FILTER_SETTING_LAST_PAGE
}

else -> {}
else -> null
}

if (viewModel.previousActivity.value == FilterInfoType.ONBOARDING && eventToTrack != null) {
AmplitudeUtils.trackEvent(eventToTrack)
}

if (currentPosition < 2) {
binding.vpFilterContainer.currentItem++
}
}
}
Expand Down

0 comments on commit 163baf1

Please sign in to comment.