NTP-74177 | Removed grey out for failed & expired transactions (#16710)
This commit is contained in:
@@ -31,9 +31,6 @@ import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.graphics.ColorFilter
|
||||
import androidx.compose.ui.graphics.ColorMatrix
|
||||
import androidx.compose.ui.graphics.graphicsLayer
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
@@ -55,7 +52,6 @@ import com.navi.pay.common.ui.ImageWithCircularBackground
|
||||
import com.navi.pay.tstore.list.model.network.OrderType
|
||||
import com.navi.pay.tstore.list.model.view.OrderHistoryEntity
|
||||
import com.navi.pay.tstore.list.model.view.OrderStatusOfView
|
||||
import com.navi.pay.tstore.list.util.getFontColorForOrderHistoryList
|
||||
import com.navi.pay.tstore.list.util.getFormattedAmountColorForOrderHistoryList
|
||||
import com.navi.pay.tstore.list.util.getFormattedAmountForOrderHistoryList
|
||||
import com.navi.pay.tstore.list.util.getStatusImageForOrderHistoryList
|
||||
@@ -70,7 +66,6 @@ import com.navi.pay.utils.NAVI_UPI
|
||||
import com.navi.pay.utils.RESOURCE_DEFAULT_ID
|
||||
import com.navi.pay.utils.RUPEE_SYMBOL
|
||||
import com.navi.pay.utils.clickableDebounce
|
||||
import com.navi.pay.utils.conditional
|
||||
import com.navi.pay.utils.contactInitials
|
||||
|
||||
@Composable
|
||||
@@ -103,10 +98,7 @@ fun RenderOrderHistoryItemView(
|
||||
text = orderHistoryEntity.orderTitle,
|
||||
fontFamily = naviFontFamily,
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_HEADLINE_REGULAR),
|
||||
color =
|
||||
getFontColorForOrderHistoryList(
|
||||
status = orderHistoryEntity.orderStatusOfView
|
||||
),
|
||||
color = NaviPayColor.textPrimary,
|
||||
fontSize = 14.sp,
|
||||
lineHeight = 22.sp,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
@@ -146,10 +138,7 @@ fun RenderOrderHistoryItemView(
|
||||
fontSize = 14.sp,
|
||||
lineHeight = 22.sp,
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_BODY_REGULAR),
|
||||
color =
|
||||
getFontColorForOrderHistoryList(
|
||||
status = orderHistoryEntity.orderStatusOfView
|
||||
),
|
||||
color = NaviPayColor.textPrimary,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
modifier = Modifier.widthIn(max = 200.dp),
|
||||
maxLines = 1,
|
||||
@@ -371,13 +360,7 @@ fun LeftImageIconOfListView(index: Int, orderHistoryEntity: OrderHistoryEntity)
|
||||
when {
|
||||
orderHistoryEntity.isOrderOfSelfTransferType -> {
|
||||
Image(
|
||||
painter =
|
||||
painterResource(
|
||||
id =
|
||||
if (orderHistoryEntity.orderStatusOfView == OrderStatusOfView.Failed)
|
||||
R.drawable.ic_np_self_transfer_greyed
|
||||
else R.drawable.ic_self_transfer_pay_again
|
||||
),
|
||||
painter = painterResource(id = R.drawable.ic_self_transfer_pay_again),
|
||||
contentDescription = "",
|
||||
modifier = Modifier.size(40.dp),
|
||||
)
|
||||
@@ -397,35 +380,18 @@ fun LeftImageIconOfListView(index: Int, orderHistoryEntity: OrderHistoryEntity)
|
||||
contentAlignment = Alignment.Center,
|
||||
) {
|
||||
AsyncImage(
|
||||
modifier =
|
||||
Modifier.fillMaxSize().padding(6.dp).conditional(
|
||||
orderHistoryEntity.orderStatusOfView == OrderStatusOfView.Failed
|
||||
) {
|
||||
graphicsLayer(alpha = 0.75f)
|
||||
},
|
||||
modifier = Modifier.fillMaxSize().padding(6.dp),
|
||||
model = orderHistoryEntity.otherUserIconUrl,
|
||||
contentDescription = "",
|
||||
fallback = painterResource(id = R.drawable.ic_np_mcc_untagged),
|
||||
placeholder = painterResource(id = R.drawable.ic_np_mcc_untagged),
|
||||
error = painterResource(id = R.drawable.ic_np_mcc_untagged),
|
||||
colorFilter =
|
||||
if (orderHistoryEntity.orderStatusOfView == OrderStatusOfView.Failed) {
|
||||
ColorFilter.colorMatrix(ColorMatrix().apply { setToSaturation(0f) })
|
||||
} else {
|
||||
null
|
||||
},
|
||||
)
|
||||
|
||||
if (orderHistoryEntity.isUpiGlobalTransaction) {
|
||||
ImageWithCircularBackground(
|
||||
modifier =
|
||||
Modifier.align(Alignment.BottomEnd)
|
||||
.offset(x = (4).dp, y = (4).dp)
|
||||
.conditional(
|
||||
orderHistoryEntity.orderStatusOfView == OrderStatusOfView.Failed
|
||||
) {
|
||||
graphicsLayer(alpha = 0.75f)
|
||||
},
|
||||
Modifier.align(Alignment.BottomEnd).offset(x = (4).dp, y = (4).dp),
|
||||
boxSize = 18.dp,
|
||||
imageUrl = null,
|
||||
imageSize = 16.dp,
|
||||
@@ -437,15 +403,7 @@ fun LeftImageIconOfListView(index: Int, orderHistoryEntity: OrderHistoryEntity)
|
||||
}
|
||||
}
|
||||
orderHistoryEntity.isCashLoanTransaction || orderHistoryEntity.isHomeLoanTransaction -> {
|
||||
Box(
|
||||
modifier =
|
||||
Modifier.size(40.dp).conditional(
|
||||
orderHistoryEntity.orderStatusOfView == OrderStatusOfView.Failed
|
||||
) {
|
||||
graphicsLayer(alpha = 0.75f)
|
||||
},
|
||||
contentAlignment = Alignment.Center,
|
||||
) {
|
||||
Box(modifier = Modifier.size(40.dp), contentAlignment = Alignment.Center) {
|
||||
AsyncImage(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
model =
|
||||
@@ -455,26 +413,12 @@ fun LeftImageIconOfListView(index: Int, orderHistoryEntity: OrderHistoryEntity)
|
||||
fallback = painterResource(id = R.drawable.ic_add_bank),
|
||||
placeholder = painterResource(id = R.drawable.ic_add_bank),
|
||||
error = painterResource(id = R.drawable.ic_add_bank),
|
||||
colorFilter =
|
||||
if (orderHistoryEntity.orderStatusOfView == OrderStatusOfView.Failed) {
|
||||
ColorFilter.colorMatrix(ColorMatrix().apply { setToSaturation(0f) })
|
||||
} else {
|
||||
null
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
orderHistoryEntity.isGoldTransaction -> {
|
||||
Box(
|
||||
modifier =
|
||||
Modifier.size(40.dp).conditional(
|
||||
orderHistoryEntity.orderStatusOfView == OrderStatusOfView.Failed
|
||||
) {
|
||||
graphicsLayer(alpha = 0.75f)
|
||||
},
|
||||
contentAlignment = Alignment.Center,
|
||||
) {
|
||||
Box(modifier = Modifier.size(40.dp), contentAlignment = Alignment.Center) {
|
||||
AsyncImage(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
model = NAVI_GOLD_LOGO_URL,
|
||||
@@ -482,12 +426,6 @@ fun LeftImageIconOfListView(index: Int, orderHistoryEntity: OrderHistoryEntity)
|
||||
fallback = painterResource(id = R.drawable.ic_add_bank),
|
||||
placeholder = painterResource(id = R.drawable.ic_add_bank),
|
||||
error = painterResource(id = R.drawable.ic_add_bank),
|
||||
colorFilter =
|
||||
if (orderHistoryEntity.orderStatusOfView == OrderStatusOfView.Failed) {
|
||||
ColorFilter.colorMatrix(ColorMatrix().apply { setToSaturation(0f) })
|
||||
} else {
|
||||
null
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,13 +26,6 @@ fun getFormattedAmountColorForOrderHistoryList(
|
||||
orderType: String,
|
||||
): Color {
|
||||
return when (status) {
|
||||
OrderStatusOfView.CollectRequestExpired,
|
||||
OrderStatusOfView.RequestMoneyExpired,
|
||||
OrderStatusOfView.RequestMoneyDeclined,
|
||||
OrderStatusOfView.CollectRequestDeclined,
|
||||
OrderStatusOfView.Failed,
|
||||
OrderStatusOfView.RequestMoneyFailed,
|
||||
OrderStatusOfView.CollectRequestFailed -> NaviPayColor.textTertiary
|
||||
OrderStatusOfView.Credit ->
|
||||
if (
|
||||
orderType == OrderType.CASH_LOAN_DISBURSAL.name ||
|
||||
@@ -67,20 +60,6 @@ fun getFormattedAmountForOrderHistoryList(orderHistoryEntity: OrderHistoryEntity
|
||||
return "$amountPrefix $formattedAmount"
|
||||
}
|
||||
|
||||
fun getFontColorForOrderHistoryList(status: OrderStatusOfView): Color {
|
||||
|
||||
return when (status) {
|
||||
OrderStatusOfView.Failed,
|
||||
OrderStatusOfView.RequestMoneyExpired,
|
||||
OrderStatusOfView.CollectRequestExpired,
|
||||
OrderStatusOfView.CollectRequestFailed,
|
||||
OrderStatusOfView.RequestMoneyFailed -> NaviPayColor.textTertiary
|
||||
else -> {
|
||||
return NaviPayColor.textPrimary
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun getStatusImageForOrderHistoryList(status: OrderStatusOfView): Int {
|
||||
return when (status) {
|
||||
OrderStatusOfView.Failed,
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="40dp"
|
||||
android:height="40dp"
|
||||
android:viewportWidth="40"
|
||||
android:viewportHeight="40">
|
||||
<path
|
||||
android:pathData="M0,20C0,31.046 8.954,40 20,40C31.046,40 40,31.046 40,20C40,8.954 31.046,0 20,0C8.954,0 0,8.954 0,20Z"
|
||||
android:fillColor="#FAFAFA"/>
|
||||
<path
|
||||
android:pathData="M30.51,27.96V31C30.51,31.55 30.06,32 29.51,32H25.52C26.22,31.24 26.63,30.2 26.63,29.18C26.63,27.23 25.04,25.65 23.1,25.65H18.91L20.06,24.5C20.33,24.22 20.33,23.78 20.06,23.51C19.79,23.24 19.34,23.23 19.07,23.51L16.72,25.85C16.59,25.98 16.52,26.16 16.52,26.35C16.52,26.53 16.59,26.71 16.72,26.84L19.07,29.19C19.21,29.32 19.39,29.39 19.56,29.39C19.74,29.39 19.92,29.32 20.06,29.19C20.33,28.91 20.33,28.47 20.06,28.2L18.91,27.05H23.1C24.27,27.05 25.23,28 25.23,29.18C25.23,29.93 24.89,30.7 24.33,31.23C23.95,31.59 23.48,31.85 22.91,32H10.5C9.95,32 9.5,31.55 9.5,31V27.96C9.5,24.09 12.39,21.65 16.03,20.65C18.56,19.95 21.45,19.95 23.98,20.65C27.62,21.65 30.51,24.09 30.51,27.96Z"
|
||||
android:fillColor="#A8A8A8"/>
|
||||
<path
|
||||
android:pathData="M20.01,17.7C22.688,17.7 24.86,15.529 24.86,12.85C24.86,10.171 22.688,8 20.01,8C17.331,8 15.16,10.171 15.16,12.85C15.16,15.529 17.331,17.7 20.01,17.7Z"
|
||||
android:fillColor="#A8A8A8"/>
|
||||
</vector>
|
||||
@@ -151,13 +151,13 @@ class OrderListViewPropertyUtilTest {
|
||||
fun testGetFormattedAmountColorForOrderHistoryList() {
|
||||
val testCases =
|
||||
listOf(
|
||||
OrderStatusOfView.CollectRequestExpired to NaviPayColor.textTertiary,
|
||||
OrderStatusOfView.RequestMoneyExpired to NaviPayColor.textTertiary,
|
||||
OrderStatusOfView.RequestMoneyDeclined to NaviPayColor.textTertiary,
|
||||
OrderStatusOfView.CollectRequestDeclined to NaviPayColor.textTertiary,
|
||||
OrderStatusOfView.Failed to NaviPayColor.textTertiary,
|
||||
OrderStatusOfView.RequestMoneyFailed to NaviPayColor.textTertiary,
|
||||
OrderStatusOfView.CollectRequestFailed to NaviPayColor.textTertiary,
|
||||
OrderStatusOfView.CollectRequestExpired to NaviPayColor.textPrimary,
|
||||
OrderStatusOfView.RequestMoneyExpired to NaviPayColor.textPrimary,
|
||||
OrderStatusOfView.RequestMoneyDeclined to NaviPayColor.textPrimary,
|
||||
OrderStatusOfView.CollectRequestDeclined to NaviPayColor.textPrimary,
|
||||
OrderStatusOfView.Failed to NaviPayColor.textPrimary,
|
||||
OrderStatusOfView.RequestMoneyFailed to NaviPayColor.textPrimary,
|
||||
OrderStatusOfView.CollectRequestFailed to NaviPayColor.textPrimary,
|
||||
OrderStatusOfView.Credit to NaviPayColor.ctaPriority,
|
||||
OrderStatusOfView.Debit to NaviPayColor.textPrimary,
|
||||
OrderStatusOfView.Pending to NaviPayColor.textPrimary,
|
||||
|
||||
Reference in New Issue
Block a user