Skip to content
This repository has been archived by the owner on Nov 3, 2022. It is now read-only.

Commit

Permalink
#540 [FEAT] : 파이어베이스 로그 달기(MyPage)
Browse files Browse the repository at this point in the history
  • Loading branch information
l2hyunwoo committed Feb 28, 2021
1 parent 0090c4e commit f2087b6
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 2 deletions.
22 changes: 22 additions & 0 deletions app/src/main/java/com/teambeme/beme/mypage/model/CategoryFilter.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.teambeme.beme.mypage.model

import com.teambeme.beme.R

enum class CategoryFilter(
private val checkId: Int,
private val itemId: String
) {
VALUES(R.id.chip_write_1, "CLICK_VALUES_MPFILTER"),
RELATIONSHIP(R.id.chip_write_2, "CLICK_RELATIONSHIP_MPFILTER"),
LOVE(R.id.chip_write_3, "CLICK_LOVE_MPFILTER"),
DAILYLIFE(R.id.chip_write_4, "CLICK_DAILYLIFE_MPFILTER"),
ME(R.id.chip_write_5, "CLICK_ME_MPFILTER"),
STORY(R.id.chip_write_6, "CLICK_STORY_MPFILTER");

companion object {
fun asItemId(checkId: Int): String {
return values().find { it.checkId == checkId }?.itemId
?: throw IllegalArgumentException("무슨 범위여 이게 $checkId")
}
}
}
19 changes: 19 additions & 0 deletions app/src/main/java/com/teambeme/beme/mypage/model/PublicRange.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.teambeme.beme.mypage.model

import com.teambeme.beme.R

enum class PublicRange(
private val checkId: Int,
private val itemId: String
) {
ALL(R.id.chip_range_1, "CLICK_ALL_MPFILTER"),
OPEN(R.id.chip_range_2, "CLICK_OPEN_MPFILTER"),
PRIVATE(R.id.chip_range_3, "CLICK_PRIVATE_MPFILTER");

companion object {
fun asItemId(checkId: Int): String {
return values().find { it.checkId == checkId }?.itemId
?: throw IllegalArgumentException("무슨 범위여 이게 $checkId")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ import com.teambeme.beme.R
import com.teambeme.beme.data.remote.datasource.MyPageDataSourceImpl
import com.teambeme.beme.data.remote.singleton.RetrofitObjects
import com.teambeme.beme.databinding.ItemBottomWriteBinding
import com.teambeme.beme.mypage.model.CategoryFilter
import com.teambeme.beme.mypage.model.PublicRange
import com.teambeme.beme.mypage.repository.MyPageRepositoryImpl
import com.teambeme.beme.mypage.viewmodel.MyPageViewModel
import com.teambeme.beme.mypage.viewmodel.MyPageViewModelFactory
import com.teambeme.beme.util.recordClickEvent

class BottomWriteFragment(private val filter: Boolean) : BottomSheetDialogFragment() {
private lateinit var binding: ItemBottomWriteBinding
Expand All @@ -39,12 +42,13 @@ class BottomWriteFragment(private val filter: Boolean) : BottomSheetDialogFragme
dismiss()
}
binding.chipGroupRange.setOnCheckedChangeListener { group, checkedId ->
recordClickEvent("BUTTON", PublicRange.asItemId(checkedId))
setRangeOnCheckedListner(checkedId)
}
binding.chipGroupWriteCategori.setOnCheckedChangeListener { group, checkedId ->
recordClickEvent("BUTTON", CategoryFilter.asItemId(checkedId))
setWriteOnCheckedListener(checkedId)
}

return binding.root
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import com.teambeme.beme.mypage.repository.MyPageRepositoryImpl
import com.teambeme.beme.mypage.view.BottomWriteFragment.Companion.WRITE_FILTER
import com.teambeme.beme.mypage.viewmodel.MyPageViewModel
import com.teambeme.beme.mypage.viewmodel.MyPageViewModelFactory
import com.teambeme.beme.util.recordClickEvent

class MyWriteFragment : Fragment() {
private lateinit var binding: FragmentMyWriteBinding
Expand Down Expand Up @@ -56,6 +57,10 @@ class MyWriteFragment : Fragment() {
mypageViewModel.isAnswerEmpty.observe(viewLifecycleOwner) {
isEmptyListener(it)
}
binding.imgWriteFilter.setOnClickListener {
recordClickEvent("BUTTON", "CLICK_FILTER_MYPAGE")
mypageViewModel.writeFilterOnClick()
}
setSearchView()
return binding.root
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import com.teambeme.beme.databinding.ItemRecentActivitiesBinding
import com.teambeme.beme.detail.view.DetailActivity
import com.teambeme.beme.notification.model.ResponseNoticeData
import com.teambeme.beme.otherpage.view.OtherPageActivity
import com.teambeme.beme.util.recordClickEvent

class NoticeAdapter :
ListAdapter<ResponseNoticeData.Data.Activity, NoticeAdapter.NoticeViewHolder>(NoticeDiffUtil()) {
Expand Down Expand Up @@ -46,6 +47,7 @@ class NoticeAdapter :
view.context.startActivity(intent)
}
itemView.setOnClickListener { view ->
recordClickEvent("BUTTON", "CLCIK_ALARM")
if (getItem(position).questionTitle != null) {
val intent = Intent(view.context, DetailActivity::class.java)
intent.putExtra("answerId", getItem(holder.adapterPosition).answerId)
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/fragment_my_write.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
android:layout_height="wrap_content"
android:layout_marginEnd="28dp"
android:backgroundTint="@android:color/transparent"
android:onClick="@{() -> myPageViewModel.writeFilterOnClick()}"
app:layout_constraintBottom_toBottomOf="@+id/search_view_write_search"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/search_view_write_search"
Expand Down

0 comments on commit f2087b6

Please sign in to comment.