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

Commit

Permalink
#540 [FEAT] : 파이어베이스 로그 달기(Answer, Explore)
Browse files Browse the repository at this point in the history
  • Loading branch information
l2hyunwoo committed Feb 28, 2021
1 parent 43e7b1b commit ff936a8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import com.teambeme.beme.data.remote.singleton.RetrofitObjects
import com.teambeme.beme.databinding.ActivityAnswerBinding
import com.teambeme.beme.util.StatusBarUtil
import com.teambeme.beme.util.dp
import com.teambeme.beme.util.recordClickEvent
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch

Expand Down Expand Up @@ -145,6 +146,7 @@ class AnswerActivity : BindingActivity<ActivityAnswerBinding>(R.layout.activity_
val layoutParams =
binding.linearAnswerPublic.layoutParams!! as ConstraintLayout.LayoutParams
if (isPublic) {
recordClickEvent("SWITCH", "OPEN_ANSWER_ANSWERVIEW")
val animator = setValueChangeAnimator(20.dp, 64.dp)
val alphaAnimator = ValueAnimator.ofFloat(0f, 1f).apply {
duration = 400
Expand All @@ -158,6 +160,7 @@ class AnswerActivity : BindingActivity<ActivityAnswerBinding>(R.layout.activity_
binding.linearAnswerBlockComment.alpha = it.animatedValue as Float
}
} else {
recordClickEvent("SWITCH", "PRIVATE_ANSWER_ANSWERVIEW")
val animator = setValueChangeAnimator(64.dp, 20.dp)
animator.addUpdateListener { updatedAnimation ->
layoutParams.setMargins(0, 0, 0, updatedAnimation.animatedValue as Int)
Expand All @@ -174,6 +177,8 @@ class AnswerActivity : BindingActivity<ActivityAnswerBinding>(R.layout.activity_
}

binding.switchAnswerReplyCancel.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) recordClickEvent("SWITCH", "OPEN_COMMENT_ANSWERVIEW")
else recordClickEvent("SWITCH", "PRIVATE_COMMENT_ANSWERVIEW")
answerViewModel.setCommentBlockedStatus(isChecked)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import com.teambeme.beme.databinding.ItemExploreOtherMindsBinding
import com.teambeme.beme.detail.view.DetailActivity
import com.teambeme.beme.explore.model.ResponseExplorationMinds
import com.teambeme.beme.explore.view.ExploreDetailActivity
import com.teambeme.beme.util.recordClickEvent
import com.teambeme.beme.util.startActivity

class OtherMindsRcvAdapter(private val context: Context) :
Expand Down Expand Up @@ -52,6 +53,7 @@ class OtherMindsRcvAdapter(private val context: Context) :
context: Context
) {
binding.btnOtherMindsShowOtherAnswers.setOnClickListener {
recordClickEvent("BUTTON", "CLICK_SAME")
context.startActivity<ExploreDetailActivity>(otherMindsData.questionTitle, otherMindsData.questionId)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import com.teambeme.beme.explore.viewmodel.ExploreViewModelFactory
import com.teambeme.beme.home.view.HomeFragment
import com.teambeme.beme.idsearchfollowing.view.FollowingAfterIdSearchActivity
import com.teambeme.beme.notification.view.NotificationActivity
import com.teambeme.beme.util.recordClickEvent

class ExploreFragment : BindingFragment<FragmentExploreBinding>(R.layout.fragment_explore) {
private val exploreViewModelFactory = ExploreViewModelFactory(
Expand Down Expand Up @@ -65,9 +66,21 @@ class ExploreFragment : BindingFragment<FragmentExploreBinding>(R.layout.fragmen
setIsMorePageObserve()
setIntentAnswerObserve()
setListenerForPullRefreshLayout()
setChipListener()
return binding.root
}

private fun setChipListener() {
with(binding) {
chipExploreThink.setOnClickListener { recordClickEvent("BUTTON", "CLICK_VALUES_SEARCH") }
chipExploreRelationship.setOnClickListener { recordClickEvent("BUTTON", "CLICK_RELATIONSHIP_SEARCH") }
chipExploreLove.setOnClickListener { recordClickEvent("BUTTON", "CLICK_LOVE_SEARCH") }
chipExploreDaily.setOnClickListener { recordClickEvent("BUTTON", "CLICK_DAILYLIFE_SEARCH") }
chipExploreMe.setOnClickListener { recordClickEvent("BUTTON", "CLICK_ABOUTME_SEARCH") }
chipExploreStory.setOnClickListener { recordClickEvent("BUTTON", "CLICK_STORY_SEARCH") }
}
}

private fun setIntentAnswerObserve() {
exploreViewModel.questionForFirstAnswer.observe(viewLifecycleOwner) {
it?.let {
Expand Down Expand Up @@ -183,6 +196,7 @@ class ExploreFragment : BindingFragment<FragmentExploreBinding>(R.layout.fragmen

private fun setClickListenerForIdSearchButton() {
binding.btnExploreIdSearch.setOnClickListener {
recordClickEvent("BUTTON", "CLICK_SEARCHID_SEARCH")
val intent = Intent(activity, FollowingAfterIdSearchActivity::class.java)
startActivity(intent)
}
Expand Down

0 comments on commit ff936a8

Please sign in to comment.