TP-76356 | Mehul | Credit card P1 uat fixes (#12568)
This commit is contained in:
@@ -26,10 +26,14 @@ import androidx.compose.ui.platform.SoftwareKeyboardController
|
||||
import androidx.core.content.getSystemService
|
||||
import com.google.accompanist.navigation.material.BottomSheetNavigator
|
||||
import com.google.accompanist.navigation.material.ExperimentalMaterialNavigationApi
|
||||
import com.navi.bbps.common.DATE_TIME_FORMAT_DATE_MONTH_NAME_YEAR
|
||||
import com.navi.bbps.common.theme.NaviBbpsColor
|
||||
import com.navi.common.utils.ClickDebounce
|
||||
import com.navi.common.utils.get
|
||||
import com.navi.design.utils.shimmerEffect
|
||||
import java.text.DateFormatSymbols
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.async
|
||||
import kotlinx.coroutines.awaitAll
|
||||
@@ -93,3 +97,26 @@ fun String.initials(): String {
|
||||
}
|
||||
return name[0].uppercase()
|
||||
}
|
||||
|
||||
fun getSimpleDateFormat(): SimpleDateFormat {
|
||||
return SimpleDateFormat(DATE_TIME_FORMAT_DATE_MONTH_NAME_YEAR, Locale.ENGLISH).apply {
|
||||
dateFormatSymbols =
|
||||
DateFormatSymbols(Locale.ENGLISH).apply {
|
||||
shortMonths =
|
||||
arrayOf(
|
||||
"Jan",
|
||||
"Feb",
|
||||
"Mar",
|
||||
"Apr",
|
||||
"May",
|
||||
"Jun",
|
||||
"Jul",
|
||||
"Aug",
|
||||
"Sep",
|
||||
"Oct",
|
||||
"Nov",
|
||||
"Dec"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -595,7 +595,7 @@ fun InputTextFieldWithDescriptionHeader(
|
||||
Row(verticalAlignment = Alignment.Top, modifier = Modifier.fillMaxWidth()) {
|
||||
Image(
|
||||
modifier = Modifier.padding(top = 2.dp).size(12.dp),
|
||||
painter = painterResource(id = CommonR.drawable.ic_error_red_gradient),
|
||||
painter = painterResource(id = CommonR.drawable.ic_red_alert_error),
|
||||
contentDescription = ""
|
||||
)
|
||||
Spacer(modifier = Modifier.width(4.dp))
|
||||
|
||||
@@ -215,7 +215,7 @@ fun RenderBillerListScreen(
|
||||
naviBbpsAnalytics = naviBbpsAnalytics
|
||||
)
|
||||
}
|
||||
item { Spacer(modifier = Modifier.height(8.dp)) }
|
||||
item { Spacer(modifier = Modifier.height(4.dp)) }
|
||||
}
|
||||
|
||||
if (isSearchQueryEmpty and isRecentBillsMoreThanZero) {
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
package com.navi.bbps.feature.category
|
||||
|
||||
import androidx.compose.runtime.mutableStateListOf
|
||||
import androidx.compose.runtime.snapshots.Snapshot
|
||||
import androidx.lifecycle.SavedStateHandle
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.google.gson.Gson
|
||||
@@ -445,7 +446,11 @@ constructor(
|
||||
dismissBillHandler.getDismissedBills(unpaidBills = unpaidBills).map { it.billId }
|
||||
|
||||
val nonDismissedUnpaidBills = unpaidBills.filter { !dismissedBills.contains(it.billId) }
|
||||
_nonDismissedUnpaidBills.refresh(nonDismissedUnpaidBills)
|
||||
|
||||
// to ensure that state is modified in a snapshot-aware context
|
||||
Snapshot.withMutableSnapshot {
|
||||
_nonDismissedUnpaidBills.refresh(nonDismissedUnpaidBills)
|
||||
}
|
||||
|
||||
naviBbpsAnalytics.onPendingBillsLoaded(
|
||||
source = source,
|
||||
|
||||
@@ -286,7 +286,7 @@ private fun PendingBillItem(
|
||||
fontFamily = ttComposeFontFamily,
|
||||
fontSize = 12.sp,
|
||||
maxLines = 1,
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_HEADLINE_REGULAR),
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_BODY_REGULAR),
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
lineHeight = 20.sp
|
||||
)
|
||||
|
||||
@@ -12,13 +12,14 @@ import androidx.activity.compose.BackHandler
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.ScrollState
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.imePadding
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.width
|
||||
@@ -62,6 +63,7 @@ import androidx.compose.ui.unit.sp
|
||||
import androidx.core.text.isDigitsOnly
|
||||
import androidx.hilt.navigation.compose.hiltViewModel
|
||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
import coil.compose.AsyncImagePainter.State.Empty.painter
|
||||
import com.navi.base.utils.EMPTY
|
||||
import com.navi.base.utils.orFalse
|
||||
import com.navi.bbps.R
|
||||
@@ -251,18 +253,21 @@ fun CustomerDataInputScreen(
|
||||
}
|
||||
},
|
||||
content = { innerPadding ->
|
||||
Column(
|
||||
Box(
|
||||
modifier =
|
||||
Modifier.padding(innerPadding)
|
||||
.fillMaxSize()
|
||||
.padding(horizontal = 16.dp)
|
||||
Modifier.fillMaxSize()
|
||||
.padding(innerPadding)
|
||||
.verticalScroll(state = scrollState)
|
||||
.imePadding()
|
||||
) {
|
||||
when (customerDataInputState) {
|
||||
is CustomerInputScreenState.Loading -> CustomerDataInputShimmer()
|
||||
is CustomerInputScreenState.Loaded -> {
|
||||
if (billCategoryEntity.categoryId == CATEGORY_ID_CREDIT_CARD) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Column(
|
||||
modifier =
|
||||
Modifier.padding(innerPadding).fillMaxSize().padding(horizontal = 16.dp)
|
||||
) {
|
||||
when (customerDataInputState) {
|
||||
is CustomerInputScreenState.Loading -> CustomerDataInputShimmer()
|
||||
is CustomerInputScreenState.Loaded -> {
|
||||
if (billCategoryEntity.categoryId == CATEGORY_ID_CREDIT_CARD) {
|
||||
NaviText(
|
||||
text = billCategoryEntity.title,
|
||||
fontSize = 24.sp,
|
||||
@@ -274,45 +279,46 @@ fun CustomerDataInputScreen(
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
textAlign = TextAlign.Center
|
||||
)
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
Image(
|
||||
painter =
|
||||
painterResource(
|
||||
id =
|
||||
com.navi.common.R.drawable
|
||||
.ic_bharat_billpay_vertical_logo
|
||||
),
|
||||
contentDescription = "",
|
||||
modifier =
|
||||
Modifier.size(24.dp).align(Alignment.CenterVertically)
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
|
||||
RenderBillerDetailStrip(billerItemEntity = billerItemEntity)
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
val customerParams =
|
||||
(customerDataInputState as CustomerInputScreenState.Loaded)
|
||||
.customerParams
|
||||
RenderCustomInputFields(
|
||||
focusRequester = focusRequester,
|
||||
customParamsMap = customParamsMap,
|
||||
isEditingEnabled = !isBillDetailsLoading,
|
||||
customerParams = customerParams,
|
||||
onInputFieldValueChanged = onInputFieldValueChanged,
|
||||
onClearTextClicked = onClearTextClicked,
|
||||
onDropDownClicked = onDropDownClicked,
|
||||
onInfoIconClicked = { customerParam ->
|
||||
onInfoIconClicked(customerParam)
|
||||
keyboardController.customHide(context, view)
|
||||
}
|
||||
)
|
||||
|
||||
RenderBillerDetailStrip(billerItemEntity = billerItemEntity)
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
Spacer(modifier = Modifier.height(48.dp))
|
||||
|
||||
LaunchedEffect(Unit) { showKeyboard = true }
|
||||
}
|
||||
|
||||
val customerParams =
|
||||
(customerDataInputState as CustomerInputScreenState.Loaded)
|
||||
.customerParams
|
||||
RenderCustomInputFields(
|
||||
focusRequester = focusRequester,
|
||||
customParamsMap = customParamsMap,
|
||||
isEditingEnabled = !isBillDetailsLoading,
|
||||
customerParams = customerParams,
|
||||
onInputFieldValueChanged = onInputFieldValueChanged,
|
||||
onClearTextClicked = onClearTextClicked,
|
||||
onDropDownClicked = onDropDownClicked,
|
||||
onInfoIconClicked = { customerParam ->
|
||||
onInfoIconClicked(customerParam)
|
||||
keyboardController.customHide(context, view)
|
||||
}
|
||||
)
|
||||
LaunchedEffect(Unit) { showKeyboard = true }
|
||||
is CustomerInputScreenState.Error -> Unit
|
||||
}
|
||||
is CustomerInputScreenState.Error -> Unit
|
||||
}
|
||||
Image(
|
||||
modifier =
|
||||
Modifier.width(58.dp)
|
||||
.height(32.dp)
|
||||
.padding(bottom = 10.dp)
|
||||
.align(Alignment.BottomCenter),
|
||||
painter = painterResource(id = R.drawable.bbps_logo_with_text),
|
||||
contentDescription = ""
|
||||
)
|
||||
}
|
||||
},
|
||||
bottomBar = {
|
||||
@@ -326,23 +332,8 @@ fun CustomerDataInputScreen(
|
||||
Spacer(Modifier.height(16.dp))
|
||||
CoinUtilisationBottomNudge()
|
||||
}
|
||||
} else if (billCategoryEntity.categoryId != CATEGORY_ID_CREDIT_CARD) {
|
||||
Column(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
|
||||
Image(
|
||||
modifier =
|
||||
Modifier.width(58.dp)
|
||||
.height(32.dp)
|
||||
.align(Alignment.CenterHorizontally),
|
||||
painter = painterResource(id = R.drawable.bbps_logo_with_text),
|
||||
contentDescription = ""
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
|
||||
LoaderRoundedButton(
|
||||
@@ -395,11 +386,6 @@ fun RenderBillerDetailStrip(billerItemEntity: BillerItemEntity) {
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
modifier =
|
||||
Modifier.fillMaxWidth()
|
||||
.border(
|
||||
width = 1.dp,
|
||||
color = NaviBbpsColor.borderDefault,
|
||||
shape = RoundedCornerShape(size = 4.dp)
|
||||
)
|
||||
.background(color = NaviBbpsColor.bgAlt, shape = RoundedCornerShape(8.dp))
|
||||
.padding(16.dp)
|
||||
) {
|
||||
@@ -422,7 +408,7 @@ fun RenderBillerDetailStrip(billerItemEntity: BillerItemEntity) {
|
||||
)
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
Spacer(modifier = Modifier.height(24.dp))
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
@@ -33,7 +33,6 @@ import androidx.compose.material.Scaffold
|
||||
import androidx.compose.material.rememberModalBottomSheetState
|
||||
import androidx.compose.material3.HorizontalDivider
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.DisposableEffect
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.derivedStateOf
|
||||
import androidx.compose.runtime.getValue
|
||||
@@ -54,7 +53,6 @@ import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.hilt.navigation.compose.hiltViewModel
|
||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
import com.google.accompanist.systemuicontroller.rememberSystemUiController
|
||||
import com.navi.base.utils.EMPTY
|
||||
import com.navi.base.utils.ZERO_STRING
|
||||
import com.navi.base.utils.isNotNullAndNotEmpty
|
||||
@@ -73,6 +71,7 @@ import com.navi.bbps.common.ui.BbpsCircleImage
|
||||
import com.navi.bbps.common.ui.KeyValueTextSection
|
||||
import com.navi.bbps.common.ui.NaviBbpsHeader
|
||||
import com.navi.bbps.common.ui.NaviBbpsModalBottomSheetLayout
|
||||
import com.navi.bbps.common.ui.SetStatusBarColor
|
||||
import com.navi.bbps.common.utils.clearBackStackUpToAndNavigate
|
||||
import com.navi.bbps.common.utils.getDisplayableAmount
|
||||
import com.navi.bbps.customHide
|
||||
@@ -268,17 +267,19 @@ fun PayBillScreen(
|
||||
val isNudgeLitmusExperimentEnabled by
|
||||
payBillViewModel.isNudgeLitmusExperimentEnabled.collectAsStateWithLifecycle()
|
||||
|
||||
val systemUiController = rememberSystemUiController()
|
||||
|
||||
val bottomSheetState =
|
||||
rememberModalBottomSheetState(
|
||||
initialValue = ModalBottomSheetValue.Hidden,
|
||||
confirmValueChange = { true }
|
||||
)
|
||||
|
||||
DisposableEffect(Unit) {
|
||||
systemUiController.setStatusBarColor(color = NaviBbpsColor.bgAlt)
|
||||
onDispose { systemUiController.setStatusBarColor(color = NaviBbpsColor.textWhite) }
|
||||
if (billCategoryEntity.categoryId != CATEGORY_ID_CREDIT_CARD) {
|
||||
SetStatusBarColor(activity = naviBbpsActivity, colorResId = R.color.bbps_bgAlt)
|
||||
} else {
|
||||
SetStatusBarColor(
|
||||
activity = naviBbpsActivity,
|
||||
colorResId = R.color.bbps_status_bar_default_color
|
||||
)
|
||||
}
|
||||
|
||||
val onBackClicked = {
|
||||
|
||||
@@ -55,7 +55,6 @@ import com.navi.bbps.clickableDebounce
|
||||
import com.navi.bbps.common.BULLET
|
||||
import com.navi.bbps.common.COLON_WITH_SPACE
|
||||
import com.navi.bbps.common.DASH
|
||||
import com.navi.bbps.common.DATE_TIME_FORMAT_DATE_MONTH_NAME_YEAR
|
||||
import com.navi.bbps.common.MAX_AMOUNT_LENGTH
|
||||
import com.navi.bbps.common.ONE_DAY_IN_MILLIS
|
||||
import com.navi.bbps.common.theme.NaviBbpsColor
|
||||
@@ -70,6 +69,7 @@ import com.navi.bbps.feature.paybill.model.view.CreditCardAmountType
|
||||
import com.navi.bbps.feature.paybill.model.view.CreditCardPaymentOption
|
||||
import com.navi.bbps.feature.paybill.model.view.PayBillScreenState
|
||||
import com.navi.bbps.feature.paybill.model.view.PayBillSource
|
||||
import com.navi.bbps.getSimpleDateFormat
|
||||
import com.navi.common.R as CommonR
|
||||
import com.navi.common.utils.CommonUtils.formattedCurrency
|
||||
import com.navi.common.utils.Constants.COMMA_CHAR
|
||||
@@ -78,8 +78,6 @@ import com.navi.design.theme.getFontWeight
|
||||
import com.navi.design.theme.ttComposeFontFamily
|
||||
import com.navi.naviwidgets.extensions.NaviText
|
||||
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
import kotlinx.coroutines.flow.filter
|
||||
|
||||
@Composable
|
||||
@@ -212,7 +210,7 @@ fun DueDateText(
|
||||
fontSize = 12.sp,
|
||||
fontFamily = ttComposeFontFamily,
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_BODY_REGULAR),
|
||||
color = NaviBbpsColor.textPrimary
|
||||
color = NaviBbpsColor.textTertiary
|
||||
)
|
||||
) {
|
||||
append(stringResource(id = R.string.bbps_due_date))
|
||||
@@ -224,7 +222,7 @@ fun DueDateText(
|
||||
SpanStyle(
|
||||
fontSize = 12.sp,
|
||||
fontFamily = ttComposeFontFamily,
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_BODY_DEMI_BOLD),
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_HEADLINE_REGULAR),
|
||||
color =
|
||||
if (isOverdue) NaviBbpsColor.onSurfaceCritical
|
||||
else NaviBbpsColor.textPrimary
|
||||
@@ -247,7 +245,8 @@ fun DueDateText(
|
||||
}
|
||||
|
||||
fun convertDueDateToMillis(dueDate: String): Long {
|
||||
val sdf = SimpleDateFormat(DATE_TIME_FORMAT_DATE_MONTH_NAME_YEAR, Locale.ENGLISH)
|
||||
val sdf = getSimpleDateFormat()
|
||||
|
||||
return try {
|
||||
val date = sdf.parse(dueDate)
|
||||
date?.time ?: System.currentTimeMillis()
|
||||
@@ -518,11 +517,6 @@ fun CardDetailsSection(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
modifier =
|
||||
Modifier.fillMaxWidth()
|
||||
.border(
|
||||
width = 1.dp,
|
||||
color = NaviBbpsColor.borderDefault,
|
||||
shape = RoundedCornerShape(size = 4.dp)
|
||||
)
|
||||
.background(color = NaviBbpsColor.bgAlt, shape = RoundedCornerShape(8.dp))
|
||||
.padding(16.dp)
|
||||
) {
|
||||
@@ -563,7 +557,7 @@ fun CardDetailsSection(
|
||||
if (getLastFourDigitsOfCreditCard(payBillScreenSource.customerParams) != null) {
|
||||
NaviText(
|
||||
text =
|
||||
"$DASH ${getLastFourDigitsOfCreditCard(payBillScreenSource.customerParams)}",
|
||||
" $DASH ${getLastFourDigitsOfCreditCard(payBillScreenSource.customerParams)}",
|
||||
fontSize = 14.sp,
|
||||
fontFamily = ttComposeFontFamily,
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_BODY_REGULAR),
|
||||
|
||||
@@ -12,4 +12,5 @@
|
||||
<color name="navi_pay_charcol_gray">#444444</color>
|
||||
<color name="bbps_dark_gray">#A8A8A8</color>
|
||||
<color name="bbps_brand_supporting_light_green">#FFE4FFED</color>
|
||||
<color name="bbps_bgAlt">#FFFAFAFA</color>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user