Skip to content

Commit

Permalink
[FEAT] TermsFragment - 이용약관, 개인정보 처리방침 클릭 로깅 (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
KxxHyoRim committed Nov 13, 2023
1 parent 2554f1f commit c16f1b4
Showing 1 changed file with 34 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import com.lgtm.android.auth.databinding.FragmentTermsBinding
import com.lgtm.android.auth.ui.signup.SignUpViewModel
import com.lgtm.android.common_ui.base.BaseFragment
import com.lgtm.android.common_ui.util.setOnThrottleClickListener
import com.lgtm.domain.logging.SwmCommonLoggingScheme
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
Expand All @@ -25,6 +26,7 @@ class TermsFragment : BaseFragment<FragmentTermsBinding>(R.layout.fragment_terms
setUpCheckBoxListeners()
setUpTextViewListener()
setupNextButtonListener()
shotTermsExposureLogging()
}

private fun setupNextButtonListener() {
Expand All @@ -45,13 +47,31 @@ class TermsFragment : BaseFragment<FragmentTermsBinding>(R.layout.fragment_terms

private fun setUpTextViewListener() {
binding.tvTermsService.setOnThrottleClickListener {
shotTermsServiceClickLogging()
openUrlInBrowser(TERMS_SERVICE_URL)
}
binding.tvTermsPrivacy.setOnThrottleClickListener {
shotTermsPrivacyClickLogging()
openUrlInBrowser(TERMS_PRIVACY_URL)
}
}

private fun shotTermsServiceClickLogging() {
val scheme = SwmCommonLoggingScheme.Builder()
.setEventLogName("TermsServiceClick")
.setScreenName(this.javaClass)
.build()
viewModel.shotSwmLogging(scheme)
}

private fun shotTermsPrivacyClickLogging() {
val scheme = SwmCommonLoggingScheme.Builder()
.setEventLogName("TermsPrivacyClick")
.setScreenName(this.javaClass)
.build()
viewModel.shotSwmLogging(scheme)
}

private fun openUrlInBrowser(url: String) {
val intent = Intent(Intent.ACTION_VIEW).apply {
data = Uri.parse(url)
Expand Down Expand Up @@ -88,7 +108,7 @@ class TermsFragment : BaseFragment<FragmentTermsBinding>(R.layout.fragment_terms
}
}

private fun toggleTermsAll(){
private fun toggleTermsAll() {
binding.cbTermsAll.isChecked = !binding.cbTermsAll.isChecked
}

Expand All @@ -109,12 +129,22 @@ class TermsFragment : BaseFragment<FragmentTermsBinding>(R.layout.fragment_terms
signUpViewModel.setIsAgreeWithTerms(isAgreeWithTerms)
}

private fun shotTermsExposureLogging() {
val scheme = SwmCommonLoggingScheme.Builder()
.setEventLogName("TermsExposure")
.setScreenName(this.javaClass)
.setLogData(mapOf("signUpStep" to 1))
.build()
viewModel.shotSwmLogging(scheme)
}

companion object {
// todo : url 수정
// 약관 및 정책
const val TERMS_SERVICE_URL = "https://www.naver.com"
const val TERMS_SERVICE_URL =
"https://www.notion.so/team-hkcc/c4f56b4e6e1b46e89c494e5b3919ed8c?pvs=4"

// 개인정보 처리 방침
const val TERMS_PRIVACY_URL = "https://www.google.com"
const val TERMS_PRIVACY_URL =
"https://www.notion.so/team-hkcc/31a6b7a98d1f4d148bb05cc826d0c9aa?pvs=4"
}
}

0 comments on commit c16f1b4

Please sign in to comment.