TP-83752 | Re-add hide balance action (#12534)

This commit is contained in:
Ankit Yadav
2024-09-13 15:36:54 +05:30
committed by GitHub
parent 332c35f57c
commit f1c645a7ec
3 changed files with 38 additions and 0 deletions

View File

@@ -47,6 +47,7 @@ fun InitLifecycleListener(
}
Lifecycle.Event.ON_RESUME -> {
if (homeVM.shouldMakeAPICall()) {
homeVM.triggerHideBalanceAction()
callBackToActivityScreen.invoke(
HomeScreenCallbackListener.ApiCallingWithCondition
)

View File

@@ -413,6 +413,35 @@ constructor(
)
}
// TODO: Remove once delayed onboarding goes 100%
fun triggerHideBalanceAction() {
val hideBalanceActionData =
UiTronActionData(
actions =
listOf(
UpdateViewStateAction(
viewStates =
mapOf(
Constants.CHECK_BALANCE_ROW to Constants.VISIBLE,
Constants.HIDE_BALANCE_ROW to Constants.INVISIBLE,
Constants.CHECK_BALANCE_CLICK to Constants.VISIBLE,
Constants.HIDE_BALANCE_CLICK to Constants.INVISIBLE
)
),
UpdateDataAction(
viewDataList =
listOf(
UpdateDataAction.ViewData(
layoutId = Constants.BALANCE_TEXT,
data = TextData(text = Constants.BALANCE_TEXT_MASKED_VALUE)
)
)
)
)
)
handleActions(hideBalanceActionData)
}
fun fetchHomeItems(
showLoader: Boolean = true,
density: String? = null,

View File

@@ -486,6 +486,14 @@ object Constants {
const val LOTTIE_LOADER_URL =
"https://public-assets.prod.navi-sa.in/home_uitron/cta_loader.json"
// TODO: Remove these constants once delayed onboarding goes 100%
const val CHECK_BALANCE_ROW = "checkBalanceRow"
const val HIDE_BALANCE_ROW = "hideBalanceRow"
const val CHECK_BALANCE_CLICK = "checkBalanceClick"
const val HIDE_BALANCE_CLICK = "hideBalanceClick"
const val BALANCE_TEXT = "balanceText"
const val BALANCE_TEXT_MASKED_VALUE = "₹ * * * * *"
// Constants for Animation label
object AnimationLabels {
const val PROFILE_ANIMATION = "PROFILE_ANIMATION"