NTP-40796 | T-Store | payee bank addition (#15144)
This commit is contained in:
@@ -10,6 +10,7 @@ package com.navi.pay.tstore.details.ui.upi
|
||||
import androidx.compose.animation.AnimatedVisibility
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.interaction.MutableInteractionSource
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
@@ -39,6 +40,7 @@ import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import coil.compose.AsyncImage
|
||||
import com.navi.base.utils.isNotNullAndNotEmpty
|
||||
import com.navi.base.utils.orFalse
|
||||
import com.navi.common.R as CommonR
|
||||
import com.navi.common.utils.CommonUtils.getDisplayableAmount
|
||||
@@ -306,6 +308,48 @@ fun PayeeDetailSection(
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
orderEntity?.isP2PTransaction == true &&
|
||||
transactionBankInfo?.otherUserBankInfo?.bankUiModel?.name.isNotNullAndNotEmpty()
|
||||
) {
|
||||
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
Box(
|
||||
modifier =
|
||||
Modifier.size(24.dp)
|
||||
.clip(CircleShape)
|
||||
.border(
|
||||
width = 0.6.dp,
|
||||
color = NaviPayColor.borderDefault,
|
||||
shape = CircleShape,
|
||||
)
|
||||
.background(color = NaviPayColor.textWhite),
|
||||
contentAlignment = Alignment.Center,
|
||||
) {
|
||||
AsyncImage(
|
||||
modifier = Modifier.padding(4.dp),
|
||||
model =
|
||||
transactionBankInfo?.otherUserBankInfo?.bankUiModel?.iconUrl.orEmpty(),
|
||||
contentDescription = EMPTY,
|
||||
fallback = painterResource(id = R.drawable.ic_add_bank),
|
||||
)
|
||||
}
|
||||
|
||||
NaviText(
|
||||
text = transactionBankInfo?.otherUserBankInfo?.bankUiModel?.name.orEmpty(),
|
||||
fontSize = 14.sp,
|
||||
color = NaviPayColor.textTertiary,
|
||||
fontFamily = naviFontFamily,
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_BODY_REGULAR),
|
||||
modifier = Modifier.padding(horizontal = 8.dp),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,6 +117,20 @@ data class OrderEntity(
|
||||
|
||||
@IgnoredOnParcel @delegate:Ignore val formattedAmount by lazy { amount.getDisplayableAmount() }
|
||||
|
||||
@IgnoredOnParcel
|
||||
@delegate:Ignore
|
||||
val isMerchantTransaction by lazy {
|
||||
categoryTags.contains(TransactionCategoryTags.MERCHANT_PAYMENTS.value)
|
||||
}
|
||||
|
||||
@IgnoredOnParcel
|
||||
@delegate:Ignore
|
||||
val isP2PTransaction by lazy {
|
||||
(paymentModeTags.contains(TransactionPaymentModeTags.UPI.value) || isUpiLiteTransaction) &&
|
||||
!isMerchantTransaction &&
|
||||
!isOrderOfSelfTransferType
|
||||
}
|
||||
|
||||
@IgnoredOnParcel
|
||||
@delegate:Ignore
|
||||
val formattedAmountAfterCoins by lazy {
|
||||
|
||||
@@ -13,6 +13,7 @@ import android.view.LayoutInflater
|
||||
import android.view.View.GONE
|
||||
import android.view.View.VISIBLE
|
||||
import androidx.core.content.ContextCompat.getColor
|
||||
import androidx.databinding.adapters.TextViewBindingAdapter.setText
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.load.DataSource
|
||||
import com.bumptech.glide.load.engine.GlideException
|
||||
@@ -251,6 +252,27 @@ fun shareReceipt(
|
||||
}
|
||||
}
|
||||
|
||||
fun LayoutShareTransactionDetailsBinding.setPayeeBankNameAndLogo() {
|
||||
payeeBankView.apply {
|
||||
if (
|
||||
(shareReceiptEntity.isDebited || shareReceiptEntity.isSendMoneyViaUPILite) &&
|
||||
!shareReceiptEntity.isMandateTransaction &&
|
||||
shareReceiptEntity.payeeBankNameFormatted.isNotNullAndNotEmpty()
|
||||
) {
|
||||
payeeBankIcon.visibility = VISIBLE
|
||||
payeeBankName.visibility = VISIBLE
|
||||
Glide.with(context)
|
||||
.load(shareReceiptEntity.payeeBankUrl)
|
||||
.placeholder(CommonR.drawable.ic_upi_bbps_default_bank_logo)
|
||||
.error(CommonR.drawable.ic_upi_bbps_default_bank_logo)
|
||||
.into(payeeBankIcon)
|
||||
payeeBankName.apply {
|
||||
setText(shareReceiptEntity.payeeBankNameFormatted.split("-").first().trim())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun LayoutShareTransactionDetailsBinding.setPayerPayeeSecondInfo() {
|
||||
payerPayeeSecondInfo.apply {
|
||||
key.apply {
|
||||
@@ -349,6 +371,8 @@ fun shareReceipt(
|
||||
|
||||
setPayerPayeeFirstInfo()
|
||||
|
||||
setPayeeBankNameAndLogo()
|
||||
|
||||
setPayerPayeeSecondInfo()
|
||||
|
||||
transactionIdInfo.apply {
|
||||
|
||||
@@ -127,10 +127,48 @@
|
||||
android:layout_marginHorizontal="@dimen/dp_16"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/payment_status_text" />
|
||||
app:layout_constraintTop_toBottomOf="@id/payment_status_text"
|
||||
/>
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/autopay_or_payee"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/payer_payee_first_info">
|
||||
<LinearLayout
|
||||
android:id="@+id/payee_bank_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/payee_bank_icon"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_marginEnd="@dimen/dp_4"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/circular_border_dark_grey"
|
||||
android:padding="@dimen/dp_4"
|
||||
/>
|
||||
|
||||
<com.navi.design.textview.NaviTextView
|
||||
android:id="@+id/payee_bank_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/navi_body_regular"
|
||||
android:textSize="14sp"
|
||||
tools:text="15.64"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/autopay_section"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -141,25 +179,20 @@
|
||||
android:paddingVertical="@dimen/dp_2"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/bg_border_dark_grey_rounded_20"
|
||||
app:layout_constraintTop_toBottomOf="@id/payer_payee_first_info"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/amount_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
app:layout_goneMarginTop="@dimen/dp_16"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/autopay_section">
|
||||
app:layout_constraintTop_toBottomOf="@id/autopay_or_payee">
|
||||
|
||||
<com.navi.design.textview.NaviTextView
|
||||
android:id="@+id/amount_text"
|
||||
|
||||
Reference in New Issue
Block a user