TP-85077 | Compose Widget View events support (#12680)
This commit is contained in:
committed by
GitHub
parent
1db9bf2749
commit
37285259fa
@@ -8,6 +8,9 @@
|
||||
package com.navi.naviwidgets.composewidget
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import com.navi.analytics.utils.NaviTrackEvent
|
||||
import com.navi.base.utils.orFalse
|
||||
import com.navi.naviwidgets.ToolbarWidget
|
||||
import com.navi.naviwidgets.WidgetTypes
|
||||
import com.navi.naviwidgets.callbacks.WidgetCallback
|
||||
@@ -62,6 +65,17 @@ fun GenericComposableWidgetFactory(
|
||||
isFirstItemVisible: Boolean = false,
|
||||
onWidgetUpdate: (updatedData: GenericWidgetDataInfo) -> Unit = {}
|
||||
) {
|
||||
LaunchedEffect(key1 = data.toString()) {
|
||||
data?.widgetAnalyticsProperties?.let {
|
||||
NaviTrackEvent.trackEvent(
|
||||
eventName = it.name.orEmpty(),
|
||||
eventValues = it.properties,
|
||||
it.isNeededForAppsflyer.orFalse(),
|
||||
it.isNeededForFirebase.orFalse()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
when (data?.widgetNameForBaseAdapter) {
|
||||
WidgetTypes.CARD_WITH_FLIP_ANIMATION.value -> {
|
||||
CardWithFlipAnimationComposable((data as? CardWithFlipAnimationWidget), widgetCallback)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2019-2023 by Navi Technologies Limited
|
||||
* * Copyright © 2019-2024 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
@@ -10,6 +10,7 @@ package com.navi.naviwidgets.models
|
||||
import android.os.Parcelable
|
||||
import com.google.firebase.Timestamp
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import com.navi.base.model.AnalyticsEvent
|
||||
import com.navi.naviwidgets.models.response.Gradient
|
||||
import com.navi.naviwidgets.models.response.WidgetError
|
||||
import java.io.Serializable
|
||||
@@ -45,7 +46,9 @@ open class GenericWidgetDataInfo(
|
||||
override var isDependencyWidgetShowing: Boolean?,
|
||||
override var widgetError: WidgetError?,
|
||||
@SerializedName("widgetLayoutParams") var widgetLayoutParams: WidgetLayoutParams? = null,
|
||||
@SerializedName("widgetDisplayToUser") var widgetDisplayToUser: Boolean = true
|
||||
@SerializedName("widgetDisplayToUser") var widgetDisplayToUser: Boolean = true,
|
||||
@SerializedName("widgetAnalyticsProperties")
|
||||
var widgetAnalyticsProperties: AnalyticsEvent? = null
|
||||
) : NaviWidget()
|
||||
|
||||
@Parcelize
|
||||
|
||||
Reference in New Issue
Block a user