NTP-7163 | Temporary changes for screen render time (#14019)

This commit is contained in:
shankar yadav
2024-12-06 16:45:18 +05:30
committed by GitHub
parent ca2e2ae1f1
commit 6124121f31
18 changed files with 157 additions and 33 deletions

View File

@@ -27,7 +27,6 @@ fun InitInvestmentsScreenComponents(
investmentsScreenHelper = investmentsScreenHelper,
bottomNavBarVM = bottomNavBarVM
)
LaunchedEffect(Unit) {
investmentsTabVM.fireEvent(
eventName = InvestmentTabEvents.INVESTMENT_TAB_INIT_LANDING_PAGE.eventName,

View File

@@ -14,6 +14,7 @@ import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleEventObserver
import com.naviapp.common.viewmodel.BottomNavBarVM
import com.naviapp.home.dashboard.viewmodels.InvestmentsVm
import com.naviapp.utils.Constants.INVESTMENT_TAB_SCREEN_V3
@Composable
fun InitLifeCycleListener(
@@ -26,6 +27,7 @@ fun InitLifeCycleListener(
val observer = LifecycleEventObserver { _, event ->
when (event) {
Lifecycle.Event.ON_RESUME -> {
investmentsTabVM.recordApiStartTime(INVESTMENT_TAB_SCREEN_V3)
investmentsScreenHelper.refreshInvestmentTabScreen(investmentsTabVM)
}
Lifecycle.Event.ON_STOP -> {

View File

@@ -12,6 +12,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.navi.common.model.ModuleNameV2
import com.navi.common.ui.errorview.FullScreenErrorComposeView
import com.navi.common.utils.setStatusBarColorInt
import com.navi.design.utils.parseColorSafe
@@ -24,6 +25,7 @@ import com.naviapp.home.dashboard.ui.compose.investmentTab.InvestmentsTabShimmer
import com.naviapp.home.dashboard.viewmodels.InvestmentsVm
import com.naviapp.home.utils.InvestmentTabEvents
import com.naviapp.home.viewmodel.SharedVM
import com.naviapp.utils.Constants.INVESTMENT_TAB_SCREEN_V3
@Composable
fun InvestmentsScreen(
@@ -70,6 +72,10 @@ fun InvestmentsScreen(
investmentsScreenHelper = investmentsScreenHelper,
bottomNavBarVM = bottomNavBarVM
)
investmentsTabVm.recordScreenRenderTime(
INVESTMENT_TAB_SCREEN_V3,
ModuleNameV2.AMC.name
)
}
}
is InvestmentsVm.InvestmentsTabScreenState.Error -> {
@@ -77,6 +83,10 @@ fun InvestmentsScreen(
error = investmentsScreenData.error,
onRetryClick = { investmentsTabVm.fetchInvestmentTabScreen() }
)
investmentsTabVm.recordScreenRenderTime(
INVESTMENT_TAB_SCREEN_V3,
ModuleNameV2.AMC.name
)
}
}
}

View File

@@ -115,6 +115,10 @@ constructor(
val bottomStickyNudgeData: StateFlow<InvestmentTabNudgeData?>
get() = _bottomStickyNudgeData
init {
recordScreenLandTime(INVESTMENT_TAB_SCREEN_V3)
}
fun setTimerChangeData(data: String?) {
_cutOffTimerDataChange.value = data
}
@@ -212,6 +216,7 @@ constructor(
val response =
investmentsTabRepository.fetchInvestmentTabScreenResponse(screenName, metricInfo)
if (response.isValidResponse()) {
recordApiEndTime(INVESTMENT_TAB_SCREEN_V3)
response.data?.let { data ->
_statusBarColor.emit(data.metaData?.get(STATUS_BAR_COLOR) ?: YELLOW_COLOR)
data.bottomStickyNudgeData?.let {