File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed
feature/foryou/src/main/java/com/google/samples/apps/nowinandroid/feature/foryou Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -131,17 +131,7 @@ class ForYouViewModel @Inject constructor(
131131 if (newsResourceId == deepLinkedNewsResource.value?.id) {
132132 savedStateHandle[LINKED_NEWS_RESOURCE_ID ] = null
133133 }
134- analyticsHelper.logEvent(
135- AnalyticsEvent (
136- type = " news_deep_link_opened" ,
137- extras = listOf (
138- Param (
139- key = LINKED_NEWS_RESOURCE_ID ,
140- value = newsResourceId,
141- ),
142- ),
143- ),
144- )
134+ analyticsHelper.logNewsDeepLinkOpen(newsResourceId = newsResourceId)
145135 viewModelScope.launch {
146136 userDataRepository.setNewsResourceViewed(
147137 newsResourceId = newsResourceId,
@@ -156,3 +146,16 @@ class ForYouViewModel @Inject constructor(
156146 }
157147 }
158148}
149+
150+ private fun AnalyticsHelper.logNewsDeepLinkOpen (newsResourceId : String ) =
151+ logEvent(
152+ AnalyticsEvent (
153+ type = " news_deep_link_opened" ,
154+ extras = listOf (
155+ Param (
156+ key = LINKED_NEWS_RESOURCE_ID ,
157+ value = newsResourceId,
158+ ),
159+ ),
160+ ),
161+ )
You can’t perform that action at this time.
0 commit comments