NTP-24902 | Divyesh | arc design fixes (#14848)

Co-authored-by: navi-android[bot] <194247829+navi-android[bot]@users.noreply.github.com>
This commit is contained in:
Divyesh Shinde
2025-02-04 19:05:17 +05:30
committed by GitHub
parent df285218f4
commit 62ba108bdf
5 changed files with 28 additions and 7 deletions

View File

@@ -20,5 +20,6 @@ data class OrderHistoryDetailItemProperty(
val iconId: Int?,
val lottieFileName: String?,
val isLottieIterationInfinite: Boolean?,
val isCoinUsedStrikeThroughVisible: Boolean = false,
val isCoinUtilisationBannerVisible: Boolean = false,
)

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2024 by Navi Technologies Limited
* * Copyright © 2024-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -27,4 +27,6 @@ enum class OrderPaymentStatus {
fun isPending() = this == PENDING || this == CREATED
fun isFailed() = this == FAILED || this == REFUNDED
fun isSuccess() = this == SUCCESS
}

View File

@@ -20,6 +20,7 @@ import com.navi.pay.tstore.details.model.view.OrderPaymentStatus
import com.navi.pay.tstore.details.model.view.OrderProductType
import com.navi.pay.tstore.list.model.view.OrderEntity
import com.navi.pay.utils.ZERO_STRING
import com.navi.pay.utils.getDisplayableAmount
object OrderBbpsUtils {
private const val CATEGORY_ID_FASTAG = "FASTAG"
@@ -88,7 +89,9 @@ object OrderBbpsUtils {
) {
resourceProvider.getString(
R.string.np_bbps_coin_refund_message_failed,
orderEntity.orderDetails.coinsUsed.orEmpty(),
orderEntity.orderDetails.coinsUsed
?.getDisplayableAmount()
.orEmpty(),
)
} else {
EMPTY
@@ -112,7 +115,9 @@ object OrderBbpsUtils {
) {
resourceProvider.getString(
R.string.np_bbps_coin_refund_message_failed,
orderEntity.orderDetails.coinsUsed.orEmpty(),
orderEntity.orderDetails.coinsUsed
?.getDisplayableAmount()
.orEmpty(),
)
} else {
EMPTY
@@ -136,7 +141,9 @@ object OrderBbpsUtils {
) {
resourceProvider.getString(
R.string.np_bbps_coin_refund_message_failed,
orderEntity.orderDetails.coinsUsed.orEmpty(),
orderEntity.orderDetails.coinsUsed
?.getDisplayableAmount()
.orEmpty(),
)
} else {
EMPTY
@@ -223,7 +230,7 @@ object OrderBbpsUtils {
if (orderEntity == null) {
return null
}
if (orderEntity.paymentStatus.isFailed()) {
if (!orderEntity.paymentStatus.isSuccess()) {
return null
}
if (!orderEntity.orderStatusOfView.isPending().orTrue()) {

View File

@@ -73,7 +73,7 @@ internal fun PaymentStatusSection(
) {
NaviText(
text =
if (orderHistoryDetailItemProperty.isCoinUtilisationBannerVisible) {
if (orderHistoryDetailItemProperty.isCoinUsedStrikeThroughVisible) {
stringResource(
id = R.string.rupee_symbol_x,
orderEntity?.formattedAmountAfterCoins.orEmpty(),
@@ -93,7 +93,7 @@ internal fun PaymentStatusSection(
overflow = TextOverflow.Ellipsis,
)
if (orderHistoryDetailItemProperty.isCoinUtilisationBannerVisible) {
if (orderHistoryDetailItemProperty.isCoinUsedStrikeThroughVisible) {
NaviText(
text =
stringResource(

View File

@@ -1396,6 +1396,9 @@ constructor(
iconId = CommonR.drawable.ic_payment_success_v2,
lottieFileName = null,
isLottieIterationInfinite = true,
isCoinUsedStrikeThroughVisible =
orderEntity.orderDetails.coinsUsed.isNotNullAndNotEmpty() &&
orderEntity.orderDetails.coinsUsed != ZERO_STRING,
isCoinUtilisationBannerVisible =
orderEntity.orderDetails.coinsUsed.isNotNullAndNotEmpty() &&
orderEntity.orderDetails.coinsUsed != ZERO_STRING,
@@ -1414,6 +1417,12 @@ constructor(
iconId = CommonR.drawable.ic_payment_failure_v2,
lottieFileName = null,
isLottieIterationInfinite = true,
isCoinUsedStrikeThroughVisible =
orderEntity.orderDetails.coinsUsed.isNotNullAndNotEmpty() &&
orderEntity.orderDetails.coinsUsed != ZERO_STRING &&
(orderEntity.paymentStatus == OrderPaymentStatus.SUCCESS ||
orderEntity.paymentStatus == OrderPaymentStatus.REFUNDED ||
orderEntity.paymentStatus == OrderPaymentStatus.REFUND_FAILED),
isCoinUtilisationBannerVisible = false,
)
OrderStatusOfView.RequestMoneyExpired,
@@ -1429,6 +1438,7 @@ constructor(
iconId = R.drawable.ic_np_payment_expired_v2,
lottieFileName = null,
isLottieIterationInfinite = true,
isCoinUsedStrikeThroughVisible = false,
isCoinUtilisationBannerVisible = false,
)
OrderStatusOfView.CollectRequestDeclined,
@@ -1444,6 +1454,7 @@ constructor(
iconId = CommonR.drawable.ic_payment_failure_v2,
lottieFileName = null,
isLottieIterationInfinite = true,
isCoinUsedStrikeThroughVisible = false,
isCoinUtilisationBannerVisible = false,
)
else ->