TP-12345 | upi fixes (#11715)
This commit is contained in:
@@ -78,6 +78,7 @@ fun QRCodeCarouselSection(
|
||||
when (card?.cardType) {
|
||||
CardType.ONBOARDED -> QROnboardedView(card, onSelected)
|
||||
CardType.NON_ONBOARDED -> QRNonOnboardedView(card, onSelected)
|
||||
CardType.REMOVE_AND_ADD_SAVING_ACCOUNT -> QRNonOnboardedView(card, onSelected)
|
||||
CardType.ADD_SAVING_ACCOUNT -> QRNonOnboardedView(card, onSelected)
|
||||
CardType.ADD_ACCOUNT -> AddAccountCardView(card, onSelected)
|
||||
else -> {}
|
||||
|
||||
@@ -62,7 +62,9 @@ fun UPISettingContent(
|
||||
onSelected,
|
||||
drawerState
|
||||
)
|
||||
settingResponse.config?.otherUpiItems?.let { TextWithLottieSuffix(it) }
|
||||
settingResponse.config?.otherUpiItems?.let {
|
||||
TextWithLottieSuffix(otherUpiItems = it, isPlaying = drawerState().isOpen)
|
||||
}
|
||||
settingResponse.config?.items?.forEach {
|
||||
Spacer(modifier = Modifier.height(24.dp))
|
||||
SettingsMethod(it, onSelected)
|
||||
@@ -71,7 +73,7 @@ fun UPISettingContent(
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun TextWithLottieSuffix(otherUpiItems: ProfileItem?) {
|
||||
private fun TextWithLottieSuffix(otherUpiItems: ProfileItem?, isPlaying: Boolean) {
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.Center,
|
||||
@@ -91,7 +93,11 @@ private fun TextWithLottieSuffix(otherUpiItems: ProfileItem?) {
|
||||
Spacer(modifier = Modifier.width(4.dp))
|
||||
val spec = LottieCompositionSpec.Url(otherUpiItems.iconUrl.toString())
|
||||
val composition by rememberLottieComposition(spec)
|
||||
LottieAnimation(composition, iterations = LottieConstants.IterateForever)
|
||||
LottieAnimation(
|
||||
composition,
|
||||
iterations = LottieConstants.IterateForever,
|
||||
isPlaying = isPlaying
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -455,7 +455,8 @@ fun UPILiteScreen(
|
||||
onAddBalanceButtonClick = onAddBalanceButtonClick,
|
||||
onSetPinButtonClick = onSetPinButtonClick,
|
||||
onDoneButtonClick = onDoneButtonClick,
|
||||
onBackClick = onBackClick
|
||||
onBackClick = onBackClick,
|
||||
isDelayedOnboardingExperimentEnabled = isDelayedOnboardingExperimentEnabled
|
||||
)
|
||||
}
|
||||
else -> {
|
||||
|
||||
@@ -119,7 +119,8 @@ fun UPILiteSection(
|
||||
onAddBalanceButtonClick: (String, String) -> Unit,
|
||||
onSetPinButtonClick: (String, String) -> Unit,
|
||||
onDoneButtonClick: () -> Unit,
|
||||
onBackClick: () -> Unit
|
||||
onBackClick: () -> Unit,
|
||||
isDelayedOnboardingExperimentEnabled: Boolean
|
||||
) {
|
||||
|
||||
val selectedBankAccount by upiLiteViewModel.selectedBankAccount.collectAsStateWithLifecycle()
|
||||
@@ -173,6 +174,16 @@ fun UPILiteSection(
|
||||
)
|
||||
}
|
||||
|
||||
val ctaButtonEnabled by remember {
|
||||
derivedStateOf {
|
||||
if (isDelayedOnboardingExperimentEnabled)
|
||||
!enableButtonLottie && enteredAmount.isAmountValid() && !isInvalidAmount
|
||||
else
|
||||
(mainCtaState !is UPILiteMainCtaState.AddBalance) ||
|
||||
isCtaButtonActiveAndBottomSheetDismissbale
|
||||
}
|
||||
}
|
||||
|
||||
Scaffold(
|
||||
modifier = modifier,
|
||||
content = {
|
||||
@@ -532,7 +543,7 @@ fun UPILiteSection(
|
||||
LoaderRoundedButton(
|
||||
text = mainCtaState.ctaText,
|
||||
lottieFileName = NAVI_PAY_PRIMARY_CTA_LOADER_LOTTIE,
|
||||
enabled = !enableButtonLottie && enteredAmount.isAmountValid(),
|
||||
enabled = ctaButtonEnabled,
|
||||
showLoader = enableButtonLottie,
|
||||
modifier = Modifier.weight(1f).height(48.dp),
|
||||
debounceTime = 300L,
|
||||
|
||||
@@ -130,6 +130,7 @@ import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import javax.inject.Inject
|
||||
import kotlin.math.max
|
||||
import kotlin.math.min
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.async
|
||||
import kotlinx.coroutines.delay
|
||||
@@ -1142,6 +1143,7 @@ constructor(
|
||||
headerLottieFileName = NAVI_PAY_PURPLE_CTA_LOADER_LOTTIE
|
||||
)
|
||||
)
|
||||
delay(1.seconds)
|
||||
}
|
||||
naviPayAnalytics.onDevGenericEvent(
|
||||
event = ::fetchLinkedBankAccounts.name,
|
||||
@@ -1299,6 +1301,7 @@ constructor(
|
||||
headerLottieFileName = NAVI_PAY_PURPLE_CTA_LOADER_LOTTIE
|
||||
)
|
||||
)
|
||||
delay(1.seconds)
|
||||
updateSelectedBankAccount(selectedBankAccount = selectedBankAccountForTopUp)
|
||||
performRegistrationAndInitialTopUp(
|
||||
linkedAccountEntity = selectedBankAccountForTopUp,
|
||||
|
||||
@@ -372,7 +372,7 @@ const val ANIMATION_SPEC_DURATION_IN_MILLIS = 400
|
||||
// UPI Lite constants
|
||||
const val UPI_LITE_TOPUP = "UPI_LITE_TOPUP"
|
||||
const val UPI_LITE_DEREGISTRATION = "UPI_LITE_DEREGISTRATION"
|
||||
const val UPI_LITE_DEFAULT_TOPUP_AMOUNT = "10"
|
||||
const val UPI_LITE_DEFAULT_TOPUP_AMOUNT = "200"
|
||||
const val MONEY_ADDED_TO_UPI_LITE = "UPI Lite Top-up"
|
||||
const val UPI_LITE_CLOSURE = "UPI Lite Closure"
|
||||
const val UPI_LITE_CREDBLOCK_SIGNATURE = "SIGNATURE"
|
||||
|
||||
Reference in New Issue
Block a user