diff --git a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/common/util/logevent/LogEventUtil.kt b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/common/util/logevent/LogEventUtil.kt new file mode 100644 index 00000000..16615f9b --- /dev/null +++ b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/common/util/logevent/LogEventUtil.kt @@ -0,0 +1,63 @@ +package ac.dnd.mour.android.presentation.common.util.logevent + +import com.google.firebase.analytics.ktx.analytics +import com.google.firebase.analytics.logEvent +import com.google.firebase.ktx.Firebase + +fun viewLogEvent( + eventName: String, + screenName: String +) { + Firebase.analytics.logEvent(eventName) { + param(screenName, screenName) + } +} + +object LogEventUtil { + const val VIEW_LOG_IN = "view_log_in" + const val CLICK_KAKAO_LOG_IN = "click_kakao_log_in" + + const val VIEW_ONBOARDING = "View_onboarding" + const val CLICK_NEXT_ONBOARDING = "click_next_onboarding" + const val VIEW_ONBOARDING_SECOND = "View_onboarding_second" + const val CLICK_NEXT_ONBOARDING_SECOND = "click_next_onboarding_second" + const val VIEW_ONBOARDING_THIRD = "View_onboarding_third" + const val CLICK_NEXT_ONBOARDING_THIRD = "click_next_onboarding_third" + + const val VIEW_REQUIRED_INFO = "View_Required_info" + const val CLICK_START_REQUIRED_INFO = "click_start_Required_info" + + const val CLICK_PLUSBTN_MAIN = "click_Plusbtn_main" + const val VIEW_MAIN = "View_main" + const val CLICK_PLUSFLOATING_MAIN = "click_Plusfloating_main" + + const val VIEW_FAB_BUTTON_MAIN = "View_FAB_button_main" + const val CLICK_MONEY_MAIN = "click_money_main" + const val CLICK_RELATION_MAIN = "click_relation_main" + const val CLICK_CLOSE_MAIN = "click_close_main" + + const val VIEW_RELATION = "View_relation" + const val CLICK_DIRECT_INPUT_RELATION = "click_Direct_input_relation" + const val CLICK_MONEY_RELATION = "click_money_relation" + const val CLICK_KAKAO_RELATION = "click_kakao_relation" + const val CLICK_EDIT_RELATION = "click_edit_relation" + const val CLICK_SAVE_RELATION = "click_save_relation" + + const val VIEW_EDIT_GROUP = "View_Edit_group" + const val CLICK_SAVE_GROUP_EDIT_GROUP = "click_save_group_edit_group" + + const val VIEW_ADD_NEW_GROUP = "View_Add_new_group" + const val CLICK_REGISTRATION_ADD_NEW_GROUP = "click_registration_Add_new_group" + + const val VIEW_MONEY_TAKE = "View_money_take" + const val CLICK_NEXT_SAVE_TAKE = "click_next_save_take" + const val CLICK_SAVE_TAKE = "click_save_take" + + const val VIEW_MONEY_GIVE = "View_money_give" + const val CLICK_NEXT_SAVE_GIVE = "click_next_save_give" + const val CLICK_SAVE_GIVE = "click_save_give" + + const val VIEW_SELECT_NAME = "View_select_name" + const val CLICK_SAVE_RELATION_SELECT_NAME = "click_save_relation_select_name" + const val CLICK_SELECION_NAME = "click_selecion_name" +} diff --git a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/group/add/AddGroupScreen.kt b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/group/add/AddGroupScreen.kt index 48eed996..e1ed8f1b 100644 --- a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/group/add/AddGroupScreen.kt +++ b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/group/add/AddGroupScreen.kt @@ -17,6 +17,8 @@ import ac.dnd.mour.android.presentation.common.util.LaunchedEffectWithLifecycle import ac.dnd.mour.android.presentation.common.util.coroutine.event.EventFlow import ac.dnd.mour.android.presentation.common.util.coroutine.event.MutableEventFlow import ac.dnd.mour.android.presentation.common.util.coroutine.event.eventObserve +import ac.dnd.mour.android.presentation.common.util.logevent.LogEventUtil +import ac.dnd.mour.android.presentation.common.util.logevent.viewLogEvent import ac.dnd.mour.android.presentation.common.view.BottomSheetScreen import ac.dnd.mour.android.presentation.common.view.confirm.ConfirmButton import ac.dnd.mour.android.presentation.common.view.confirm.ConfirmButtonProperties @@ -41,6 +43,7 @@ import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.material.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember @@ -73,6 +76,13 @@ fun AddGroupScreen( } ErrorObserver(viewModel) + LaunchedEffect(Unit) { + viewLogEvent( + LogEventUtil.VIEW_ADD_NEW_GROUP, + LogEventUtil.VIEW_ADD_NEW_GROUP + ) + } + AddGroupScreen( appState = appState, model = model, @@ -192,6 +202,10 @@ private fun AddGroupScreen( ), isEnabled = text.isNotEmpty(), onClick = { + viewLogEvent( + LogEventUtil.VIEW_ADD_NEW_GROUP, + LogEventUtil.CLICK_REGISTRATION_ADD_NEW_GROUP + ) intent(AddGroupIntent.OnConfirm(text)) } ) { diff --git a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/group/edit/EditGroupScreen.kt b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/group/edit/EditGroupScreen.kt index 987d2a17..ef67b58b 100644 --- a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/group/edit/EditGroupScreen.kt +++ b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/group/edit/EditGroupScreen.kt @@ -17,6 +17,8 @@ import ac.dnd.mour.android.presentation.common.util.LaunchedEffectWithLifecycle import ac.dnd.mour.android.presentation.common.util.coroutine.event.EventFlow import ac.dnd.mour.android.presentation.common.util.coroutine.event.MutableEventFlow import ac.dnd.mour.android.presentation.common.util.coroutine.event.eventObserve +import ac.dnd.mour.android.presentation.common.util.logevent.LogEventUtil +import ac.dnd.mour.android.presentation.common.util.logevent.viewLogEvent import ac.dnd.mour.android.presentation.common.view.BottomSheetScreen import ac.dnd.mour.android.presentation.common.view.confirm.ConfirmButton import ac.dnd.mour.android.presentation.common.view.confirm.ConfirmButtonProperties diff --git a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/group/get/GetGroupScreen.kt b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/group/get/GetGroupScreen.kt index a8463f07..39c21f80 100644 --- a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/group/get/GetGroupScreen.kt +++ b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/group/get/GetGroupScreen.kt @@ -21,6 +21,8 @@ import ac.dnd.mour.android.presentation.common.util.LaunchedEffectWithLifecycle import ac.dnd.mour.android.presentation.common.util.coroutine.event.EventFlow import ac.dnd.mour.android.presentation.common.util.coroutine.event.MutableEventFlow import ac.dnd.mour.android.presentation.common.util.coroutine.event.eventObserve +import ac.dnd.mour.android.presentation.common.util.logevent.LogEventUtil +import ac.dnd.mour.android.presentation.common.util.logevent.viewLogEvent import ac.dnd.mour.android.presentation.common.view.BottomSheetScreen import ac.dnd.mour.android.presentation.common.view.DialogScreen import ac.dnd.mour.android.presentation.model.relation.DefaultGroupType @@ -49,6 +51,7 @@ import androidx.compose.material.DropdownMenu import androidx.compose.material.DropdownMenuItem import androidx.compose.material.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableStateOf @@ -87,6 +90,13 @@ fun GetGroupScreen( } ErrorObserver(viewModel) + LaunchedEffect(Unit) { + viewLogEvent( + LogEventUtil.VIEW_EDIT_GROUP, + LogEventUtil.VIEW_EDIT_GROUP + ) + } + GetGroupScreen( appState = appState, onDismissRequest = onDismissRequest, @@ -298,6 +308,10 @@ private fun GetGroupScreen( Row( modifier = Modifier .clickable { + viewLogEvent( + LogEventUtil.VIEW_EDIT_GROUP, + LogEventUtil.CLICK_SAVE_GROUP_EDIT_GROUP + ) isShowingAddGroupSheet = true } .padding( diff --git a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/relation/RelationScreen.kt b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/relation/RelationScreen.kt index a0acecac..ab8bb883 100644 --- a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/relation/RelationScreen.kt +++ b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/relation/RelationScreen.kt @@ -28,6 +28,8 @@ import ac.dnd.mour.android.presentation.common.util.coroutine.event.EventFlow import ac.dnd.mour.android.presentation.common.util.coroutine.event.MutableEventFlow import ac.dnd.mour.android.presentation.common.util.coroutine.event.eventObserve import ac.dnd.mour.android.presentation.common.util.expansion.addFocusCleaner +import ac.dnd.mour.android.presentation.common.util.logevent.LogEventUtil +import ac.dnd.mour.android.presentation.common.util.logevent.viewLogEvent import ac.dnd.mour.android.presentation.common.util.makeRoute import ac.dnd.mour.android.presentation.common.view.DialogScreen import ac.dnd.mour.android.presentation.common.view.SnackBarScreen @@ -122,6 +124,14 @@ fun RelationScreen( handler: CoroutineExceptionHandler ) { + LaunchedEffect(Unit) { + if (relationType == RelationType.ADD) { + viewLogEvent( + LogEventUtil.VIEW_RELATION, + LogEventUtil.VIEW_RELATION + ) + } + } appState.setStatusBarColor(Gray000) val scope = rememberCoroutineScope() @@ -390,6 +400,12 @@ fun RelationScreen( chipId = 0, onSelectChip = { isNameTypeTyping = true + if (relationType == RelationType.ADD) { + viewLogEvent( + LogEventUtil.VIEW_RELATION, + LogEventUtil.CLICK_DIRECT_INPUT_RELATION + ) + } } ) ChipItem( @@ -402,6 +418,12 @@ fun RelationScreen( intent(RelationIntent.OnClickLoadFriend) } isNameTypeTyping = false + if (relationType == RelationType.ADD) { + viewLogEvent( + LogEventUtil.VIEW_RELATION, + LogEventUtil.CLICK_KAKAO_RELATION + ) + } } ) } @@ -598,6 +620,12 @@ fun RelationScreen( .clip(Shapes.medium) .background(color = Gray200) .clickable { + if (relationType == RelationType.ADD) { + viewLogEvent( + LogEventUtil.VIEW_RELATION, + LogEventUtil.CLICK_EDIT_RELATION + ) + } isShowingGetGroup = true } .padding( @@ -809,6 +837,10 @@ fun RelationScreen( onClick = { if (checkSubmitState()) { isRecordState = true + viewLogEvent( + LogEventUtil.VIEW_RELATION, + LogEventUtil.CLICK_MONEY_RELATION + ) intent( if (currentImageName.isEmpty()) { RelationIntent.OnClickAdd( @@ -847,6 +879,10 @@ fun RelationScreen( }, onClick = { if (checkSubmitState()) { + viewLogEvent( + LogEventUtil.VIEW_RELATION, + LogEventUtil.CLICK_SAVE_RELATION + ) intent( if (currentImageName.isEmpty()) { RelationIntent.OnClickAdd( diff --git a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/relation/get/GetRelationScreen.kt b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/relation/get/GetRelationScreen.kt index 4d6c9181..e8379452 100644 --- a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/relation/get/GetRelationScreen.kt +++ b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/common/relation/get/GetRelationScreen.kt @@ -24,6 +24,8 @@ import ac.dnd.mour.android.presentation.common.util.LaunchedEffectWithLifecycle import ac.dnd.mour.android.presentation.common.util.coroutine.event.EventFlow import ac.dnd.mour.android.presentation.common.util.coroutine.event.MutableEventFlow import ac.dnd.mour.android.presentation.common.util.coroutine.event.eventObserve +import ac.dnd.mour.android.presentation.common.util.logevent.LogEventUtil +import ac.dnd.mour.android.presentation.common.util.logevent.viewLogEvent import ac.dnd.mour.android.presentation.common.view.BottomSheetScreen import ac.dnd.mour.android.presentation.common.view.confirm.ConfirmButton import ac.dnd.mour.android.presentation.common.view.confirm.ConfirmButtonProperties @@ -62,6 +64,7 @@ import androidx.compose.material.Icon import androidx.compose.material.Surface import androidx.compose.material.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember @@ -103,6 +106,13 @@ fun SearchRelationScreen( } ErrorObserver(viewModel) + LaunchedEffect(Unit){ + viewLogEvent( + LogEventUtil.VIEW_SELECT_NAME, + LogEventUtil.VIEW_SELECT_NAME + ) + } + SearchRelationScreen( appState = appState, model = model, @@ -273,6 +283,10 @@ private fun SearchRelationScreen( modifier = Modifier .clip(Shapes.medium) .clickable { + viewLogEvent( + LogEventUtil.VIEW_SELECT_NAME, + LogEventUtil.CLICK_SAVE_RELATION_SELECT_NAME + ) navigateToEditRelation() } .background(color = Gray000) @@ -384,6 +398,10 @@ private fun SearchRelationScreen( ), isEnabled = selectedRelation != null, onClick = { + viewLogEvent( + LogEventUtil.VIEW_SELECT_NAME, + LogEventUtil.CLICK_SELECION_NAME + ) selectedRelation?.let { relation -> onResult(relation) onDismissRequest() diff --git a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/history/HistoryPageScreen.kt b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/history/HistoryPageScreen.kt index cf5a86e9..53a112d7 100644 --- a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/history/HistoryPageScreen.kt +++ b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/history/HistoryPageScreen.kt @@ -16,6 +16,8 @@ import ac.dnd.mour.android.presentation.common.theme.Space16 import ac.dnd.mour.android.presentation.common.theme.Space24 import ac.dnd.mour.android.presentation.common.theme.Space4 import ac.dnd.mour.android.presentation.common.util.coroutine.event.EventFlow +import ac.dnd.mour.android.presentation.common.util.logevent.LogEventUtil +import ac.dnd.mour.android.presentation.common.util.logevent.viewLogEvent import ac.dnd.mour.android.presentation.common.util.makeRoute import ac.dnd.mour.android.presentation.common.view.chip.ChipItem import ac.dnd.mour.android.presentation.common.view.chip.ChipType @@ -411,6 +413,10 @@ private fun EmptyRelationView( .background(color = Gray000) .clickable { onRecord() + viewLogEvent( + LogEventUtil.VIEW_MAIN, + LogEventUtil.CLICK_PLUSBTN_MAIN + ) } .border( width = 1.dp, diff --git a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/history/HistoryScreen.kt b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/history/HistoryScreen.kt index cdbffeb5..cf65919c 100644 --- a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/history/HistoryScreen.kt +++ b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/history/HistoryScreen.kt @@ -23,6 +23,8 @@ import ac.dnd.mour.android.presentation.common.util.coroutine.event.EventFlow import ac.dnd.mour.android.presentation.common.util.coroutine.event.MutableEventFlow import ac.dnd.mour.android.presentation.common.util.coroutine.event.eventObserve import ac.dnd.mour.android.presentation.common.util.expansion.addFocusCleaner +import ac.dnd.mour.android.presentation.common.util.logevent.LogEventUtil +import ac.dnd.mour.android.presentation.common.util.logevent.viewLogEvent import ac.dnd.mour.android.presentation.common.view.textfield.TypingTextField import ac.dnd.mour.android.presentation.common.view.textfield.TypingTextFieldType import ac.dnd.mour.android.presentation.model.history.HistoryViewSwipingType @@ -105,6 +107,7 @@ import kotlinx.coroutines.CoroutineExceptionHandler import kotlinx.coroutines.launch import kotlinx.datetime.LocalDate import kotlinx.datetime.LocalTime +import timber.log.Timber @Composable fun HistoryScreen( @@ -149,6 +152,12 @@ private fun HistoryScreen( handler: CoroutineExceptionHandler, selectedItem: Int ) { + LaunchedEffect(Unit){ + viewLogEvent( + LogEventUtil.VIEW_MAIN, + LogEventUtil.VIEW_MAIN + ) + } var isViewInLifecycle by remember { mutableStateOf(true) } LaunchedEffectWithLifecycle(context = handler) { @@ -527,6 +536,10 @@ private fun HistoryScreen( ) .clip(RoundedCornerShape(100.dp)) .clickable { + viewLogEvent( + LogEventUtil.VIEW_FAB_BUTTON_MAIN, + LogEventUtil.CLICK_MONEY_MAIN + ) isDropDownMenuExpanded = false if (isNotEmptyRelation) { isDropDownMenuExpanded = false @@ -574,6 +587,10 @@ private fun HistoryScreen( ) .clip(RoundedCornerShape(100.dp)) .clickable { + viewLogEvent( + LogEventUtil.VIEW_FAB_BUTTON_MAIN, + LogEventUtil.CLICK_RELATION_MAIN + ) isDropDownMenuExpanded = false navigateToAddRelation() } @@ -620,6 +637,21 @@ private fun HistoryScreen( backgroundColor = if (isDropDownMenuExpanded) Gray000 else Gray800, onClick = { isDropDownMenuExpanded = !isDropDownMenuExpanded + if(isDropDownMenuExpanded){ + viewLogEvent( + LogEventUtil.VIEW_FAB_BUTTON_MAIN, + LogEventUtil.CLICK_CLOSE_MAIN + ) + }else{ + viewLogEvent( + LogEventUtil.VIEW_MAIN, + LogEventUtil.CLICK_PLUSFLOATING_MAIN + ) + viewLogEvent( + LogEventUtil.VIEW_FAB_BUTTON_MAIN, + LogEventUtil.VIEW_FAB_BUTTON_MAIN + ) + } } ) { if (isDropDownMenuExpanded) { diff --git a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/history/registration/HistoryRegistrationScreen.kt b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/history/registration/HistoryRegistrationScreen.kt index 7ddd18a2..4dcd5c7b 100644 --- a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/history/registration/HistoryRegistrationScreen.kt +++ b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/home/history/registration/HistoryRegistrationScreen.kt @@ -20,6 +20,8 @@ import ac.dnd.mour.android.presentation.common.util.coroutine.event.EventFlow import ac.dnd.mour.android.presentation.common.util.coroutine.event.MutableEventFlow import ac.dnd.mour.android.presentation.common.util.coroutine.event.eventObserve import ac.dnd.mour.android.presentation.common.util.expansion.addFocusCleaner +import ac.dnd.mour.android.presentation.common.util.logevent.LogEventUtil +import ac.dnd.mour.android.presentation.common.util.logevent.viewLogEvent import ac.dnd.mour.android.presentation.common.view.SnackBarScreen import ac.dnd.mour.android.presentation.common.view.calendar.CalendarConfig import ac.dnd.mour.android.presentation.common.view.chip.ChipItem @@ -66,6 +68,7 @@ import androidx.compose.foundation.verticalScroll import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider +import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableLongStateOf @@ -137,6 +140,23 @@ fun HistoryRegistrationScreen( label = "type text color" ) + LaunchedEffect(historyTypeState){ + when(historyTypeState){ + HistoryRegistrationType.TAKE -> { + viewLogEvent( + LogEventUtil.VIEW_MONEY_TAKE, + LogEventUtil.VIEW_MONEY_TAKE + ) + } + HistoryRegistrationType.GIVE -> { + viewLogEvent( + LogEventUtil.VIEW_MONEY_GIVE, + LogEventUtil.VIEW_MONEY_GIVE + ) + } + } + } + fun navigateToStep() { if (isContinuousState) { focusManager.clearFocus() @@ -426,6 +446,20 @@ fun HistoryRegistrationScreen( event = eventTypeText ) if (isViewUnRecordMessage.isEmpty() && model.state == HistoryRegistrationState.Init) { + when(historyTypeState){ + HistoryRegistrationType.TAKE -> { + viewLogEvent( + LogEventUtil.VIEW_MONEY_TAKE, + LogEventUtil.CLICK_NEXT_SAVE_TAKE + ) + } + HistoryRegistrationType.GIVE -> { + viewLogEvent( + LogEventUtil.VIEW_MONEY_GIVE, + LogEventUtil.CLICK_NEXT_SAVE_GIVE + ) + } + } register(continuousState = true) } }, @@ -452,6 +486,20 @@ fun HistoryRegistrationScreen( event = eventTypeText ) if (isViewUnRecordMessage.isEmpty() && model.state == HistoryRegistrationState.Init) { + when(historyTypeState){ + HistoryRegistrationType.TAKE -> { + viewLogEvent( + LogEventUtil.VIEW_MONEY_TAKE, + LogEventUtil.CLICK_SAVE_TAKE + ) + } + HistoryRegistrationType.GIVE -> { + viewLogEvent( + LogEventUtil.VIEW_MONEY_GIVE, + LogEventUtil.CLICK_SAVE_GIVE + ) + } + } register(continuousState = false) } }, diff --git a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/login/main/LoginMainScreen.kt b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/login/main/LoginMainScreen.kt index ba385ccc..83e5f392 100644 --- a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/login/main/LoginMainScreen.kt +++ b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/login/main/LoginMainScreen.kt @@ -13,6 +13,8 @@ import ac.dnd.mour.android.presentation.common.util.coroutine.event.EventFlow import ac.dnd.mour.android.presentation.common.util.coroutine.event.MutableEventFlow import ac.dnd.mour.android.presentation.common.util.coroutine.event.eventObserve import ac.dnd.mour.android.presentation.common.util.loginWithKakao +import ac.dnd.mour.android.presentation.common.util.logevent.LogEventUtil +import ac.dnd.mour.android.presentation.common.util.logevent.viewLogEvent import ac.dnd.mour.android.presentation.common.view.DialogScreen import ac.dnd.mour.android.presentation.model.login.KakaoUserInformationModel import ac.dnd.mour.android.presentation.ui.main.ApplicationState @@ -36,6 +38,7 @@ import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.Card import androidx.compose.material.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember @@ -67,6 +70,14 @@ fun LoginMainScreen( intent: (LoginMainIntent) -> Unit, handler: CoroutineExceptionHandler ) { + + LaunchedEffect(Unit){ + viewLogEvent( + LogEventUtil.VIEW_LOG_IN, + LogEventUtil.VIEW_LOG_IN + ) + } + var isDialogShowing by remember { mutableStateOf(false) } val context = LocalContext.current fun navigateToOnBoarding(kakaoUserModel: KakaoUserInformationModel) { @@ -196,6 +207,10 @@ fun LoginMainScreen( shape = Shapes.medium ) .clickable { + viewLogEvent( + LogEventUtil.VIEW_LOG_IN, + LogEventUtil.CLICK_KAKAO_LOG_IN + ) if (model.state == LoginMainState.Init) { loginWithKakao( context = context, diff --git a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/login/onboarding/LoginOnBoardingScreen.kt b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/login/onboarding/LoginOnBoardingScreen.kt index 231f9539..c57794dc 100644 --- a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/login/onboarding/LoginOnBoardingScreen.kt +++ b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/login/onboarding/LoginOnBoardingScreen.kt @@ -8,6 +8,8 @@ import ac.dnd.mour.android.presentation.common.util.LaunchedEffectWithLifecycle import ac.dnd.mour.android.presentation.common.util.coroutine.event.EventFlow import ac.dnd.mour.android.presentation.common.util.coroutine.event.MutableEventFlow import ac.dnd.mour.android.presentation.common.util.coroutine.event.eventObserve +import ac.dnd.mour.android.presentation.common.util.logevent.LogEventUtil +import ac.dnd.mour.android.presentation.common.util.logevent.viewLogEvent import ac.dnd.mour.android.presentation.common.view.confirm.ConfirmButton import ac.dnd.mour.android.presentation.common.view.confirm.ConfirmButtonProperties import ac.dnd.mour.android.presentation.common.view.confirm.ConfirmButtonSize @@ -35,6 +37,7 @@ import androidx.compose.foundation.pager.rememberPagerState import androidx.compose.foundation.shape.CircleShape import androidx.compose.material.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.Alignment @@ -65,6 +68,31 @@ fun LoginOnBoardingScreen( pageCount = { 3 } ) + LaunchedEffect(pagerState) { + when (pagerState.currentPage) { + 0 -> { + viewLogEvent( + LogEventUtil.VIEW_ONBOARDING, + LogEventUtil.VIEW_ONBOARDING + ) + } + + 1 -> { + viewLogEvent( + LogEventUtil.VIEW_ONBOARDING, + LogEventUtil.VIEW_ONBOARDING_SECOND + ) + } + + 2 -> { + viewLogEvent( + LogEventUtil.VIEW_ONBOARDING, + LogEventUtil.VIEW_ONBOARDING_THIRD + ) + } + } + } + fun navigateToRegistration(kakaoUserModel: KakaoUserInformationModel) { appState.navController.sendKakaoUserModel(kakaoUserModel) } @@ -129,6 +157,28 @@ fun LoginOnBoardingScreen( ), onClick = { intent(LoginOnBoardingIntent.Click) + when (pagerState.currentPage) { + 0 -> { + viewLogEvent( + LogEventUtil.VIEW_ONBOARDING, + LogEventUtil.CLICK_NEXT_ONBOARDING + ) + } + + 1 -> { + viewLogEvent( + LogEventUtil.VIEW_ONBOARDING, + LogEventUtil.CLICK_NEXT_ONBOARDING_SECOND + ) + } + + 2 -> { + viewLogEvent( + LogEventUtil.VIEW_ONBOARDING, + LogEventUtil.CLICK_NEXT_ONBOARDING_THIRD + ) + } + } } ) { style -> Text( diff --git a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/registration/main/RegistrationMainDestination.kt b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/registration/main/RegistrationMainDestination.kt index f7e24f7b..b565975f 100644 --- a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/registration/main/RegistrationMainDestination.kt +++ b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/registration/main/RegistrationMainDestination.kt @@ -1,6 +1,8 @@ package ac.dnd.mour.android.presentation.ui.main.registration.main import ac.dnd.mour.android.presentation.common.util.ErrorObserver +import ac.dnd.mour.android.presentation.common.util.logevent.LogEventUtil +import ac.dnd.mour.android.presentation.common.util.logevent.viewLogEvent import ac.dnd.mour.android.presentation.model.login.KakaoUserInformationModel import ac.dnd.mour.android.presentation.ui.main.ApplicationState import androidx.compose.runtime.LaunchedEffect diff --git a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/registration/main/RegistrationMainScreen.kt b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/registration/main/RegistrationMainScreen.kt index 74c9365b..4b4dd29a 100644 --- a/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/registration/main/RegistrationMainScreen.kt +++ b/presentation/src/main/kotlin/ac/dnd/mour/android/presentation/ui/main/registration/main/RegistrationMainScreen.kt @@ -24,6 +24,8 @@ import ac.dnd.mour.android.presentation.common.util.coroutine.event.EventFlow import ac.dnd.mour.android.presentation.common.util.coroutine.event.MutableEventFlow import ac.dnd.mour.android.presentation.common.util.coroutine.event.eventObserve import ac.dnd.mour.android.presentation.common.util.expansion.addFocusCleaner +import ac.dnd.mour.android.presentation.common.util.logevent.LogEventUtil +import ac.dnd.mour.android.presentation.common.util.logevent.viewLogEvent import ac.dnd.mour.android.presentation.common.view.DialogScreen import ac.dnd.mour.android.presentation.common.view.textfield.TypingTextField import ac.dnd.mour.android.presentation.common.view.textfield.TypingTextFieldType @@ -59,6 +61,7 @@ import androidx.compose.material.RadioButton import androidx.compose.material.RadioButtonDefaults import androidx.compose.material.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember @@ -89,6 +92,13 @@ fun RegistrationNamingScreen( intent: (RegistrationMainIntent) -> Unit, handler: CoroutineExceptionHandler ) { + LaunchedEffect(Unit){ + viewLogEvent( + LogEventUtil.VIEW_REQUIRED_INFO, + LogEventUtil.VIEW_REQUIRED_INFO + ) + } + val scope = rememberCoroutineScope() + handler val focusManager = LocalFocusManager.current var isDialogShowing by remember { mutableStateOf(false) } @@ -505,6 +515,10 @@ fun RegistrationNamingScreen( ).joinToString("-") ) ) + viewLogEvent( + LogEventUtil.VIEW_REQUIRED_INFO, + LogEventUtil.CLICK_START_REQUIRED_INFO + ) } }, elevation = null