NTP-1234 | Initiative | App Size Reduction | Asset and Dex (#14274)
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
package com.navi.naviwidgets
|
||||
|
||||
import com.google.gson.*
|
||||
import com.navi.analytics.utils.NaviTrackEvent
|
||||
import com.navi.insurance.models.response.BenefitExplainerTabsData
|
||||
import com.navi.insurance.models.response.BenefitExplainerTabsList
|
||||
import com.navi.insurance.models.response.BenefitExplainerTabsWidgetList
|
||||
@@ -51,6 +52,12 @@ class WidgetDataDeserializer : JsonDeserializer<GenericWidgetDataInfo> {
|
||||
): GenericWidgetDataInfo? {
|
||||
json?.let {
|
||||
val jsonObject = it.asJsonObject
|
||||
jsonObject["widgetName"].asString?.let { usageKey ->
|
||||
NaviTrackEvent.trackEvent(
|
||||
eventName = "dev_app_size_reduction_widget_usage",
|
||||
eventValues = mapOf("usageKey" to usageKey)
|
||||
)
|
||||
}
|
||||
return when (jsonObject["widgetName"].asString) {
|
||||
WidgetTypes.DASHBOARD_INSURANCE_DETAILS_WIDGET_V2.value -> {
|
||||
Gson().fromJson(jsonObject, DashboardInsuranceDetailsWidgetV2::class.java)
|
||||
|
||||
@@ -38,6 +38,7 @@ import com.airbnb.lottie.LottieAnimationView
|
||||
import com.airbnb.lottie.LottieCompositionFactory
|
||||
import com.airbnb.lottie.LottieDrawable
|
||||
import com.google.gson.Gson
|
||||
import com.navi.analytics.utils.NaviTrackEvent
|
||||
import com.navi.base.model.ActionData
|
||||
import com.navi.base.model.CtaData
|
||||
import com.navi.base.model.DrawableData
|
||||
@@ -981,6 +982,14 @@ fun LottieAnimationView.showWhenDataIsAvailable(
|
||||
lottieUrl: String? = null,
|
||||
onAnimationEnd: (() -> Unit)? = null,
|
||||
) {
|
||||
lottieName?.let { usageKey ->
|
||||
if (!usageKey.contains(other = "https://")) {
|
||||
NaviTrackEvent.trackEvent(
|
||||
eventName = "dev_app_size_reduction_lottie_usage",
|
||||
eventValues = mapOf("usageKey" to usageKey)
|
||||
)
|
||||
}
|
||||
}
|
||||
lottieName?.let { nonNullLottieName ->
|
||||
visibility = VISIBLE
|
||||
var isInAppLottie = true
|
||||
|
||||
@@ -10,6 +10,7 @@ package com.navi.naviwidgets.utils
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.widget.ImageView
|
||||
import com.google.firebase.crashlytics.FirebaseCrashlytics
|
||||
import com.navi.analytics.utils.NaviTrackEvent
|
||||
import com.navi.base.model.ImageDetail
|
||||
import com.navi.design.R as DesignR
|
||||
import com.navi.naviwidgets.R
|
||||
@@ -925,6 +926,14 @@ object NaviWidgetIconUtils {
|
||||
}
|
||||
|
||||
fun getImageFromIconCode(iconCode: String?): Int {
|
||||
iconCode?.let { usageKey ->
|
||||
if (!usageKey.contains(other = "https://")) {
|
||||
NaviTrackEvent.trackEvent(
|
||||
eventName = "dev_app_size_reduction_icon_usage",
|
||||
eventValues = mapOf("usageKey" to usageKey)
|
||||
)
|
||||
}
|
||||
}
|
||||
return when (iconCode) {
|
||||
WHATSAPP_ICON -> R.drawable.ic_whatsapp_background_svg
|
||||
ICON_INFO -> R.drawable.ic_info_gray
|
||||
|
||||
Reference in New Issue
Block a user