From 3e46a48cfdc3119dbf368fcd7f64fd82c6fdff92 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Tue, 22 Oct 2024 01:52:36 +0900 Subject: [PATCH 01/21] =?UTF-8?q?[FEAT/#294]=20=EC=97=A0=ED=94=8C=EB=A6=AC?= =?UTF-8?q?=ED=8A=9C=EB=93=9C=20=EC=8B=AC=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/terning/core/analytics/EventType.kt | 5 +++-- .../feature/home/component/HomeFilteringScreen.kt | 9 ++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/terning/core/analytics/EventType.kt b/core/src/main/java/com/terning/core/analytics/EventType.kt index ec270bc4..7c56956b 100644 --- a/core/src/main/java/com/terning/core/analytics/EventType.kt +++ b/core/src/main/java/com/terning/core/analytics/EventType.kt @@ -1,6 +1,7 @@ package com.terning.core.analytics enum class EventType(val prefix: String) { - VIEW("view"), - CLICK("click") + SCREEN("screen"), + CLICK("click"), + SCROLL("scroll") } diff --git a/feature/src/main/java/com/terning/feature/home/component/HomeFilteringScreen.kt b/feature/src/main/java/com/terning/feature/home/component/HomeFilteringScreen.kt index 532f3128..aa1c2022 100644 --- a/feature/src/main/java/com/terning/feature/home/component/HomeFilteringScreen.kt +++ b/feature/src/main/java/com/terning/feature/home/component/HomeFilteringScreen.kt @@ -22,6 +22,8 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp +import com.terning.core.analytics.EventType +import com.terning.core.analytics.LocalTracker import com.terning.core.designsystem.theme.Grey350 import com.terning.core.designsystem.theme.Grey400 import com.terning.core.designsystem.theme.TerningMain @@ -46,6 +48,8 @@ fun HomeFilteringScreen( horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically, ) { + val amplitudeTracker = LocalTracker.current + Row( modifier = Modifier .border( @@ -54,7 +58,10 @@ fun HomeFilteringScreen( shape = RoundedCornerShape(5.dp) ) .align(Alignment.CenterVertically) - .noRippleClickable(onChangeFilterClick), + .noRippleClickable { + amplitudeTracker.track(type = EventType.CLICK, name = "home_filtering") + onChangeFilterClick() + }, ) { Icon( painter = painterResource(id = R.drawable.ic_home_filtering_28), From 8be46d2c2fe3cedb898c6013b07df3571de2a696 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Tue, 22 Oct 2024 02:38:37 +0900 Subject: [PATCH 02/21] [FEAT/#294] onboarding filtering amplitude --- .../filteringthree/FilteringThreeRoute.kt | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/feature/src/main/java/com/terning/feature/filtering/filteringthree/FilteringThreeRoute.kt b/feature/src/main/java/com/terning/feature/filtering/filteringthree/FilteringThreeRoute.kt index 186610dd..2fce106f 100644 --- a/feature/src/main/java/com/terning/feature/filtering/filteringthree/FilteringThreeRoute.kt +++ b/feature/src/main/java/com/terning/feature/filtering/filteringthree/FilteringThreeRoute.kt @@ -23,6 +23,8 @@ import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.LocalLifecycleOwner import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.flowWithLifecycle +import com.terning.core.analytics.EventType +import com.terning.core.analytics.LocalTracker import com.terning.core.designsystem.component.button.RectangleButton import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar import com.terning.core.designsystem.theme.Grey300 @@ -49,6 +51,8 @@ fun FilteringThreeRoute( val context = LocalContext.current val lifecycleOwner = LocalLifecycleOwner.current + val amplitudeTracker = LocalTracker.current + LaunchedEffect(key1 = true) { with(viewModel) { updateGrade(grade = grade) @@ -78,7 +82,19 @@ fun FilteringThreeRoute( navigateUp = viewModel::navigateUp, chosenYear = Calendar.getInstance().currentYear, chosenMonth = Calendar.getInstance().currentMonth, - onNextClick = viewModel::postFilteringWithServer, + onNextClick = { + amplitudeTracker.track( + type = EventType.CLICK, + name = "onboarding_completed", + properties = mapOf( + "grade" to state.grade, + "workingPeriod" to state.workingPeriod, + "startYear" to state.startYear, + "startMonth" to state.startMonth + ) + ) + viewModel.postFilteringWithServer() + }, onYearChosen = viewModel::updateStartYear, onMonthChosen = viewModel::updateStartMonth ) From 390ab58c4c363d6bf939c5de6c7478fb6b6ff9c7 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Tue, 22 Oct 2024 02:47:06 +0900 Subject: [PATCH 03/21] [FEAT/#294] signup kakao amplitude --- .../src/main/java/com/terning/core/analytics/EventType.kt | 1 + .../com/terning/feature/onboarding/signup/SignUpRoute.kt | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/core/src/main/java/com/terning/core/analytics/EventType.kt b/core/src/main/java/com/terning/core/analytics/EventType.kt index 7c56956b..ad4be910 100644 --- a/core/src/main/java/com/terning/core/analytics/EventType.kt +++ b/core/src/main/java/com/terning/core/analytics/EventType.kt @@ -1,6 +1,7 @@ package com.terning.core.analytics enum class EventType(val prefix: String) { + SIGNUP("signup"), SCREEN("screen"), CLICK("click"), SCROLL("scroll") diff --git a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt index c00b5cb9..ef6b5282 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt @@ -23,6 +23,8 @@ import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.LocalLifecycleOwner import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.flowWithLifecycle +import com.terning.core.analytics.EventType +import com.terning.core.analytics.LocalTracker import com.terning.core.designsystem.component.bottomsheet.ProfileBottomSheet import com.terning.core.designsystem.component.button.RectangleButton import com.terning.core.designsystem.component.item.ProfileWithPlusButton @@ -47,6 +49,8 @@ fun SignUpRoute( val context = LocalContext.current val lifecycleOwner = LocalLifecycleOwner.current + val amplitudeTracker = LocalTracker.current + LaunchedEffect(key1 = true) { viewModel.updateAuthId(authId) } @@ -76,6 +80,10 @@ fun SignUpRoute( SignUpScreen( state = state, onSignUpClick = { + amplitudeTracker.track( + type = EventType.SIGNUP, + name = "kakao" + ) viewModel.postSignUpWithServer() }, onInputChange = { name -> From 26fccfbe580915d182b37784cb2ce2c89b9ca6d7 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Tue, 22 Oct 2024 02:50:44 +0900 Subject: [PATCH 04/21] [FEAT/#294] mypage notice amplitude --- .../com/terning/feature/mypage/mypage/MyPageRoute.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt index ca7d283f..5d4dade3 100644 --- a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt +++ b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt @@ -34,6 +34,8 @@ import androidx.lifecycle.compose.LocalLifecycleOwner import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.flowWithLifecycle import com.google.accompanist.systemuicontroller.rememberSystemUiController +import com.terning.core.analytics.EventType +import com.terning.core.analytics.LocalTracker import com.terning.core.designsystem.component.bottomsheet.MyPageLogoutBottomSheet import com.terning.core.designsystem.component.bottomsheet.MyPageQuitBottomSheet import com.terning.core.designsystem.component.image.TerningImage @@ -69,6 +71,8 @@ fun MyPageRoute( val systemUiController = rememberSystemUiController() + val amplitudeTracker = LocalTracker.current + SideEffect { systemUiController.setStatusBarColor( color = Back @@ -135,7 +139,13 @@ fun MyPageRoute( onEditClick = viewModel::navigateToProfileEdit, onLogoutClick = { viewModel.fetchShowLogoutBottomSheet(true) }, onQuitClick = { viewModel.fetchShowQuitBottomSheet(true) }, - onNoticeClick = { viewModel.fetchShowNotice(true) }, + onNoticeClick = { + amplitudeTracker.track( + type = EventType.CLICK, + name = "mypage_notice" + ) + viewModel.fetchShowNotice(true) + }, onOpinionClick = { viewModel.fetchShowOpinion(true) }, onServiceClick = { viewModel.fetchShowService(true) }, onPersonalClick = { viewModel.fetchShowPersonal(true) }, From d1477b6be0475ac3c9620ec819ad097d50ad6696 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Tue, 22 Oct 2024 02:54:32 +0900 Subject: [PATCH 05/21] [FEAT/#294] mypage comment amplitude --- .../java/com/terning/feature/mypage/mypage/MyPageRoute.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt index 5d4dade3..b2b3cf83 100644 --- a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt +++ b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt @@ -146,7 +146,13 @@ fun MyPageRoute( ) viewModel.fetchShowNotice(true) }, - onOpinionClick = { viewModel.fetchShowOpinion(true) }, + onOpinionClick = { + amplitudeTracker.track( + type = EventType.CLICK, + name = "mypage_comment" + ) + viewModel.fetchShowOpinion(true) + }, onServiceClick = { viewModel.fetchShowService(true) }, onPersonalClick = { viewModel.fetchShowPersonal(true) }, name = state.name, From 9bdf61bfa0bec9fe6e93c337025e5aadf66665a1 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Tue, 22 Oct 2024 02:58:00 +0900 Subject: [PATCH 06/21] [FEAT/#294] mypage modify amplitude --- .../java/com/terning/feature/mypage/mypage/MyPageRoute.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt index b2b3cf83..2ca1997a 100644 --- a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt +++ b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt @@ -136,7 +136,13 @@ fun MyPageRoute( is UiState.Success -> { MyPageScreen( paddingValues = paddingValues, - onEditClick = viewModel::navigateToProfileEdit, + onEditClick = { + amplitudeTracker.track( + type = EventType.CLICK, + name = "mypage_modify_profile" + ) + viewModel.navigateToProfileEdit() + }, onLogoutClick = { viewModel.fetchShowLogoutBottomSheet(true) }, onQuitClick = { viewModel.fetchShowQuitBottomSheet(true) }, onNoticeClick = { From 4d73b0cb34a784f91afac1d2e8cc8b9a01d3fcef Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Tue, 22 Oct 2024 02:59:50 +0900 Subject: [PATCH 07/21] [FEAT/#294] mypage logout and quit amplitude --- .../java/com/terning/feature/mypage/mypage/MyPageRoute.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt index 2ca1997a..69eb6be8 100644 --- a/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt +++ b/feature/src/main/java/com/terning/feature/mypage/mypage/MyPageRoute.kt @@ -118,6 +118,10 @@ fun MyPageRoute( MyPageLogoutBottomSheet( onDismiss = { viewModel.fetchShowLogoutBottomSheet(false) }, onLogoutClick = { + amplitudeTracker.track( + type = EventType.CLICK, + name = "mypage_logout" + ) viewModel.logoutKakao() }, ) @@ -127,6 +131,10 @@ fun MyPageRoute( MyPageQuitBottomSheet( onDismiss = { viewModel.fetchShowQuitBottomSheet(false) }, onQuitClick = { + amplitudeTracker.track( + type = EventType.CLICK, + name = "mypage_delete_account" + ) viewModel.quitKakao() } ) From 9aca783d2d024aa31dac588b3d4eb9b0fffcb93b Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Tue, 22 Oct 2024 03:09:25 +0900 Subject: [PATCH 08/21] [FEAT/#294] navigation amplitude --- .../com/terning/feature/main/MainScreen.kt | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/feature/src/main/java/com/terning/feature/main/MainScreen.kt b/feature/src/main/java/com/terning/feature/main/MainScreen.kt index 61714f0b..3f83c071 100644 --- a/feature/src/main/java/com/terning/feature/main/MainScreen.kt +++ b/feature/src/main/java/com/terning/feature/main/MainScreen.kt @@ -34,6 +34,8 @@ import androidx.compose.ui.unit.IntOffset import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import androidx.navigation.compose.NavHost +import com.terning.core.analytics.EventType +import com.terning.core.analytics.LocalTracker import com.terning.core.designsystem.component.snackbar.TerningBasicSnackBar import com.terning.core.designsystem.theme.Grey300 import com.terning.core.designsystem.theme.TerningMain @@ -55,6 +57,7 @@ import com.terning.feature.onboarding.splash.navigation.splashNavGraph import com.terning.feature.search.search.navigation.searchNavGraph import com.terning.feature.search.searchprocess.navigation.searchProcessNavGraph import kotlinx.coroutines.launch +import org.openjdk.tools.javac.Main @Composable fun MainScreen( @@ -67,6 +70,8 @@ fun MainScreen( val snackBarHostState = remember { SnackbarHostState() } val coroutineScope = rememberCoroutineScope() + val amplitudeTracker = LocalTracker.current + BackHandler(enabled = backPressedState) { if (System.currentTimeMillis() - backPressedTime <= 3000) { (context as Activity).finish() @@ -101,7 +106,18 @@ fun MainScreen( isVisible = navigator.showBottomBar(), tabs = MainTab.entries.toList(), currentTab = navigator.currentTab, - onTabSelected = navigator::navigate + onTabSelected = { navigation -> + amplitudeTracker.track( + type = EventType.CLICK, + name = when (navigation) { + MainTab.HOME -> "navigation_home" + MainTab.CALENDAR -> "navigation_calendar" + MainTab.SEARCH -> "navigation_search" + MainTab.MY_PAGE -> "navigation_mypage" + } + ) + navigator.navigate(navigation) + } ) }, ) { paddingValues -> From 65a1fffdbe47b6babd06057ec5eda6f157b33a22 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Tue, 22 Oct 2024 04:15:19 +0900 Subject: [PATCH 09/21] [FEAT/#294] fix code --- .../terning/feature/home/component/HomeFilteringScreen.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/feature/src/main/java/com/terning/feature/home/component/HomeFilteringScreen.kt b/feature/src/main/java/com/terning/feature/home/component/HomeFilteringScreen.kt index aa1c2022..992b9e5e 100644 --- a/feature/src/main/java/com/terning/feature/home/component/HomeFilteringScreen.kt +++ b/feature/src/main/java/com/terning/feature/home/component/HomeFilteringScreen.kt @@ -59,7 +59,10 @@ fun HomeFilteringScreen( ) .align(Alignment.CenterVertically) .noRippleClickable { - amplitudeTracker.track(type = EventType.CLICK, name = "home_filtering") + amplitudeTracker.track( + type = EventType.CLICK, + name = "home_filtering" + ) onChangeFilterClick() }, ) { From dbad766a43c5847e71c519bb20c07eb3f4aabbc6 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Wed, 23 Oct 2024 05:05:29 +0900 Subject: [PATCH 10/21] [FEAT/#294] version update 1.1.5 -> 1.1.6 --- .../feature/search/searchprocess/SearchProcessRoute.kt | 1 + gradle/libs.versions.toml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt b/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt index c78994e3..47cec953 100644 --- a/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt +++ b/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt @@ -267,6 +267,7 @@ fun SearchProcessScreen( intern = internSearchResultData[index], navigateToIntern = navigateToIntern, onScrapButtonClicked = { + with(internSearchResultData[index]) { onScrapButtonClicked(this) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 314d6651..a93f332b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,8 +2,8 @@ compileSdk = "34" minSdk = "28" targetSdk = "34" -versionName = "1.1.5" -versionCode = "10105" +versionName = "1.1.6" +versionCode = "10106" kotlinCompilerExtensionVersion = "1.5.0" jvmTarget = "1.8" From f46da5a73c07344c8a8b90bd50a82e9c6dbcfd8a Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Wed, 23 Oct 2024 05:07:58 +0900 Subject: [PATCH 11/21] [FEAT/#294] search quest scrap amplitude --- .../feature/search/searchprocess/SearchProcessRoute.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt b/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt index 47cec953..2f87b1f0 100644 --- a/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt +++ b/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt @@ -33,6 +33,8 @@ import androidx.lifecycle.compose.LocalLifecycleOwner import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.flowWithLifecycle import androidx.navigation.NavHostController +import com.terning.core.analytics.EventType +import com.terning.core.analytics.LocalTracker import com.terning.core.designsystem.component.bottomsheet.SortingBottomSheet import com.terning.core.designsystem.component.button.SortingButton import com.terning.core.designsystem.component.item.InternItemWithShadow @@ -168,6 +170,8 @@ fun SearchProcessScreen( val focusManager = LocalFocusManager.current val currentSortBy = remember { mutableIntStateOf(state.currentSortBy) } + val amplitudeTracker = LocalTracker.current + LaunchedEffect(Unit) { focusRequester.requestFocus() } @@ -267,7 +271,10 @@ fun SearchProcessScreen( intern = internSearchResultData[index], navigateToIntern = navigateToIntern, onScrapButtonClicked = { - + amplitudeTracker.track( + type = EventType.CLICK, + name = "quest_scrap" + ) with(internSearchResultData[index]) { onScrapButtonClicked(this) } From 10f0f1fb11b3821f11a15fb38053cd70068671d5 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Wed, 23 Oct 2024 05:15:29 +0900 Subject: [PATCH 12/21] [FEAT/#294] search quest search amplitude --- .../com/terning/feature/search/search/SearchRoute.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/feature/src/main/java/com/terning/feature/search/search/SearchRoute.kt b/feature/src/main/java/com/terning/feature/search/search/SearchRoute.kt index 227ef863..d95786be 100644 --- a/feature/src/main/java/com/terning/feature/search/search/SearchRoute.kt +++ b/feature/src/main/java/com/terning/feature/search/search/SearchRoute.kt @@ -22,6 +22,8 @@ import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.LocalLifecycleOwner import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.flowWithLifecycle +import com.terning.core.analytics.EventType +import com.terning.core.analytics.LocalTracker import com.terning.core.designsystem.component.image.TerningImage import com.terning.core.designsystem.component.textfield.SearchTextField import com.terning.core.designsystem.theme.Black @@ -52,6 +54,8 @@ fun SearchRoute( val viewState by viewModel.viewState.collectAsStateWithLifecycle(lifecycleOwner = lifecycleOwner) val scrapState by viewModel.scrapState.collectAsStateWithLifecycle(lifecycleOwner = lifecycleOwner) + val amplitudeTracker = LocalTracker.current + LaunchedEffect(key1 = true) { viewModel.getSearchViews() viewModel.getSearchScraps() @@ -82,7 +86,13 @@ fun SearchRoute( modifier = modifier, searchViewsList = searchViewsList, searchScrapsList = searchScrapsList, - navigateToSearchProcess = navigateToSearchProcess, + navigateToSearchProcess = { + amplitudeTracker.track( + type = EventType.CLICK, + name = "quest_search" + ) + navigateToSearchProcess() + }, navigateToIntern = navigateToIntern, onAdvertisementClick = { CustomTabsIntent.Builder().build().launchUrl(context, ADVERTISEMENT_URL.toUri()) From 82d31ce46832975ac31eced85e631f017a3add8e Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Wed, 23 Oct 2024 05:25:10 +0900 Subject: [PATCH 13/21] [FEAT/#294] dialog color and scrap amplitude --- .../terning/feature/dialog/detail/ScrapDialog.kt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/dialog/detail/ScrapDialog.kt b/feature/src/main/java/com/terning/feature/dialog/detail/ScrapDialog.kt index 86e9e171..8e64ca23 100644 --- a/feature/src/main/java/com/terning/feature/dialog/detail/ScrapDialog.kt +++ b/feature/src/main/java/com/terning/feature/dialog/detail/ScrapDialog.kt @@ -36,6 +36,8 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.flowWithLifecycle import coil3.compose.AsyncImage import coil3.request.ImageRequest +import com.terning.core.analytics.EventType +import com.terning.core.analytics.LocalTracker import com.terning.core.designsystem.component.button.RoundButton import com.terning.core.designsystem.component.dialog.TerningBasicDialog import com.terning.core.designsystem.theme.Grey100 @@ -73,6 +75,8 @@ fun ScrapDialog( val context = LocalContext.current val lifecycleOwner = LocalLifecycleOwner.current val uiState by viewModel.uiState.collectAsStateWithLifecycle(lifecycleOwner = lifecycleOwner) + val amplitudeTracker = LocalTracker.current + LaunchedEffect(viewModel.sideEffect, lifecycleOwner) { viewModel.sideEffect.flowWithLifecycle(lifecycle = lifecycleOwner.lifecycle) .collect { sideEffect -> @@ -123,21 +127,29 @@ fun ScrapDialog( isColorChanged = uiState.isColorChanged, onClickColorButton = viewModel::changeSelectedColor, onClickColorChangeButton = { - if (uiState.isColorChanged) + if (uiState.isColorChanged) { + amplitudeTracker.track( + type = EventType.CLICK, + name = "modal_color" + ) viewModel.patchScrap( scrapId = internshipAnnouncementId, color = uiState.selectedColorType ) + } }, onClickNavigateButton = viewModel::navigateToDetail, onClickScrapButton = { + amplitudeTracker.track( + type = EventType.CLICK, + name = "modal_calender" + ) viewModel.postScrap(internshipAnnouncementId, uiState.selectedColorType) } ) } } - @Composable private fun ScrapDialogScreen( title: String, From ec63f97b72a941efc4dfae5ed0eab05dcd6f06a1 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Wed, 23 Oct 2024 05:28:39 +0900 Subject: [PATCH 14/21] [FEAT/#294] intern detail url amplitude --- .../terning/feature/intern/component/InternBottomBar.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/feature/src/main/java/com/terning/feature/intern/component/InternBottomBar.kt b/feature/src/main/java/com/terning/feature/intern/component/InternBottomBar.kt index bf5b2f1b..d61ee10a 100644 --- a/feature/src/main/java/com/terning/feature/intern/component/InternBottomBar.kt +++ b/feature/src/main/java/com/terning/feature/intern/component/InternBottomBar.kt @@ -15,6 +15,8 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel +import com.terning.core.analytics.EventType +import com.terning.core.analytics.LocalTracker import com.terning.core.designsystem.component.button.RoundButton import com.terning.core.designsystem.theme.Grey150 import com.terning.core.designsystem.theme.Grey350 @@ -27,7 +29,6 @@ import com.terning.core.extension.noRippleClickable import com.terning.domain.entity.intern.InternInfo import com.terning.feature.R import com.terning.feature.intern.InternViewModel -import com.terning.feature.intern.model.InternUiState @Composable fun InternBottomBar( @@ -36,6 +37,8 @@ fun InternBottomBar( onScrapClick: (InternInfo) -> Unit, viewModel: InternViewModel = hiltViewModel(), ) { + val amplitudeTracker = LocalTracker.current + Row( modifier = modifier .fillMaxWidth() @@ -92,6 +95,10 @@ fun InternBottomBar( cornerRadius = 10.dp, text = R.string.intern_move_to_site, onButtonClick = { + amplitudeTracker.track( + type = EventType.CLICK, + name = "detail_url" + ) viewModel.updateShowWeb(true) }, ) From 2ef1b9e528272cd2d565009fd8a9da5224c7ae81 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Wed, 23 Oct 2024 05:30:44 +0900 Subject: [PATCH 15/21] [FEAT/#294] dialog cancel amplitude --- .../dialog/cancel/ScrapCancelDialog.kt | 87 +++++++++++-------- 1 file changed, 49 insertions(+), 38 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/dialog/cancel/ScrapCancelDialog.kt b/feature/src/main/java/com/terning/feature/dialog/cancel/ScrapCancelDialog.kt index 9700fa9e..cc4e0300 100644 --- a/feature/src/main/java/com/terning/feature/dialog/cancel/ScrapCancelDialog.kt +++ b/feature/src/main/java/com/terning/feature/dialog/cancel/ScrapCancelDialog.kt @@ -19,6 +19,8 @@ import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.LocalLifecycleOwner import androidx.lifecycle.flowWithLifecycle +import com.terning.core.analytics.EventType +import com.terning.core.analytics.LocalTracker import com.terning.core.designsystem.component.button.RoundButton import com.terning.core.designsystem.component.dialog.TerningBasicDialog import com.terning.core.designsystem.component.item.TerningLottieAnimation @@ -37,13 +39,16 @@ fun ScrapCancelDialog( ) { val context = LocalContext.current val lifecycleOwner = LocalLifecycleOwner.current + val amplitudeTracker = LocalTracker.current + LaunchedEffect(viewModel.sideEffect, lifecycleOwner) { viewModel.sideEffect.flowWithLifecycle(lifecycle = lifecycleOwner.lifecycle) - .collect{ sideEffect -> - when(sideEffect){ + .collect { sideEffect -> + when (sideEffect) { is ScrapCancelSideEffect.DismissDialog -> { onDismissRequest(true) } + is ScrapCancelSideEffect.ShowToast -> { context.toast(sideEffect.message) } @@ -53,7 +58,13 @@ fun ScrapCancelDialog( ScrapCancelScreen( onDismissRequest = { onDismissRequest(false) }, - onClickScrapCancel = { viewModel.deleteScrap(internshipAnnouncementId) } + onClickScrapCancel = { + amplitudeTracker.track( + type = EventType.CLICK, + name = "detail_cancel_scrap" + ) + viewModel.deleteScrap(internshipAnnouncementId) + } ) } @@ -66,48 +77,48 @@ private fun ScrapCancelScreen( TerningBasicDialog( onDismissRequest = onDismissRequest ) { - Column( + Column( + modifier = Modifier + .fillMaxWidth() + .wrapContentHeight() + .padding(top = 60.dp) + .padding(horizontal = 16.dp), + horizontalAlignment = Alignment.CenterHorizontally + ) { + TerningLottieAnimation( + jsonString = "terning_scrap_cancel.json", modifier = Modifier .fillMaxWidth() - .wrapContentHeight() - .padding(top = 60.dp) - .padding(horizontal = 16.dp), - horizontalAlignment = Alignment.CenterHorizontally - ) { - TerningLottieAnimation( - jsonString = "terning_scrap_cancel.json", - modifier = Modifier - .fillMaxWidth() - .height(203.dp) - ) + .height(203.dp) + ) - Spacer(modifier = Modifier.height(20.dp)) + Spacer(modifier = Modifier.height(20.dp)) - Text( - text = stringResource(id = R.string.dialog_content_scrap_cancel_main_title), - textAlign = TextAlign.Center, - style = TerningTheme.typography.title4, - color = Grey500, - ) + Text( + text = stringResource(id = R.string.dialog_content_scrap_cancel_main_title), + textAlign = TextAlign.Center, + style = TerningTheme.typography.title4, + color = Grey500, + ) - Spacer(modifier = Modifier.height(5.dp)) + Spacer(modifier = Modifier.height(5.dp)) - Text( - text = stringResource(id = R.string.dialog_content_scrap_cancel_sub_title), - style = TerningTheme.typography.body5, - color = Grey350 - ) - Spacer(modifier = Modifier.height(40.dp)) + Text( + text = stringResource(id = R.string.dialog_content_scrap_cancel_sub_title), + style = TerningTheme.typography.body5, + color = Grey350 + ) + Spacer(modifier = Modifier.height(40.dp)) - RoundButton( - style = TerningTheme.typography.button3, - paddingVertical = 12.dp, - cornerRadius = 8.dp, - text = R.string.dialog_scrap_cancel_button, - onButtonClick = onClickScrapCancel - ) - Spacer(modifier = Modifier.height(16.dp)) - } + RoundButton( + style = TerningTheme.typography.button3, + paddingVertical = 12.dp, + cornerRadius = 8.dp, + text = R.string.dialog_scrap_cancel_button, + onButtonClick = onClickScrapCancel + ) + Spacer(modifier = Modifier.height(16.dp)) + } } } From e46ad2d3790223d5ba6e408562f57fe929b3f34d Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Wed, 23 Oct 2024 05:32:28 +0900 Subject: [PATCH 16/21] [FEAT/#294] intern detail scrap amplitude --- .../main/java/com/terning/feature/intern/InternRoute.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/feature/src/main/java/com/terning/feature/intern/InternRoute.kt b/feature/src/main/java/com/terning/feature/intern/InternRoute.kt index 2f8e19db..4ca709ba 100644 --- a/feature/src/main/java/com/terning/feature/intern/InternRoute.kt +++ b/feature/src/main/java/com/terning/feature/intern/InternRoute.kt @@ -24,6 +24,8 @@ import androidx.lifecycle.compose.LocalLifecycleOwner import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.flowWithLifecycle import androidx.navigation.NavHostController +import com.terning.core.analytics.EventType +import com.terning.core.analytics.LocalTracker import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar import com.terning.core.designsystem.theme.CalRed import com.terning.core.designsystem.theme.Grey200 @@ -54,6 +56,7 @@ fun InternRoute( val context = LocalContext.current val lifecycleOwner = LocalLifecycleOwner.current val internState by viewModel.internUiState.collectAsStateWithLifecycle(lifecycleOwner) + val amplitudeTracker = LocalTracker.current LaunchedEffect(key1 = true) { viewModel.getInternInfo(announcementId) @@ -94,6 +97,10 @@ fun InternRoute( viewModel.updateScrapCancelDialogVisibility(true) }, onClickScrapButton = { + amplitudeTracker.track( + type = EventType.CLICK, + name = "detail_scrap" + ) viewModel.updateInternDialogVisibility(true) } ) From f787314457c34461c300be6b7a08c17f5e23a864 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Wed, 23 Oct 2024 06:02:00 +0900 Subject: [PATCH 17/21] [FEAT/#294] calendar list amplitude --- .../feature/calendar/calendar/CalendarRoute.kt | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/calendar/calendar/CalendarRoute.kt b/feature/src/main/java/com/terning/feature/calendar/calendar/CalendarRoute.kt index fd8e24bd..b6bee6d7 100644 --- a/feature/src/main/java/com/terning/feature/calendar/calendar/CalendarRoute.kt +++ b/feature/src/main/java/com/terning/feature/calendar/calendar/CalendarRoute.kt @@ -22,6 +22,8 @@ import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.LocalLifecycleOwner import androidx.lifecycle.compose.collectAsStateWithLifecycle +import com.terning.core.analytics.EventType +import com.terning.core.analytics.LocalTracker import com.terning.core.designsystem.component.topappbar.CalendarTopAppBar import com.terning.core.designsystem.theme.Grey200 import com.terning.core.designsystem.theme.White @@ -45,6 +47,7 @@ fun CalendarRoute( ) { val lifecycleOwner = LocalLifecycleOwner.current val uiState by viewModel.uiState.collectAsStateWithLifecycle(lifecycleOwner = lifecycleOwner) + val amplitudeTracker = LocalTracker.current CalendarScreen( modifier = modifier, @@ -54,7 +57,15 @@ fun CalendarRoute( updateSelectedDate = viewModel::updateSelectedDate, disableListVisibility = { viewModel.updateListVisibility(false) }, disableWeekVisibility = { viewModel.updateWeekVisibility(false) }, - onClickListButton = { viewModel.updateListVisibility(!uiState.isListEnabled) } + onClickListButton = { + if (!uiState.isListEnabled) { + amplitudeTracker.track( + type = EventType.CLICK, + name = "calendar_list" + ) + } + viewModel.updateListVisibility(!uiState.isListEnabled) + } ) } @@ -132,7 +143,7 @@ private fun CalendarScreen( CalendarMonthRoute( selectedDate = uiState.selectedDate, updateSelectedDate = { newDate -> - if(!pagerState.isScrollInProgress) + if (!pagerState.isScrollInProgress) onClickNewDate(newDate) }, modifier = Modifier From 918454fe71366a94bf42a1a44d6a14e77de73f4a Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Wed, 23 Oct 2024 06:25:13 +0900 Subject: [PATCH 18/21] [FEAT/#294] home view amplitude --- .../com/terning/feature/home/HomeRoute.kt | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/home/HomeRoute.kt b/feature/src/main/java/com/terning/feature/home/HomeRoute.kt index 8962c8d5..0be11ed9 100644 --- a/feature/src/main/java/com/terning/feature/home/HomeRoute.kt +++ b/feature/src/main/java/com/terning/feature/home/HomeRoute.kt @@ -28,6 +28,8 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.flowWithLifecycle import androidx.navigation.NavHostController import com.google.accompanist.systemuicontroller.rememberSystemUiController +import com.terning.core.analytics.EventType +import com.terning.core.analytics.LocalTracker import com.terning.core.designsystem.component.bottomsheet.SortingBottomSheet import com.terning.core.designsystem.component.button.SortingButton import com.terning.core.designsystem.component.image.TerningImage @@ -80,6 +82,8 @@ fun HomeRoute( val lifecycleOwner = LocalLifecycleOwner.current val context = LocalContext.current + val amplitudeTracker = LocalTracker.current + LaunchedEffect(key1 = true) { viewModel.getProfile() viewModel.getFilteringInfo() @@ -97,8 +101,20 @@ fun HomeRoute( HomeScreen( paddingValues = paddingValues, - navigateToIntern = { navController.navigateIntern(announcementId = it) }, - navigateToCalendar = { navController.navigateCalendar() }, + navigateToIntern = { + amplitudeTracker.track( + type = EventType.CLICK, + name = "home_intern_card" + ) + navController.navigateIntern(announcementId = it) + }, + navigateToCalendar = { + amplitudeTracker.track( + type = EventType.CLICK, + name = "check_schedule" + ) + navController.navigateCalendar() + }, updateRecommendDialogVisibility = viewModel::updateRecommendDialogVisibility, updateUpcomingDialogVisibility = viewModel::updateUpcomingDialogVisibility, getHomeUpcomingInternList = viewModel::getHomeUpcomingInternList, @@ -143,6 +159,8 @@ fun HomeScreen( var changeFilteringSheetState by remember { mutableStateOf(false) } + val amplitudeTracker = LocalTracker.current + if (homeState.sortingSheetVisibility) { SortingBottomSheet( onDismiss = { @@ -316,6 +334,10 @@ fun HomeScreen( navigateToIntern = navigateToIntern, intern = homeRecommendInternList[index], onScrapButtonClicked = { + amplitudeTracker.track( + type = EventType.CLICK, + name = "home_scrap" + ) updateRecommendDialogVisibility(true) with(homeRecommendInternList[index]) { viewModel.updateHomeInternModel( From bb2010ffaa1409f7ad07ba55c8d1ce5095fa80f5 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Wed, 23 Oct 2024 06:37:08 +0900 Subject: [PATCH 19/21] [FEAT/#294] home filtering amplitude --- .../java/com/terning/feature/home/HomeRoute.kt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/home/HomeRoute.kt b/feature/src/main/java/com/terning/feature/home/HomeRoute.kt index 0be11ed9..32292065 100644 --- a/feature/src/main/java/com/terning/feature/home/HomeRoute.kt +++ b/feature/src/main/java/com/terning/feature/home/HomeRoute.kt @@ -167,9 +167,19 @@ fun HomeScreen( viewModel.updateSortingSheetVisibility(false) }, currentSortBy = homeState.sortBy.ordinal, - onSortChange = { + onSortChange = { sortBy -> + amplitudeTracker.track( + type = EventType.CLICK, + name = when (sortBy) { + 0 -> "filtered_deadline" + 1 -> "filtered_short_term" + 2 -> "filtered_long_term" + 3 -> "filtered_scraps" + else -> "filtered_hits" + } + ) viewModel.updateSortBy( - it, + sortBy, homeFilteringInfo.startYear, homeFilteringInfo.startMonth, ) From 59df1b4603689ea230b7636045d26c934b7db430 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Wed, 23 Oct 2024 06:41:09 +0900 Subject: [PATCH 20/21] [FEAT/#294] home filtering save amplitude --- feature/src/main/java/com/terning/feature/home/HomeRoute.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/feature/src/main/java/com/terning/feature/home/HomeRoute.kt b/feature/src/main/java/com/terning/feature/home/HomeRoute.kt index 32292065..bc88bac0 100644 --- a/feature/src/main/java/com/terning/feature/home/HomeRoute.kt +++ b/feature/src/main/java/com/terning/feature/home/HomeRoute.kt @@ -197,6 +197,10 @@ fun HomeScreen( defaultStartMonth = homeFilteringInfo.startMonth, onDismiss = { changeFilteringSheetState = false }, onChangeButtonClick = { grade, workingPeriod, year, month -> + amplitudeTracker.track( + type = EventType.CLICK, + name = "home_filtering_save" + ) viewModel.putFilteringInfo(grade, workingPeriod, year, month) changeFilteringSheetState = false } From 941b14975c81e69b520ac92c9943b6cad4b0097d Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Wed, 23 Oct 2024 06:46:42 +0900 Subject: [PATCH 21/21] [FEAT/#294] home remind card amplitude --- .../feature/home/component/HomeUpcomingInternScreen.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/feature/src/main/java/com/terning/feature/home/component/HomeUpcomingInternScreen.kt b/feature/src/main/java/com/terning/feature/home/component/HomeUpcomingInternScreen.kt index f94d242d..95419934 100644 --- a/feature/src/main/java/com/terning/feature/home/component/HomeUpcomingInternScreen.kt +++ b/feature/src/main/java/com/terning/feature/home/component/HomeUpcomingInternScreen.kt @@ -32,6 +32,8 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import coil3.compose.AsyncImage import coil3.request.ImageRequest +import com.terning.core.analytics.EventType +import com.terning.core.analytics.LocalTracker import com.terning.core.designsystem.component.item.ScrapBox import com.terning.core.designsystem.theme.Black import com.terning.core.designsystem.theme.Grey150 @@ -58,6 +60,8 @@ fun HomeUpcomingInternScreen( mutableStateOf(null) } + val amplitudeTracker = LocalTracker.current + LazyRow( horizontalArrangement = Arrangement.spacedBy(12.dp), contentPadding = PaddingValues(horizontal = 24.dp), @@ -82,6 +86,10 @@ fun HomeUpcomingInternScreen( modifier = Modifier .fillMaxHeight() .noRippleClickable { + amplitudeTracker.track( + type = EventType.CLICK, + name = "remind_intern_card" + ) selectedInternItem = homeUpcomingIntern updateUpcomingDialogVisibility(true) },