Skip to content

Commit

Permalink
[fix]
Browse files Browse the repository at this point in the history
  • Loading branch information
jinuemong committed Mar 10, 2024
1 parent e55aa20 commit da715f4
Show file tree
Hide file tree
Showing 11 changed files with 137 additions and 64 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
package ac.dnd.mour.android.presentation.common.util.logevent

import com.google.firebase.analytics.ParametersBuilder
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
block: ParametersBuilder.() -> Unit
) {
Firebase.analytics.logEvent(eventName) {
param(screenName, screenName)
Firebase.analytics.logEvent(eventName){
block()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ fun AddGroupScreen(
LaunchedEffect(Unit) {
viewLogEvent(
LogEventUtil.VIEW_ADD_NEW_GROUP,
LogEventUtil.VIEW_ADD_NEW_GROUP
block = {

}
)
}

Expand Down Expand Up @@ -203,8 +205,10 @@ private fun AddGroupScreen(
isEnabled = text.isNotEmpty(),
onClick = {
viewLogEvent(
LogEventUtil.VIEW_ADD_NEW_GROUP,
LogEventUtil.CLICK_REGISTRATION_ADD_NEW_GROUP
LogEventUtil.CLICK_REGISTRATION_ADD_NEW_GROUP,
block = {

}
)
intent(AddGroupIntent.OnConfirm(text))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ fun GetGroupScreen(
LaunchedEffect(Unit) {
viewLogEvent(
LogEventUtil.VIEW_EDIT_GROUP,
LogEventUtil.VIEW_EDIT_GROUP
block = {

}
)
}

Expand Down Expand Up @@ -309,8 +311,10 @@ private fun GetGroupScreen(
modifier = Modifier
.clickable {
viewLogEvent(
LogEventUtil.VIEW_EDIT_GROUP,
LogEventUtil.CLICK_SAVE_GROUP_EDIT_GROUP
LogEventUtil.CLICK_SAVE_GROUP_EDIT_GROUP,
block = {

}
)
isShowingAddGroupSheet = true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ fun RelationScreen(
if (relationType == RelationType.ADD) {
viewLogEvent(
LogEventUtil.VIEW_RELATION,
LogEventUtil.VIEW_RELATION
block = {

}
)
}
}
Expand Down Expand Up @@ -402,8 +404,10 @@ fun RelationScreen(
isNameTypeTyping = true
if (relationType == RelationType.ADD) {
viewLogEvent(
LogEventUtil.VIEW_RELATION,
LogEventUtil.CLICK_DIRECT_INPUT_RELATION
LogEventUtil.CLICK_DIRECT_INPUT_RELATION,
block = {

}
)
}
}
Expand All @@ -420,8 +424,10 @@ fun RelationScreen(
isNameTypeTyping = false
if (relationType == RelationType.ADD) {
viewLogEvent(
LogEventUtil.VIEW_RELATION,
LogEventUtil.CLICK_KAKAO_RELATION
LogEventUtil.CLICK_KAKAO_RELATION,
block = {

}
)
}
}
Expand Down Expand Up @@ -622,8 +628,10 @@ fun RelationScreen(
.clickable {
if (relationType == RelationType.ADD) {
viewLogEvent(
LogEventUtil.VIEW_RELATION,
LogEventUtil.CLICK_EDIT_RELATION
LogEventUtil.CLICK_EDIT_RELATION,
block = {

}
)
}
isShowingGetGroup = true
Expand Down Expand Up @@ -838,8 +846,10 @@ fun RelationScreen(
if (checkSubmitState()) {
isRecordState = true
viewLogEvent(
LogEventUtil.VIEW_RELATION,
LogEventUtil.CLICK_MONEY_RELATION
LogEventUtil.CLICK_MONEY_RELATION,
block = {

}
)
intent(
if (currentImageName.isEmpty()) {
Expand Down Expand Up @@ -880,8 +890,10 @@ fun RelationScreen(
onClick = {
if (checkSubmitState()) {
viewLogEvent(
LogEventUtil.VIEW_RELATION,
LogEventUtil.CLICK_SAVE_RELATION
LogEventUtil.CLICK_SAVE_RELATION,
block = {

}
)
intent(
if (currentImageName.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ fun SearchRelationScreen(
LaunchedEffect(Unit){
viewLogEvent(
LogEventUtil.VIEW_SELECT_NAME,
LogEventUtil.VIEW_SELECT_NAME
block = {

}
)
}

Expand Down Expand Up @@ -284,8 +286,10 @@ private fun SearchRelationScreen(
.clip(Shapes.medium)
.clickable {
viewLogEvent(
LogEventUtil.VIEW_SELECT_NAME,
LogEventUtil.CLICK_SAVE_RELATION_SELECT_NAME
LogEventUtil.CLICK_SAVE_RELATION_SELECT_NAME,
block = {

}
)
navigateToEditRelation()
}
Expand Down Expand Up @@ -399,8 +403,10 @@ private fun SearchRelationScreen(
isEnabled = selectedRelation != null,
onClick = {
viewLogEvent(
LogEventUtil.VIEW_SELECT_NAME,
LogEventUtil.CLICK_SELECION_NAME
LogEventUtil.CLICK_SELECION_NAME,
block = {

}
)
selectedRelation?.let { relation ->
onResult(relation)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,10 @@ private fun EmptyRelationView(
.clickable {
onRecord()
viewLogEvent(
LogEventUtil.VIEW_MAIN,
LogEventUtil.CLICK_PLUSBTN_MAIN
LogEventUtil.CLICK_PLUSBTN_MAIN,
block = {

}
)
}
.border(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ private fun HistoryScreen(
LaunchedEffect(Unit){
viewLogEvent(
LogEventUtil.VIEW_MAIN,
LogEventUtil.VIEW_MAIN
block = {

}
)
}

Expand Down Expand Up @@ -537,8 +539,10 @@ private fun HistoryScreen(
.clip(RoundedCornerShape(100.dp))
.clickable {
viewLogEvent(
LogEventUtil.VIEW_FAB_BUTTON_MAIN,
LogEventUtil.CLICK_MONEY_MAIN
LogEventUtil.CLICK_MONEY_MAIN,
block = {

}
)
isDropDownMenuExpanded = false
if (isNotEmptyRelation) {
Expand Down Expand Up @@ -588,8 +592,10 @@ private fun HistoryScreen(
.clip(RoundedCornerShape(100.dp))
.clickable {
viewLogEvent(
LogEventUtil.VIEW_FAB_BUTTON_MAIN,
LogEventUtil.CLICK_RELATION_MAIN
LogEventUtil.CLICK_RELATION_MAIN,
block = {

}
)
isDropDownMenuExpanded = false
navigateToAddRelation()
Expand Down Expand Up @@ -639,17 +645,23 @@ private fun HistoryScreen(
isDropDownMenuExpanded = !isDropDownMenuExpanded
if(isDropDownMenuExpanded){
viewLogEvent(
LogEventUtil.VIEW_FAB_BUTTON_MAIN,
LogEventUtil.CLICK_CLOSE_MAIN
LogEventUtil.CLICK_CLOSE_MAIN,
block = {

}
)
}else{
viewLogEvent(
LogEventUtil.VIEW_MAIN,
LogEventUtil.CLICK_PLUSFLOATING_MAIN
LogEventUtil.CLICK_PLUSFLOATING_MAIN,
block = {

}
)
viewLogEvent(
LogEventUtil.VIEW_FAB_BUTTON_MAIN,
LogEventUtil.VIEW_FAB_BUTTON_MAIN
block = {

}
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,17 @@ fun HistoryRegistrationScreen(
HistoryRegistrationType.TAKE -> {
viewLogEvent(
LogEventUtil.VIEW_MONEY_TAKE,
LogEventUtil.VIEW_MONEY_TAKE
block = {

}
)
}
HistoryRegistrationType.GIVE -> {
viewLogEvent(
LogEventUtil.VIEW_MONEY_GIVE,
LogEventUtil.VIEW_MONEY_GIVE
block = {

}
)
}
}
Expand Down Expand Up @@ -449,14 +453,18 @@ fun HistoryRegistrationScreen(
when(historyTypeState){
HistoryRegistrationType.TAKE -> {
viewLogEvent(
LogEventUtil.VIEW_MONEY_TAKE,
LogEventUtil.CLICK_NEXT_SAVE_TAKE
LogEventUtil.CLICK_NEXT_SAVE_TAKE,
block = {

}
)
}
HistoryRegistrationType.GIVE -> {
viewLogEvent(
LogEventUtil.VIEW_MONEY_GIVE,
LogEventUtil.CLICK_NEXT_SAVE_GIVE
LogEventUtil.CLICK_NEXT_SAVE_GIVE,
block = {

}
)
}
}
Expand Down Expand Up @@ -489,14 +497,18 @@ fun HistoryRegistrationScreen(
when(historyTypeState){
HistoryRegistrationType.TAKE -> {
viewLogEvent(
LogEventUtil.VIEW_MONEY_TAKE,
LogEventUtil.CLICK_SAVE_TAKE
LogEventUtil.CLICK_SAVE_TAKE,
block = {

}
)
}
HistoryRegistrationType.GIVE -> {
viewLogEvent(
LogEventUtil.VIEW_MONEY_GIVE,
LogEventUtil.CLICK_SAVE_GIVE
LogEventUtil.CLICK_SAVE_GIVE,
block = {

}
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ fun LoginMainScreen(
LaunchedEffect(Unit){
viewLogEvent(
LogEventUtil.VIEW_LOG_IN,
LogEventUtil.VIEW_LOG_IN
block = {

}
)
}

Expand Down Expand Up @@ -208,8 +210,10 @@ fun LoginMainScreen(
)
.clickable {
viewLogEvent(
LogEventUtil.VIEW_LOG_IN,
LogEventUtil.CLICK_KAKAO_LOG_IN
LogEventUtil.CLICK_KAKAO_LOG_IN,
block = {

}
)
if (model.state == LoginMainState.Init) {
loginWithKakao(
Expand Down
Loading

0 comments on commit da715f4

Please sign in to comment.