From 8c202cee2583dd90996e17f501c99dc3fcc8882a Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 14 Nov 2023 02:41:51 +0900 Subject: [PATCH 01/13] [FEAT] SplashLogging (#156) --- .../domain/logging/CommonLoggingScheme.kt | 67 +++++++++++++++++++ .../android/auth/ui/splash/SplashActivity.kt | 10 +++ .../android/auth/ui/splash/SplashViewModel.kt | 6 ++ 3 files changed, 83 insertions(+) create mode 100644 domain/src/main/java/com/lgtm/domain/logging/CommonLoggingScheme.kt diff --git a/domain/src/main/java/com/lgtm/domain/logging/CommonLoggingScheme.kt b/domain/src/main/java/com/lgtm/domain/logging/CommonLoggingScheme.kt new file mode 100644 index 00000000..3c2b4160 --- /dev/null +++ b/domain/src/main/java/com/lgtm/domain/logging/CommonLoggingScheme.kt @@ -0,0 +1,67 @@ +package com.lgtm.domain.logging + +import com.swm.logging.android.logging_scheme.ClickScheme +import java.lang.reflect.Type + +class CommonLoggingScheme( + eventLogName: String, + screenName: String, + logVersion: String, + logData: Map, +) : ClickScheme() { + + init { + setLoggingScheme( + eventLogName = eventLogName, + screenName = screenName, + logVersion = logVersion, + logData = logData.toMutableMap() + ) + } + + class Builder { + private lateinit var eventLogName: String + private lateinit var screenName: String + private var logVersion: String = "1" + private var map = mutableMapOf() + + fun setEventLogName(eventLogName: String): Builder { + this.eventLogName = eventLogName + return this + } + + fun setScreenName(screenName: String): Builder { + this.screenName = screenName + return this + } + + fun setScreenName(type: Type): Builder { + check(type is Class<*>) + this.screenName = type.simpleName + return this + } + + + fun setLogData(map: Map): Builder { + this.map = map.toMutableMap() + return this + } + + fun setLogVersion(logVersion: Int): Builder { + this.logVersion = logVersion.toString() + return this + } + + fun build(): CommonLoggingScheme { + check(::eventLogName.isInitialized) { "eventLogName is not initialized" } + check(::screenName.isInitialized) { "screenName is not initialized" } + + return CommonLoggingScheme( + eventLogName, + screenName, + logVersion, + map + ) + } + } +} \ No newline at end of file diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/splash/SplashActivity.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/splash/SplashActivity.kt index bdd06d23..5e1c3c5d 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/splash/SplashActivity.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/splash/SplashActivity.kt @@ -13,6 +13,7 @@ import com.lgtm.android.auth.databinding.ActivitySplashBinding import com.lgtm.android.auth.ui.SignInActivity import com.lgtm.android.auth.ui.SystemMaintenanceActivity import com.lgtm.android.common_ui.base.BaseActivity +import com.lgtm.domain.logging.CommonLoggingScheme import dagger.hilt.android.AndroidEntryPoint @AndroidEntryPoint @@ -28,6 +29,15 @@ class SplashActivity : BaseActivity(R.layout.activity_spl observeCurrentVersion() checkAutoLoginState() startNextActivityAfterDelay() + shotSplashExposureLogging() + } + + private fun shotSplashExposureLogging() { + val scheme = CommonLoggingScheme.Builder() + .setEventLogName("splashExposure") + .setScreenName(this.javaClass) + .build() + splashViewModel.shotSplashExposureLogging(scheme) } override fun onResume() { diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/splash/SplashViewModel.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/splash/SplashViewModel.kt index ba34611a..2b62f3ca 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/splash/SplashViewModel.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/splash/SplashViewModel.kt @@ -14,6 +14,8 @@ import com.google.firebase.remoteconfig.ktx.remoteConfigSettings import com.lgtm.android.common_ui.base.BaseViewModel import com.lgtm.domain.repository.AuthRepository import com.lgtm.domain.repository.IntroRepository +import com.swm.logging.android.SWMLogging +import com.swm.logging.android.logging_scheme.SWMLoggingScheme import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.launch import javax.inject.Inject @@ -97,6 +99,10 @@ class SplashViewModel @Inject constructor( return authRepository.isAutoLoginAvailable() } + fun shotSplashExposureLogging(swmLoggingScheme: SWMLoggingScheme) { + SWMLogging.logEvent(swmLoggingScheme) + } + companion object { private const val IS_SYSTEM_MAINTENANCE = "isSystemUnderMaintenance" } From 27a39a0973f3b70aed0373f34a80f95c06999d1e Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 14 Nov 2023 02:49:08 +0900 Subject: [PATCH 02/13] [FEAT] SignIn ExposureLogging (#156) --- ...mmonLoggingScheme.kt => SwmCommonLoggingScheme.kt} | 10 +++++----- .../java/com/lgtm/android/auth/ui/SignInActivity.kt | 11 +++++++++++ .../java/com/lgtm/android/auth/ui/SignInViewModel.kt | 6 ++++++ .../com/lgtm/android/auth/ui/splash/SplashActivity.kt | 4 ++-- .../main/java/com/swm/logging/android/SWMLogging.kt | 2 +- 5 files changed, 25 insertions(+), 8 deletions(-) rename domain/src/main/java/com/lgtm/domain/logging/{CommonLoggingScheme.kt => SwmCommonLoggingScheme.kt} (88%) diff --git a/domain/src/main/java/com/lgtm/domain/logging/CommonLoggingScheme.kt b/domain/src/main/java/com/lgtm/domain/logging/SwmCommonLoggingScheme.kt similarity index 88% rename from domain/src/main/java/com/lgtm/domain/logging/CommonLoggingScheme.kt rename to domain/src/main/java/com/lgtm/domain/logging/SwmCommonLoggingScheme.kt index 3c2b4160..809c3c35 100644 --- a/domain/src/main/java/com/lgtm/domain/logging/CommonLoggingScheme.kt +++ b/domain/src/main/java/com/lgtm/domain/logging/SwmCommonLoggingScheme.kt @@ -1,14 +1,14 @@ package com.lgtm.domain.logging -import com.swm.logging.android.logging_scheme.ClickScheme +import com.swm.logging.android.logging_scheme.SWMLoggingScheme import java.lang.reflect.Type -class CommonLoggingScheme( +class SwmCommonLoggingScheme( eventLogName: String, screenName: String, logVersion: String, logData: Map, -) : ClickScheme() { +) : SWMLoggingScheme() { init { setLoggingScheme( @@ -52,11 +52,11 @@ class CommonLoggingScheme( return this } - fun build(): CommonLoggingScheme { + fun build(): SwmCommonLoggingScheme { check(::eventLogName.isInitialized) { "eventLogName is not initialized" } check(::screenName.isInitialized) { "screenName is not initialized" } - return CommonLoggingScheme( + return SwmCommonLoggingScheme( eventLogName, screenName, logVersion, diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/SignInActivity.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/SignInActivity.kt index 23258c5e..8348dd51 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/SignInActivity.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/SignInActivity.kt @@ -14,6 +14,7 @@ import com.lgtm.android.auth.ui.signup.SignUpActivity import com.lgtm.android.common_ui.base.BaseActivity import com.lgtm.android.common_ui.util.NetworkState import com.lgtm.android.common_ui.util.setOnThrottleClickListener +import com.lgtm.domain.logging.SwmCommonLoggingScheme import dagger.hilt.android.AndroidEntryPoint @AndroidEntryPoint @@ -31,6 +32,7 @@ class SignInActivity : BaseActivity(R.layout.activity_sig initClickListener() observeGithubLoginResponse() observePatchDeviceTokenStatus() + shotSignInExposureLogging() } private fun setAnimationOnGithubButton() { @@ -118,6 +120,15 @@ class SignInActivity : BaseActivity(R.layout.activity_sig Toast.makeText(this, message, Toast.LENGTH_SHORT).show() } + private fun shotSignInExposureLogging() { + val scheme = SwmCommonLoggingScheme.Builder() + .setEventLogName("signInExposure") + .setScreenName(this.javaClass) + .build() + signInViewModel.shotSignInExposureLogging(scheme) + } + + companion object { const val MEMBER_DATA = "memberData" } diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/SignInViewModel.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/SignInViewModel.kt index e9574a39..bca4d29e 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/SignInViewModel.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/SignInViewModel.kt @@ -13,6 +13,8 @@ import com.lgtm.android.common_ui.util.NetworkState import com.lgtm.domain.entity.LgtmResponseException import com.lgtm.domain.entity.response.GithubLoginResponse import com.lgtm.domain.repository.AuthRepository +import com.swm.logging.android.SWMLogging +import com.swm.logging.android.logging_scheme.SWMLoggingScheme import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.launch import javax.inject.Inject @@ -86,4 +88,8 @@ class SignInViewModel @Inject constructor( } } } + + fun shotSignInExposureLogging(scheme: SWMLoggingScheme) { + SWMLogging.logEvent(scheme) + } } diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/splash/SplashActivity.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/splash/SplashActivity.kt index 5e1c3c5d..56b9f0cf 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/splash/SplashActivity.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/splash/SplashActivity.kt @@ -13,7 +13,7 @@ import com.lgtm.android.auth.databinding.ActivitySplashBinding import com.lgtm.android.auth.ui.SignInActivity import com.lgtm.android.auth.ui.SystemMaintenanceActivity import com.lgtm.android.common_ui.base.BaseActivity -import com.lgtm.domain.logging.CommonLoggingScheme +import com.lgtm.domain.logging.SwmCommonLoggingScheme import dagger.hilt.android.AndroidEntryPoint @AndroidEntryPoint @@ -33,7 +33,7 @@ class SplashActivity : BaseActivity(R.layout.activity_spl } private fun shotSplashExposureLogging() { - val scheme = CommonLoggingScheme.Builder() + val scheme = SwmCommonLoggingScheme.Builder() .setEventLogName("splashExposure") .setScreenName(this.javaClass) .build() diff --git a/swm-logging/src/main/java/com/swm/logging/android/SWMLogging.kt b/swm-logging/src/main/java/com/swm/logging/android/SWMLogging.kt index 5d7a202a..d51a35ce 100644 --- a/swm-logging/src/main/java/com/swm/logging/android/SWMLogging.kt +++ b/swm-logging/src/main/java/com/swm/logging/android/SWMLogging.kt @@ -72,7 +72,7 @@ object SWMLogging { observable.onNext(swmLoggingScheme) } - suspend fun shotLogging(swmLoggingScheme: SWMLoggingScheme): Response { + private suspend fun shotLogging(swmLoggingScheme: SWMLoggingScheme): Response { checkInitialized() return loggingService.postLogging(serverPath, swmLoggingScheme) } From 3b46bae06b138650682219093fc0857716a2b848 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 14 Nov 2023 02:59:18 +0900 Subject: [PATCH 03/13] [FEAT] SignUpActivity ExposureLogging (#156) --- .../com/lgtm/android/auth/ui/signup/SignUpActivity.kt | 10 ++++++++++ .../com/lgtm/android/auth/ui/signup/SignUpViewModel.kt | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpActivity.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpActivity.kt index f733e866..16a1c94d 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpActivity.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpActivity.kt @@ -6,6 +6,7 @@ import com.lgtm.android.auth.R import com.lgtm.android.auth.databinding.ActivitySignUpBinding import com.lgtm.android.auth.ui.SignInActivity.Companion.MEMBER_DATA import com.lgtm.android.common_ui.base.BaseActivity +import com.lgtm.domain.logging.SwmCommonLoggingScheme import dagger.hilt.android.AndroidEntryPoint @AndroidEntryPoint @@ -14,6 +15,7 @@ class SignUpActivity : BaseActivity(R.layout.activity_sig override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) getExtraData() + shotSignUpExposureLogging() } override fun initializeViewModel() { @@ -24,4 +26,12 @@ class SignUpActivity : BaseActivity(R.layout.activity_sig val memberDataJson = intent.getStringExtra(MEMBER_DATA) ?: return signUpViewModel.parseAndSetMemberDataJson(memberDataJson) } + + private fun shotSignUpExposureLogging() { + val scheme = SwmCommonLoggingScheme.Builder() + .setEventLogName("signUpExposure") + .setScreenName(this.javaClass) + .build() + signUpViewModel.shotSignUpExposureLogging(scheme) + } } \ No newline at end of file diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt index ae3ad35e..580334b4 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt @@ -23,6 +23,8 @@ import com.lgtm.domain.entity.request.SignUpSeniorRequestVO import com.lgtm.domain.entity.response.MemberDataDTO import com.lgtm.domain.entity.response.SignUpResponseVO import com.lgtm.domain.repository.AuthRepository +import com.swm.logging.android.SWMLogging +import com.swm.logging.android.logging_scheme.SWMLoggingScheme import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.launch import javax.inject.Inject @@ -421,6 +423,10 @@ class SignUpViewModel @Inject constructor( } } + fun shotSignUpExposureLogging(scheme : SWMLoggingScheme) { + SWMLogging.logEvent(scheme) + } + companion object { private const val ONE_MONTH = 1 private const val ONE_YEAR = 12 From 2554f1fd48014703f56e6869dacd7455b448e5a6 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 14 Nov 2023 03:50:42 +0900 Subject: [PATCH 04/13] =?UTF-8?q?[FEAT]=20BaseViewModel=EC=97=90=20shotSwm?= =?UTF-8?q?Logging=20=EC=B6=94=EA=B0=80=20(#156)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/lgtm/android/common_ui/base/BaseViewModel.kt | 6 ++++++ .../java/com/lgtm/android/auth/ui/signup/SignUpActivity.kt | 2 +- .../java/com/lgtm/android/auth/ui/splash/SplashActivity.kt | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/base/BaseViewModel.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/base/BaseViewModel.kt index 17256330..aa196346 100644 --- a/common-ui/src/main/java/com/lgtm/android/common_ui/base/BaseViewModel.kt +++ b/common-ui/src/main/java/com/lgtm/android/common_ui/base/BaseViewModel.kt @@ -6,6 +6,8 @@ import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import com.lgtm.domain.entity.LgtmResponseException +import com.lgtm.domain.logging.SwmCommonLoggingScheme +import com.swm.logging.android.SWMLogging import kotlinx.coroutines.CoroutineExceptionHandler abstract class BaseViewModel : ViewModel() { @@ -30,4 +32,8 @@ abstract class BaseViewModel : ViewModel() { } } } + + fun shotSwmLogging(scheme : SwmCommonLoggingScheme) { + SWMLogging.logEvent(scheme) + } } diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpActivity.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpActivity.kt index 16a1c94d..c33a1374 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpActivity.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpActivity.kt @@ -32,6 +32,6 @@ class SignUpActivity : BaseActivity(R.layout.activity_sig .setEventLogName("signUpExposure") .setScreenName(this.javaClass) .build() - signUpViewModel.shotSignUpExposureLogging(scheme) + viewModel?.shotSwmLogging(scheme) } } \ No newline at end of file diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/splash/SplashActivity.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/splash/SplashActivity.kt index 56b9f0cf..02c6dc67 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/splash/SplashActivity.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/splash/SplashActivity.kt @@ -37,7 +37,7 @@ class SplashActivity : BaseActivity(R.layout.activity_spl .setEventLogName("splashExposure") .setScreenName(this.javaClass) .build() - splashViewModel.shotSplashExposureLogging(scheme) + viewModel?.shotSwmLogging(scheme) } override fun onResume() { From c16f1b4925900abcd7675a70b83980827d24fa22 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 14 Nov 2023 03:51:10 +0900 Subject: [PATCH 05/13] =?UTF-8?q?[FEAT]=20TermsFragment=20-=20=EC=9D=B4?= =?UTF-8?q?=EC=9A=A9=EC=95=BD=EA=B4=80,=20=EA=B0=9C=EC=9D=B8=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20=EC=B2=98=EB=A6=AC=EB=B0=A9=EC=B9=A8=20=ED=81=B4?= =?UTF-8?q?=EB=A6=AD=20=EB=A1=9C=EA=B9=85=20(#156)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../auth/ui/signup/common/TermsFragment.kt | 38 +++++++++++++++++-- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/TermsFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/TermsFragment.kt index 37a5ec71..a339441e 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/TermsFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/TermsFragment.kt @@ -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 @@ -25,6 +26,7 @@ class TermsFragment : BaseFragment(R.layout.fragment_terms setUpCheckBoxListeners() setUpTextViewListener() setupNextButtonListener() + shotTermsExposureLogging() } private fun setupNextButtonListener() { @@ -45,13 +47,31 @@ class TermsFragment : BaseFragment(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) @@ -88,7 +108,7 @@ class TermsFragment : BaseFragment(R.layout.fragment_terms } } - private fun toggleTermsAll(){ + private fun toggleTermsAll() { binding.cbTermsAll.isChecked = !binding.cbTermsAll.isChecked } @@ -109,12 +129,22 @@ class TermsFragment : BaseFragment(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" } } From ae0f13881c97c49ab9528336d5b5ae2b1113bb4e Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 14 Nov 2023 03:53:30 +0900 Subject: [PATCH 06/13] [FEAT] NickNameFragment ExposureLogging (#156) --- .../com/lgtm/domain/logging/SwmCommonLoggingScheme.kt | 4 ++-- .../com/lgtm/android/auth/ui/signup/SignUpActivity.kt | 10 ---------- .../android/auth/ui/signup/common/NicknameFragment.kt | 11 +++++++++++ .../android/auth/ui/signup/common/TermsFragment.kt | 6 +++--- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/domain/src/main/java/com/lgtm/domain/logging/SwmCommonLoggingScheme.kt b/domain/src/main/java/com/lgtm/domain/logging/SwmCommonLoggingScheme.kt index 809c3c35..e01143db 100644 --- a/domain/src/main/java/com/lgtm/domain/logging/SwmCommonLoggingScheme.kt +++ b/domain/src/main/java/com/lgtm/domain/logging/SwmCommonLoggingScheme.kt @@ -23,7 +23,7 @@ class SwmCommonLoggingScheme( private lateinit var eventLogName: String private lateinit var screenName: String private var logVersion: String = "1" - private var map = mutableMapOf() + private var map = mapOf() fun setEventLogName(eventLogName: String): Builder { this.eventLogName = eventLogName @@ -43,7 +43,7 @@ class SwmCommonLoggingScheme( fun setLogData(map: Map): Builder { - this.map = map.toMutableMap() + this.map = map return this } diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpActivity.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpActivity.kt index c33a1374..f733e866 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpActivity.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpActivity.kt @@ -6,7 +6,6 @@ import com.lgtm.android.auth.R import com.lgtm.android.auth.databinding.ActivitySignUpBinding import com.lgtm.android.auth.ui.SignInActivity.Companion.MEMBER_DATA import com.lgtm.android.common_ui.base.BaseActivity -import com.lgtm.domain.logging.SwmCommonLoggingScheme import dagger.hilt.android.AndroidEntryPoint @AndroidEntryPoint @@ -15,7 +14,6 @@ class SignUpActivity : BaseActivity(R.layout.activity_sig override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) getExtraData() - shotSignUpExposureLogging() } override fun initializeViewModel() { @@ -26,12 +24,4 @@ class SignUpActivity : BaseActivity(R.layout.activity_sig val memberDataJson = intent.getStringExtra(MEMBER_DATA) ?: return signUpViewModel.parseAndSetMemberDataJson(memberDataJson) } - - private fun shotSignUpExposureLogging() { - val scheme = SwmCommonLoggingScheme.Builder() - .setEventLogName("signUpExposure") - .setScreenName(this.javaClass) - .build() - viewModel?.shotSwmLogging(scheme) - } } \ No newline at end of file diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/NicknameFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/NicknameFragment.kt index 8df858fd..e221865a 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/NicknameFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/NicknameFragment.kt @@ -9,6 +9,7 @@ import com.lgtm.android.auth.databinding.FragmentNicknameBinding 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 @@ -24,6 +25,16 @@ class NicknameFragment : BaseFragment(R.layout.fragment setupEditText() onNicknameChanged() setupNextButtonListener() + shotNickNameExposureLogging() + } + + private fun shotNickNameExposureLogging() { + val scheme = SwmCommonLoggingScheme.Builder() + .setEventLogName("nicknameExposure") + .setScreenName(this.javaClass) + .setLogData(mapOf("signUpStep" to 2)) + .build() + viewModel.shotSwmLogging(scheme) } private fun setupViewModel() { diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/TermsFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/TermsFragment.kt index a339441e..15e7a205 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/TermsFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/TermsFragment.kt @@ -58,7 +58,7 @@ class TermsFragment : BaseFragment(R.layout.fragment_terms private fun shotTermsServiceClickLogging() { val scheme = SwmCommonLoggingScheme.Builder() - .setEventLogName("TermsServiceClick") + .setEventLogName("termsServiceClick") .setScreenName(this.javaClass) .build() viewModel.shotSwmLogging(scheme) @@ -66,7 +66,7 @@ class TermsFragment : BaseFragment(R.layout.fragment_terms private fun shotTermsPrivacyClickLogging() { val scheme = SwmCommonLoggingScheme.Builder() - .setEventLogName("TermsPrivacyClick") + .setEventLogName("termsPrivacyClick") .setScreenName(this.javaClass) .build() viewModel.shotSwmLogging(scheme) @@ -131,7 +131,7 @@ class TermsFragment : BaseFragment(R.layout.fragment_terms private fun shotTermsExposureLogging() { val scheme = SwmCommonLoggingScheme.Builder() - .setEventLogName("TermsExposure") + .setEventLogName("termsExposure") .setScreenName(this.javaClass) .setLogData(mapOf("signUpStep" to 1)) .build() From bdcab41e08c264932c18f1ba2079d425755762b6 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 14 Nov 2023 04:06:50 +0900 Subject: [PATCH 07/13] [FEAT] IntroductionFragment ExposureLogging (#156) --- .../auth/ui/signup/common/IntroductionFragment.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/IntroductionFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/IntroductionFragment.kt index 3db93144..262c0c35 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/IntroductionFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/IntroductionFragment.kt @@ -9,6 +9,7 @@ import com.lgtm.android.auth.databinding.FragmentIntroductionBinding 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 @@ -24,6 +25,7 @@ class IntroductionFragment : setupEditText() onIntroductionChanged() setupNextButtonListener() + shotIntroductionExposureLogging() } private fun setupViewModel() { @@ -55,4 +57,13 @@ class IntroductionFragment : private fun navigateToSelectRoleFragment() { findNavController().navigate(R.id.action_introductionFragment_to_chooseRoleFragment) } + + private fun shotIntroductionExposureLogging() { + val scheme = SwmCommonLoggingScheme.Builder() + .setEventLogName("introductionExposure") + .setScreenName(this.javaClass) + .setLogData(mapOf("signUpStep" to 3)) + .build() + viewModel.shotSwmLogging(scheme) + } } \ No newline at end of file From c6e0ac7f2e897a047459a25e6806960763ca807a Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 14 Nov 2023 04:07:34 +0900 Subject: [PATCH 08/13] [FEAT] ChooseRoleFragment ExposureLogging (#156) --- .../auth/ui/signup/common/ChooseRoleFragment.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/ChooseRoleFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/ChooseRoleFragment.kt index ba57a398..0c4ba3bc 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/ChooseRoleFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/ChooseRoleFragment.kt @@ -10,6 +10,7 @@ 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.constants.Role +import com.lgtm.domain.logging.SwmCommonLoggingScheme import dagger.hilt.android.AndroidEntryPoint @AndroidEntryPoint @@ -23,6 +24,7 @@ class ChooseRoleFragment : BaseFragment(R.layout.frag setupViewModel() observeSelectedRole() setupNextButtonListener() + shotChooseRoleExposureLogging() } private fun observeSelectedRole() { @@ -53,4 +55,13 @@ class ChooseRoleFragment : BaseFragment(R.layout.frag findNavController().navigate(R.id.action_chooseRoleFragment_to_companyNameFragment) } + private fun shotChooseRoleExposureLogging() { + val scheme = SwmCommonLoggingScheme.Builder() + .setEventLogName("chooseRoleExposure") + .setScreenName(this.javaClass) + .setLogData(mapOf("signUpStep" to 4)) + .build() + viewModel.shotSwmLogging(scheme) + } + } \ No newline at end of file From 53b47da02d33f4c4b4ef7e3231525edf9ac2459c Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 14 Nov 2023 04:11:41 +0900 Subject: [PATCH 09/13] [FEAT] EducationStatus ExposureLogging (#156) --- .../ui/signup/reviewee/EducationStatusFragment.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/EducationStatusFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/EducationStatusFragment.kt index 791696ce..d1d0693a 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/EducationStatusFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/EducationStatusFragment.kt @@ -17,6 +17,7 @@ import com.lgtm.android.common_ui.R.style import com.lgtm.android.common_ui.base.BaseFragment import com.lgtm.android.common_ui.util.setOnThrottleClickListener import com.lgtm.domain.constants.EducationStatus +import com.lgtm.domain.logging.SwmCommonLoggingScheme class EducationStatusFragment : @@ -31,6 +32,7 @@ class EducationStatusFragment : setupViewModel() fetchEducationStatus() setupNextButtonListener() + shotEducationStatusExposureLogging() } private fun setupRadioButtons() { @@ -90,4 +92,13 @@ class EducationStatusFragment : private fun navigateToRealNameActivity() { findNavController().navigate(R.id.action_educationStatusFragment_to_realNameFragment) } + + private fun shotEducationStatusExposureLogging() { + val scheme = SwmCommonLoggingScheme.Builder() + .setEventLogName("educationStatusExposure") + .setScreenName(this.javaClass) + .setLogData(mapOf("signUpStep" to 5, "juniorStep" to 1)) + .build() + viewModel.shotSwmLogging(scheme) + } } \ No newline at end of file From da9cb8ce9c1f54c12752abfa43ad8cafeaf6984f Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 14 Nov 2023 04:11:51 +0900 Subject: [PATCH 10/13] [FEAT] RealNameFragment ExposureLogging (#156) --- .../auth/ui/signup/reviewee/RealNameFragment.kt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/RealNameFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/RealNameFragment.kt index df4511d3..02ec71b0 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/RealNameFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/RealNameFragment.kt @@ -1,17 +1,16 @@ package com.lgtm.android.auth.ui.signup.reviewee -import android.content.Intent import android.os.Bundle import android.view.View import android.widget.Toast import androidx.fragment.app.activityViewModels import com.lgtm.android.auth.R import com.lgtm.android.auth.databinding.FragmentRealNameBinding -import com.lgtm.android.auth.ui.SignInActivity import com.lgtm.android.auth.ui.signup.SignUpViewModel import com.lgtm.android.common_ui.base.BaseFragment import com.lgtm.android.common_ui.util.NetworkState import com.lgtm.android.common_ui.util.setOnThrottleClickListener +import com.lgtm.domain.logging.SwmCommonLoggingScheme class RealNameFragment : BaseFragment(R.layout.fragment_real_name) { @@ -26,6 +25,7 @@ class RealNameFragment : BaseFragment(R.layout.fragment onRealNameChanged() setupCompleteButtonListener() observeSignUpStatus() + shotRealNameExposureLogging() } private fun setupViewModel() { @@ -75,9 +75,13 @@ class RealNameFragment : BaseFragment(R.layout.fragment lgtmNavigator.navigateToMain(requireContext()) } - private fun navigateToSignInActivity() { - startActivity(Intent(requireContext(), SignInActivity::class.java)) + private fun shotRealNameExposureLogging() { + val scheme = SwmCommonLoggingScheme.Builder() + .setEventLogName("realNameExposure") + .setScreenName(this.javaClass) + .setLogData(mapOf("signUpStep" to 6, "juniorStep" to 2)) + .build() + viewModel.shotSwmLogging(scheme) } - } \ No newline at end of file From f856e9fecd1f1e0381543c8d0fabbe9a347f7ec5 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 14 Nov 2023 04:12:20 +0900 Subject: [PATCH 11/13] [FEAT] Set Throttle time limit to 0.3sec (#156) --- swm-logging/src/main/java/com/swm/logging/android/SWMLogging.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swm-logging/src/main/java/com/swm/logging/android/SWMLogging.kt b/swm-logging/src/main/java/com/swm/logging/android/SWMLogging.kt index d51a35ce..947aa395 100644 --- a/swm-logging/src/main/java/com/swm/logging/android/SWMLogging.kt +++ b/swm-logging/src/main/java/com/swm/logging/android/SWMLogging.kt @@ -101,7 +101,7 @@ object SWMLogging { this.userID = userID this.region = region setLoggingService() - observable.throttleFirst(500, TimeUnit.MILLISECONDS).subscribe(observer) + observable.throttleFirst(300, TimeUnit.MILLISECONDS).subscribe(observer) } private fun setLoggingService() { From 38df1206deaaba59c283bbd8c03a6433f7e5481a Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 14 Nov 2023 05:00:48 +0900 Subject: [PATCH 12/13] [FEAT] SignUp Process ExposureLogging Complete (#156) --- .../android/auth/ui/signup/SignUpViewModel.kt | 16 ++++++---- .../ui/signup/common/ChooseRoleFragment.kt | 2 +- .../ui/signup/common/IntroductionFragment.kt | 2 +- .../auth/ui/signup/common/TechTagFragment.kt | 11 +++++++ .../reviewee/EducationStatusFragment.kt | 2 +- .../ui/signup/reviewee/RealNameFragment.kt | 3 +- .../ui/signup/reviewer/BankAccountFragment.kt | 31 ++++++++++++++----- .../signup/reviewer/CareerPeriodFragment.kt | 11 +++++++ .../ui/signup/reviewer/CompanyNameFragment.kt | 11 +++++++ .../ui/signup/reviewer/PositionFragment.kt | 11 +++++++ 10 files changed, 83 insertions(+), 17 deletions(-) diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt index 580334b4..b4e987d4 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt @@ -23,8 +23,6 @@ import com.lgtm.domain.entity.request.SignUpSeniorRequestVO import com.lgtm.domain.entity.response.MemberDataDTO import com.lgtm.domain.entity.response.SignUpResponseVO import com.lgtm.domain.repository.AuthRepository -import com.swm.logging.android.SWMLogging -import com.swm.logging.android.logging_scheme.SWMLoggingScheme import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.launch import javax.inject.Inject @@ -314,14 +312,14 @@ class SignUpViewModel @Inject constructor( } private val _accountNumber = MutableLiveData() - private val accountNumber: LiveData = _accountNumber + val accountNumber: LiveData = _accountNumber fun setAccountNumber(number: String) { _accountNumber.value = number } private val _accountHolder = MutableLiveData() - private val accountHolder: LiveData = _accountHolder + val accountHolder: LiveData = _accountHolder fun setAccountHolder(holder: String) { _accountHolder.value = holder @@ -423,8 +421,14 @@ class SignUpViewModel @Inject constructor( } } - fun shotSignUpExposureLogging(scheme : SWMLoggingScheme) { - SWMLogging.logEvent(scheme) + fun clearSignUpState() { + _signUpState.value = NetworkState.Init + } + + private val _selectedBankIdx = MutableLiveData() + val selectedBankIdx: LiveData = _selectedBankIdx + fun setSelectedBankIdx(position: Int) { + _selectedBankIdx.value = position } companion object { diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/ChooseRoleFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/ChooseRoleFragment.kt index 0c4ba3bc..ec3be9ea 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/ChooseRoleFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/ChooseRoleFragment.kt @@ -59,7 +59,7 @@ class ChooseRoleFragment : BaseFragment(R.layout.frag val scheme = SwmCommonLoggingScheme.Builder() .setEventLogName("chooseRoleExposure") .setScreenName(this.javaClass) - .setLogData(mapOf("signUpStep" to 4)) + .setLogData(mapOf("signUpStep" to 5)) .build() viewModel.shotSwmLogging(scheme) } diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/IntroductionFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/IntroductionFragment.kt index 262c0c35..ab9a5c89 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/IntroductionFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/IntroductionFragment.kt @@ -62,7 +62,7 @@ class IntroductionFragment : val scheme = SwmCommonLoggingScheme.Builder() .setEventLogName("introductionExposure") .setScreenName(this.javaClass) - .setLogData(mapOf("signUpStep" to 3)) + .setLogData(mapOf("signUpStep" to 4)) .build() viewModel.shotSwmLogging(scheme) } diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/TechTagFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/TechTagFragment.kt index 7924ada3..70f16bc2 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/TechTagFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/TechTagFragment.kt @@ -11,6 +11,7 @@ import com.lgtm.android.common_ui.base.BaseFragment import com.lgtm.android.common_ui.util.TechTagChipGroup import com.lgtm.android.common_ui.util.TechTagTheme import com.lgtm.android.common_ui.util.setOnThrottleClickListener +import com.lgtm.domain.logging.SwmCommonLoggingScheme import dagger.hilt.android.AndroidEntryPoint @AndroidEntryPoint @@ -25,6 +26,7 @@ class TechTagFragment : BaseFragment(R.layout.fragment_t setChips() observeTechTagList() setupNextButtonListener() + shotTechTagExposureLogging() } private fun setupViewModel() { @@ -53,4 +55,13 @@ class TechTagFragment : BaseFragment(R.layout.fragment_t private fun navigateToIntroductionFragment() { findNavController().navigate(R.id.action_techTagFragment_to_introductionFragment) } + + private fun shotTechTagExposureLogging() { + val scheme = SwmCommonLoggingScheme.Builder() + .setEventLogName("techTagExposure") + .setScreenName(this.javaClass) + .setLogData(mapOf("signUpStep" to 3)) + .build() + viewModel.shotSwmLogging(scheme) + } } \ No newline at end of file diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/EducationStatusFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/EducationStatusFragment.kt index d1d0693a..52b7c85f 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/EducationStatusFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/EducationStatusFragment.kt @@ -97,7 +97,7 @@ class EducationStatusFragment : val scheme = SwmCommonLoggingScheme.Builder() .setEventLogName("educationStatusExposure") .setScreenName(this.javaClass) - .setLogData(mapOf("signUpStep" to 5, "juniorStep" to 1)) + .setLogData(mapOf("signUpStep" to 6, "juniorStep" to 1)) .build() viewModel.shotSwmLogging(scheme) } diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/RealNameFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/RealNameFragment.kt index 02ec71b0..58441a5e 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/RealNameFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/RealNameFragment.kt @@ -66,6 +66,7 @@ class RealNameFragment : BaseFragment(R.layout.fragment is NetworkState.Failure -> { Toast.makeText(requireContext(), it.msg, Toast.LENGTH_SHORT).show() + signUpViewModel.clearSignUpState() } } } @@ -79,7 +80,7 @@ class RealNameFragment : BaseFragment(R.layout.fragment val scheme = SwmCommonLoggingScheme.Builder() .setEventLogName("realNameExposure") .setScreenName(this.javaClass) - .setLogData(mapOf("signUpStep" to 6, "juniorStep" to 2)) + .setLogData(mapOf("signUpStep" to 7, "juniorStep" to 2)) .build() viewModel.shotSwmLogging(scheme) } diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/BankAccountFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/BankAccountFragment.kt index d0cd6e9d..bc94cd05 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/BankAccountFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/BankAccountFragment.kt @@ -1,7 +1,8 @@ package com.lgtm.android.auth.ui.signup.reviewer -import android.content.Intent +import android.content.ContentValues.TAG import android.os.Bundle +import android.util.Log import android.view.View import android.widget.AdapterView import android.widget.Toast @@ -9,7 +10,6 @@ import androidx.core.widget.addTextChangedListener import androidx.fragment.app.activityViewModels import com.lgtm.android.auth.R import com.lgtm.android.auth.databinding.FragmentBankAccountBinding -import com.lgtm.android.auth.ui.SignInActivity import com.lgtm.android.auth.ui.signup.SignUpViewModel import com.lgtm.android.common_ui.R.layout import com.lgtm.android.common_ui.adapter.BankSpinnerAdapter @@ -17,10 +17,12 @@ import com.lgtm.android.common_ui.base.BaseFragment import com.lgtm.android.common_ui.constant.Bank import com.lgtm.android.common_ui.util.NetworkState import com.lgtm.android.common_ui.util.setOnThrottleClickListener +import com.lgtm.domain.logging.SwmCommonLoggingScheme class BankAccountFragment : BaseFragment(R.layout.fragment_bank_account) { private val signUpViewModel by activityViewModels() + private lateinit var bankAdapter : BankSpinnerAdapter override fun initializeViewModel() { viewModel = signUpViewModel } @@ -29,16 +31,25 @@ class BankAccountFragment : setupViewModel() onAccountNumberChanged() setupBankSpinner() + setEnteredData() onBankSelectedListener() setupCompleteButtonListener() - observeSignUpStatus() onAccountHolderChanged() + observeSignUpStatus() + shotBankAccountExposureLogging() } private fun setupViewModel() { binding.viewModel = signUpViewModel } + private fun setEnteredData(){ + Log.d(TAG, "setEnteredData: ${signUpViewModel.selectedBankIdx.value}") + binding.spBank.setSelection(signUpViewModel.selectedBankIdx.value ?: 0) + binding.etBankAccount.setText(signUpViewModel.accountNumber.value) + binding.etAccountHolder.setText(signUpViewModel.accountHolder.value) + } + private fun onAccountNumberChanged() { binding.etBankAccount.addTextChangedListener { signUpViewModel.setAccountNumber(it.toString()) @@ -47,8 +58,7 @@ class BankAccountFragment : } private fun setupBankSpinner() { - val bankAdapter = - BankSpinnerAdapter(requireContext(), layout.item_bank_spinner, signUpViewModel.bankList) + bankAdapter = BankSpinnerAdapter(requireContext(), layout.item_bank_spinner, signUpViewModel.bankList) binding.spBank.adapter = bankAdapter } @@ -58,6 +68,7 @@ class BankAccountFragment : parent: AdapterView<*>?, view: View?, position: Int, id: Long ) { if (position == 0) return // Pos 0 Indicate Hint + signUpViewModel.setSelectedBankIdx(position) signUpViewModel.setSelectedBank(signUpViewModel.bankList[position] as Bank) signUpViewModel.setIsAccountInfoValid() } @@ -93,6 +104,7 @@ class BankAccountFragment : is NetworkState.Failure -> { Toast.makeText(requireContext(), it.msg, Toast.LENGTH_SHORT).show() + signUpViewModel.clearSignUpState() } } } @@ -102,8 +114,13 @@ class BankAccountFragment : lgtmNavigator.navigateToMain(requireContext()) } - private fun navigateToSignInActivity() { - startActivity(Intent(requireContext(), SignInActivity::class.java)) + private fun shotBankAccountExposureLogging() { + val scheme = SwmCommonLoggingScheme.Builder() + .setEventLogName("bankAccountExposure") + .setScreenName(this.javaClass) + .setLogData(mapOf("signUpStep" to 9, "seniorStep" to 4)) + .build() + viewModel.shotSwmLogging(scheme) } } \ No newline at end of file diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/CareerPeriodFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/CareerPeriodFragment.kt index 9d559365..c663c7cb 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/CareerPeriodFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/CareerPeriodFragment.kt @@ -10,6 +10,7 @@ import com.lgtm.android.auth.databinding.FragmentCareerPeriodBinding 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 class CareerPeriodFragment : @@ -23,6 +24,7 @@ class CareerPeriodFragment : setupViewModel() onCareerPeriodChanged() setupNextButtonListener() + shotCareerPeriodExposureLogging() } @@ -49,4 +51,13 @@ class CareerPeriodFragment : findNavController().navigate(R.id.action_careerPeriodFragment_to_bankAccountFragment) } + private fun shotCareerPeriodExposureLogging() { + val scheme = SwmCommonLoggingScheme.Builder() + .setEventLogName("careerExposure") + .setScreenName(this.javaClass) + .setLogData(mapOf("signUpStep" to 8, "seniorStep" to 3)) + .build() + viewModel.shotSwmLogging(scheme) + } + } \ No newline at end of file diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/CompanyNameFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/CompanyNameFragment.kt index 3fafb1ad..0c09e39f 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/CompanyNameFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/CompanyNameFragment.kt @@ -9,6 +9,7 @@ import com.lgtm.android.auth.databinding.FragmentCompanyNameBinding 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 class CompanyNameFragment : BaseFragment(R.layout.fragment_company_name) { @@ -22,6 +23,7 @@ class CompanyNameFragment : setupEditText() onCompanyNameChanged() setupNextButtonListener() + shotCompanyNameExposureLogging() } private fun setupViewModel() { @@ -52,4 +54,13 @@ class CompanyNameFragment : private fun navigateToPositionFragment() { findNavController().navigate(R.id.action_companyNameFragment_to_positionFragment) } + + private fun shotCompanyNameExposureLogging() { + val scheme = SwmCommonLoggingScheme.Builder() + .setEventLogName("companyNameExposure") + .setScreenName(this.javaClass) + .setLogData(mapOf("signUpStep" to 6, "seniorStep" to 1)) + .build() + viewModel.shotSwmLogging(scheme) + } } \ No newline at end of file diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/PositionFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/PositionFragment.kt index 3a73c113..19a38a0a 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/PositionFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/PositionFragment.kt @@ -9,6 +9,7 @@ import com.lgtm.android.auth.databinding.FragmentPositionBinding 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 class PositionFragment : BaseFragment(R.layout.fragment_position) { @@ -22,6 +23,7 @@ class PositionFragment : setupEditText() onPositionNameChanged() setupNextButtonListener() + shotPositionExposureLogging() } private fun setupViewModel() { @@ -52,4 +54,13 @@ class PositionFragment : private fun navigateToPositionFragment() { findNavController().navigate(R.id.action_positionFragment_to_careerPeriodFragment) } + + private fun shotPositionExposureLogging() { + val scheme = SwmCommonLoggingScheme.Builder() + .setEventLogName("positionExposure") + .setScreenName(this.javaClass) + .setLogData(mapOf("signUpStep" to 7, "seniorStep" to 2)) + .build() + viewModel.shotSwmLogging(scheme) + } } \ No newline at end of file From 25238d75a65510aa4a94d6370176de127d9cd2bf Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 14 Nov 2023 05:18:46 +0900 Subject: [PATCH 13/13] =?UTF-8?q?[REFACTOR]=20logging=20=EA=B4=80=EB=A0=A8?= =?UTF-8?q?=20=EC=BD=94=EB=93=9C=EA=B0=80=20domain=20=EB=AA=A8=EB=93=88?= =?UTF-8?q?=EC=9D=84=20=EA=B1=B0=EC=B9=98=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20(#156)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/lgtm/android/di/RepositoryModule.kt | 7 +++++++ .../com/lgtm/android/common_ui/base/BaseViewModel.kt | 6 ------ .../android/data/repository/LoggingRepositoryImpl.kt | 12 ++++++++++++ .../com/lgtm/domain/repository/LoggingRepository.kt | 7 +++++++ .../java/com/lgtm/android/auth/ui/SignInViewModel.kt | 5 +++-- .../lgtm/android/auth/ui/signup/SignUpViewModel.kt | 7 +++++++ .../auth/ui/signup/common/ChooseRoleFragment.kt | 2 +- .../auth/ui/signup/common/IntroductionFragment.kt | 2 +- .../auth/ui/signup/common/NicknameFragment.kt | 2 +- .../android/auth/ui/signup/common/TechTagFragment.kt | 2 +- .../android/auth/ui/signup/common/TermsFragment.kt | 6 +++--- .../ui/signup/reviewee/EducationStatusFragment.kt | 2 +- .../auth/ui/signup/reviewee/RealNameFragment.kt | 2 +- .../auth/ui/signup/reviewer/BankAccountFragment.kt | 2 +- .../auth/ui/signup/reviewer/CareerPeriodFragment.kt | 2 +- .../auth/ui/signup/reviewer/CompanyNameFragment.kt | 2 +- .../auth/ui/signup/reviewer/PositionFragment.kt | 2 +- .../lgtm/android/auth/ui/splash/SplashActivity.kt | 2 +- .../lgtm/android/auth/ui/splash/SplashViewModel.kt | 7 ++++--- 19 files changed, 54 insertions(+), 25 deletions(-) create mode 100644 data/src/main/java/com/lgtm/android/data/repository/LoggingRepositoryImpl.kt create mode 100644 domain/src/main/java/com/lgtm/domain/repository/LoggingRepository.kt diff --git a/app/src/main/java/com/lgtm/android/di/RepositoryModule.kt b/app/src/main/java/com/lgtm/android/di/RepositoryModule.kt index 7f4d97cc..5ca456ac 100644 --- a/app/src/main/java/com/lgtm/android/di/RepositoryModule.kt +++ b/app/src/main/java/com/lgtm/android/di/RepositoryModule.kt @@ -2,11 +2,13 @@ package com.lgtm.android.di import com.lgtm.android.data.repository.AuthRepositoryImpl import com.lgtm.android.data.repository.IntroRepositoryImpl +import com.lgtm.android.data.repository.LoggingRepositoryImpl import com.lgtm.android.data.repository.MissionRepositoryImpl import com.lgtm.android.data.repository.NotificationRepositoryImpl import com.lgtm.android.data.repository.ProfileRepositoryImpl import com.lgtm.domain.repository.AuthRepository import com.lgtm.domain.repository.IntroRepository +import com.lgtm.domain.repository.LoggingRepository import com.lgtm.domain.repository.MissionRepository import com.lgtm.domain.repository.NotificationRepository import com.lgtm.domain.repository.ProfileRepository @@ -44,4 +46,9 @@ interface RepositoryModule { notificationRepositoryImpl: NotificationRepositoryImpl ): NotificationRepository + @Binds + fun bindsLoggingRepository( + loggingRepositoryImpl: LoggingRepositoryImpl + ): LoggingRepository + } \ No newline at end of file diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/base/BaseViewModel.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/base/BaseViewModel.kt index aa196346..17256330 100644 --- a/common-ui/src/main/java/com/lgtm/android/common_ui/base/BaseViewModel.kt +++ b/common-ui/src/main/java/com/lgtm/android/common_ui/base/BaseViewModel.kt @@ -6,8 +6,6 @@ import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import com.lgtm.domain.entity.LgtmResponseException -import com.lgtm.domain.logging.SwmCommonLoggingScheme -import com.swm.logging.android.SWMLogging import kotlinx.coroutines.CoroutineExceptionHandler abstract class BaseViewModel : ViewModel() { @@ -32,8 +30,4 @@ abstract class BaseViewModel : ViewModel() { } } } - - fun shotSwmLogging(scheme : SwmCommonLoggingScheme) { - SWMLogging.logEvent(scheme) - } } diff --git a/data/src/main/java/com/lgtm/android/data/repository/LoggingRepositoryImpl.kt b/data/src/main/java/com/lgtm/android/data/repository/LoggingRepositoryImpl.kt new file mode 100644 index 00000000..7a33b3fa --- /dev/null +++ b/data/src/main/java/com/lgtm/android/data/repository/LoggingRepositoryImpl.kt @@ -0,0 +1,12 @@ +package com.lgtm.android.data.repository + +import com.lgtm.domain.repository.LoggingRepository +import com.swm.logging.android.SWMLogging +import com.swm.logging.android.logging_scheme.SWMLoggingScheme +import javax.inject.Inject + +class LoggingRepositoryImpl @Inject constructor() : LoggingRepository { + override fun shotSwmLogging(scheme: SWMLoggingScheme) { + SWMLogging.logEvent(scheme) + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/lgtm/domain/repository/LoggingRepository.kt b/domain/src/main/java/com/lgtm/domain/repository/LoggingRepository.kt new file mode 100644 index 00000000..ca467afc --- /dev/null +++ b/domain/src/main/java/com/lgtm/domain/repository/LoggingRepository.kt @@ -0,0 +1,7 @@ +package com.lgtm.domain.repository + +import com.swm.logging.android.logging_scheme.SWMLoggingScheme + +interface LoggingRepository { + fun shotSwmLogging(scheme: SWMLoggingScheme) +} \ No newline at end of file diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/SignInViewModel.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/SignInViewModel.kt index bca4d29e..de5b0767 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/SignInViewModel.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/SignInViewModel.kt @@ -13,7 +13,7 @@ import com.lgtm.android.common_ui.util.NetworkState import com.lgtm.domain.entity.LgtmResponseException import com.lgtm.domain.entity.response.GithubLoginResponse import com.lgtm.domain.repository.AuthRepository -import com.swm.logging.android.SWMLogging +import com.lgtm.domain.repository.LoggingRepository import com.swm.logging.android.logging_scheme.SWMLoggingScheme import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.launch @@ -22,6 +22,7 @@ import javax.inject.Inject @HiltViewModel class SignInViewModel @Inject constructor( private val authRepository: AuthRepository, + private val loggingRepository: LoggingRepository ) : BaseViewModel() { private val deviceToken = MutableLiveData() @@ -90,6 +91,6 @@ class SignInViewModel @Inject constructor( } fun shotSignInExposureLogging(scheme: SWMLoggingScheme) { - SWMLogging.logEvent(scheme) + loggingRepository.shotSwmLogging(scheme) } } diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt index b4e987d4..e4ace757 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt @@ -23,6 +23,8 @@ import com.lgtm.domain.entity.request.SignUpSeniorRequestVO import com.lgtm.domain.entity.response.MemberDataDTO import com.lgtm.domain.entity.response.SignUpResponseVO import com.lgtm.domain.repository.AuthRepository +import com.lgtm.domain.repository.LoggingRepository +import com.swm.logging.android.logging_scheme.SWMLoggingScheme import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.launch import javax.inject.Inject @@ -30,6 +32,7 @@ import javax.inject.Inject @HiltViewModel class SignUpViewModel @Inject constructor( private val authRepository: AuthRepository, + private val loggingRepository: LoggingRepository ) : BaseViewModel() { /** Device Token */ @@ -431,6 +434,10 @@ class SignUpViewModel @Inject constructor( _selectedBankIdx.value = position } + fun shotSwmLogging(swmLoggingScheme: SWMLoggingScheme) { + loggingRepository.shotSwmLogging(swmLoggingScheme) + } + companion object { private const val ONE_MONTH = 1 private const val ONE_YEAR = 12 diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/ChooseRoleFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/ChooseRoleFragment.kt index ec3be9ea..fdb4b03d 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/ChooseRoleFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/ChooseRoleFragment.kt @@ -61,7 +61,7 @@ class ChooseRoleFragment : BaseFragment(R.layout.frag .setScreenName(this.javaClass) .setLogData(mapOf("signUpStep" to 5)) .build() - viewModel.shotSwmLogging(scheme) + signUpViewModel.shotSwmLogging(scheme) } } \ No newline at end of file diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/IntroductionFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/IntroductionFragment.kt index ab9a5c89..178560f1 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/IntroductionFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/IntroductionFragment.kt @@ -64,6 +64,6 @@ class IntroductionFragment : .setScreenName(this.javaClass) .setLogData(mapOf("signUpStep" to 4)) .build() - viewModel.shotSwmLogging(scheme) + signUpViewModel.shotSwmLogging(scheme) } } \ No newline at end of file diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/NicknameFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/NicknameFragment.kt index e221865a..ab3e393f 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/NicknameFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/NicknameFragment.kt @@ -34,7 +34,7 @@ class NicknameFragment : BaseFragment(R.layout.fragment .setScreenName(this.javaClass) .setLogData(mapOf("signUpStep" to 2)) .build() - viewModel.shotSwmLogging(scheme) + signUpViewModel.shotSwmLogging(scheme) } private fun setupViewModel() { diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/TechTagFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/TechTagFragment.kt index 70f16bc2..bee506d9 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/TechTagFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/TechTagFragment.kt @@ -62,6 +62,6 @@ class TechTagFragment : BaseFragment(R.layout.fragment_t .setScreenName(this.javaClass) .setLogData(mapOf("signUpStep" to 3)) .build() - viewModel.shotSwmLogging(scheme) + signUpViewModel.shotSwmLogging(scheme) } } \ No newline at end of file diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/TermsFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/TermsFragment.kt index 15e7a205..8ac7c46e 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/TermsFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/TermsFragment.kt @@ -61,7 +61,7 @@ class TermsFragment : BaseFragment(R.layout.fragment_terms .setEventLogName("termsServiceClick") .setScreenName(this.javaClass) .build() - viewModel.shotSwmLogging(scheme) + signUpViewModel.shotSwmLogging(scheme) } private fun shotTermsPrivacyClickLogging() { @@ -69,7 +69,7 @@ class TermsFragment : BaseFragment(R.layout.fragment_terms .setEventLogName("termsPrivacyClick") .setScreenName(this.javaClass) .build() - viewModel.shotSwmLogging(scheme) + signUpViewModel.shotSwmLogging(scheme) } private fun openUrlInBrowser(url: String) { @@ -135,7 +135,7 @@ class TermsFragment : BaseFragment(R.layout.fragment_terms .setScreenName(this.javaClass) .setLogData(mapOf("signUpStep" to 1)) .build() - viewModel.shotSwmLogging(scheme) + signUpViewModel.shotSwmLogging(scheme) } companion object { diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/EducationStatusFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/EducationStatusFragment.kt index 52b7c85f..5102f8d9 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/EducationStatusFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/EducationStatusFragment.kt @@ -99,6 +99,6 @@ class EducationStatusFragment : .setScreenName(this.javaClass) .setLogData(mapOf("signUpStep" to 6, "juniorStep" to 1)) .build() - viewModel.shotSwmLogging(scheme) + signUpViewModel.shotSwmLogging(scheme) } } \ No newline at end of file diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/RealNameFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/RealNameFragment.kt index 58441a5e..781c600a 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/RealNameFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/RealNameFragment.kt @@ -82,7 +82,7 @@ class RealNameFragment : BaseFragment(R.layout.fragment .setScreenName(this.javaClass) .setLogData(mapOf("signUpStep" to 7, "juniorStep" to 2)) .build() - viewModel.shotSwmLogging(scheme) + signUpViewModel.shotSwmLogging(scheme) } } \ No newline at end of file diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/BankAccountFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/BankAccountFragment.kt index bc94cd05..954ab512 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/BankAccountFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/BankAccountFragment.kt @@ -120,7 +120,7 @@ class BankAccountFragment : .setScreenName(this.javaClass) .setLogData(mapOf("signUpStep" to 9, "seniorStep" to 4)) .build() - viewModel.shotSwmLogging(scheme) + signUpViewModel.shotSwmLogging(scheme) } } \ No newline at end of file diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/CareerPeriodFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/CareerPeriodFragment.kt index c663c7cb..c3596e50 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/CareerPeriodFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/CareerPeriodFragment.kt @@ -57,7 +57,7 @@ class CareerPeriodFragment : .setScreenName(this.javaClass) .setLogData(mapOf("signUpStep" to 8, "seniorStep" to 3)) .build() - viewModel.shotSwmLogging(scheme) + signUpViewModel.shotSwmLogging(scheme) } } \ No newline at end of file diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/CompanyNameFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/CompanyNameFragment.kt index 0c09e39f..e53fa220 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/CompanyNameFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/CompanyNameFragment.kt @@ -61,6 +61,6 @@ class CompanyNameFragment : .setScreenName(this.javaClass) .setLogData(mapOf("signUpStep" to 6, "seniorStep" to 1)) .build() - viewModel.shotSwmLogging(scheme) + signUpViewModel.shotSwmLogging(scheme) } } \ No newline at end of file diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/PositionFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/PositionFragment.kt index 19a38a0a..8018b2b7 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/PositionFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/PositionFragment.kt @@ -61,6 +61,6 @@ class PositionFragment : .setScreenName(this.javaClass) .setLogData(mapOf("signUpStep" to 7, "seniorStep" to 2)) .build() - viewModel.shotSwmLogging(scheme) + signUpViewModel.shotSwmLogging(scheme) } } \ No newline at end of file diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/splash/SplashActivity.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/splash/SplashActivity.kt index 02c6dc67..184c5bdf 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/splash/SplashActivity.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/splash/SplashActivity.kt @@ -37,7 +37,7 @@ class SplashActivity : BaseActivity(R.layout.activity_spl .setEventLogName("splashExposure") .setScreenName(this.javaClass) .build() - viewModel?.shotSwmLogging(scheme) + splashViewModel.shotSwmLogging(scheme) } override fun onResume() { diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/splash/SplashViewModel.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/splash/SplashViewModel.kt index 2b62f3ca..b580e228 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/splash/SplashViewModel.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/splash/SplashViewModel.kt @@ -14,7 +14,7 @@ import com.google.firebase.remoteconfig.ktx.remoteConfigSettings import com.lgtm.android.common_ui.base.BaseViewModel import com.lgtm.domain.repository.AuthRepository import com.lgtm.domain.repository.IntroRepository -import com.swm.logging.android.SWMLogging +import com.lgtm.domain.repository.LoggingRepository import com.swm.logging.android.logging_scheme.SWMLoggingScheme import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.launch @@ -24,6 +24,7 @@ import javax.inject.Inject class SplashViewModel @Inject constructor( private val introRepository: IntroRepository, private val authRepository: AuthRepository, + private val loggingRepository: LoggingRepository ) : BaseViewModel() { @@ -99,8 +100,8 @@ class SplashViewModel @Inject constructor( return authRepository.isAutoLoginAvailable() } - fun shotSplashExposureLogging(swmLoggingScheme: SWMLoggingScheme) { - SWMLogging.logEvent(swmLoggingScheme) + fun shotSwmLogging(swmLoggingScheme: SWMLoggingScheme) { + loggingRepository.shotSwmLogging(swmLoggingScheme) } companion object {