NTP-24902 | Divyesh | arc testing fixes (#14680)
This commit is contained in:
@@ -20,11 +20,17 @@ import androidx.compose.foundation.layout.offset
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.text.InlineTextContent
|
||||
import androidx.compose.foundation.text.appendInlineContent
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.Placeholder
|
||||
import androidx.compose.ui.text.PlaceholderVerticalAlign
|
||||
import androidx.compose.ui.text.buildAnnotatedString
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.navi.common.R as CommonR
|
||||
@@ -135,36 +141,37 @@ private fun ArcCampaignInfoSection(
|
||||
) {
|
||||
|
||||
Row(
|
||||
modifier = modifier.fillMaxWidth().padding(horizontal = 48.dp),
|
||||
modifier = modifier.fillMaxWidth().padding(horizontal = 40.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.Center,
|
||||
) {
|
||||
NaviText(
|
||||
text = arcInfoBottomSheetCampaignTitle,
|
||||
fontSize = 12.sp,
|
||||
fontFamily = naviFontFamily,
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_BODY_REGULAR),
|
||||
color = NaviPayColor.textTertiary,
|
||||
lineHeight = 16.sp,
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.width(4.dp))
|
||||
|
||||
Image(
|
||||
painter = painterResource(CommonR.drawable.ic_np_coin),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(16.dp),
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.width(4.dp))
|
||||
val annotatedString = buildAnnotatedString {
|
||||
append("$arcInfoBottomSheetCampaignTitle ")
|
||||
appendInlineContent(id = "imageId")
|
||||
append(" $maxCoins.")
|
||||
}
|
||||
val inlineContentMap =
|
||||
mapOf(
|
||||
"imageId" to
|
||||
InlineTextContent(
|
||||
Placeholder(16.sp, 16.sp, PlaceholderVerticalAlign.TextCenter)
|
||||
) {
|
||||
Image(
|
||||
painter = painterResource(CommonR.drawable.ic_np_coin),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(16.dp),
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
NaviText(
|
||||
text = "$maxCoins.",
|
||||
text = annotatedString,
|
||||
textAlign = TextAlign.Center,
|
||||
fontSize = 12.sp,
|
||||
lineHeight = 16.sp,
|
||||
fontFamily = naviFontFamily,
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_BODY_REGULAR),
|
||||
color = NaviPayColor.textTertiary,
|
||||
lineHeight = 16.sp,
|
||||
inlineContent = inlineContentMap,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,19 +283,16 @@ private fun ArcStatusDescriptionCard(
|
||||
},
|
||||
arcStatusWidgetProperties = arcStatusWidgetProperties,
|
||||
)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
Image(
|
||||
painter = painterResource(id = arcStatusWidgetProperties.icon),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(48.dp),
|
||||
)
|
||||
|
||||
Image(
|
||||
painter = painterResource(id = arcStatusWidgetProperties.icon),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(48.dp),
|
||||
)
|
||||
Spacer(modifier = Modifier.width(12.dp))
|
||||
|
||||
Spacer(modifier = Modifier.width(12.dp))
|
||||
|
||||
Column {
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Column {
|
||||
NaviText(
|
||||
text = arcStatusWidgetProperties.mainText,
|
||||
color = NaviPayColor.textPrimary,
|
||||
@@ -304,66 +301,69 @@ private fun ArcStatusDescriptionCard(
|
||||
fontFamily = naviFontFamily,
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_HEADLINE_REGULAR),
|
||||
)
|
||||
}
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
NaviText(
|
||||
text = arcStatusWidgetProperties.subText,
|
||||
color = NaviPayColor.textTertiary,
|
||||
fontSize = 12.sp,
|
||||
lineHeight = 18.sp,
|
||||
fontFamily = naviFontFamily,
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_BODY_REGULAR),
|
||||
)
|
||||
if (orderEntity?.orderStatusOfView == OrderStatusOfView.Pending) {
|
||||
when (arcCoinsPromiseValueStateType) {
|
||||
ArcCoinsPromiseValueStateType.NudgeValue -> {
|
||||
Spacer(modifier = Modifier.width(4.dp))
|
||||
NaviText(
|
||||
text = stringResource(id = R.string.np_up_to),
|
||||
fontFamily = naviFontFamily,
|
||||
fontSize = 12.sp,
|
||||
lineHeight = 16.sp,
|
||||
color = NaviPayColor.textTertiary,
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_BODY_REGULAR),
|
||||
)
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
|
||||
Spacer(modifier = Modifier.width(4.dp))
|
||||
|
||||
Image(
|
||||
painter = painterResource(id = CommonR.drawable.ic_np_coin),
|
||||
modifier = Modifier.size(16.dp),
|
||||
contentDescription = null,
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
NaviText(
|
||||
text = arcStatusWidgetProperties.subText,
|
||||
color = NaviPayColor.textTertiary,
|
||||
fontSize = 12.sp,
|
||||
lineHeight = 18.sp,
|
||||
fontFamily = naviFontFamily,
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_BODY_REGULAR),
|
||||
)
|
||||
if (orderEntity?.orderStatusOfView == OrderStatusOfView.Pending) {
|
||||
when (arcCoinsPromiseValueStateType) {
|
||||
ArcCoinsPromiseValueStateType.NudgeValue -> {
|
||||
Spacer(modifier = Modifier.width(4.dp))
|
||||
NaviText(
|
||||
text = stringResource(id = R.string.np_up_to),
|
||||
fontFamily = naviFontFamily,
|
||||
fontSize = 12.sp,
|
||||
lineHeight = 16.sp,
|
||||
color = NaviPayColor.textTertiary,
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_BODY_REGULAR),
|
||||
)
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.width(4.dp))
|
||||
|
||||
when (arcCoinsPromiseValueStateType) {
|
||||
ArcCoinsPromiseValueStateType.Loading -> {
|
||||
Box(modifier = Modifier.width(70.dp).height(16.dp).shimmerEffect())
|
||||
else -> {}
|
||||
}
|
||||
else -> {
|
||||
NaviText(
|
||||
text = "${arcRewardCoins}. ",
|
||||
fontSize = 12.sp,
|
||||
lineHeight = 16.sp,
|
||||
fontFamily = naviFontFamily,
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_BODY_REGULAR),
|
||||
color = NaviPayColor.textTertiary,
|
||||
)
|
||||
NaviText(
|
||||
text = stringResource(id = R.string.know_more_navi_pay),
|
||||
fontSize = 12.sp,
|
||||
lineHeight = 16.sp,
|
||||
fontFamily = naviFontFamily,
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_BODY_REGULAR),
|
||||
color = NaviPayColor.textTertiary,
|
||||
textDecoration = TextDecoration.Underline,
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.width(4.dp))
|
||||
|
||||
Image(
|
||||
painter = painterResource(id = CommonR.drawable.ic_np_coin),
|
||||
modifier = Modifier.size(16.dp),
|
||||
contentDescription = null,
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.width(4.dp))
|
||||
|
||||
when (arcCoinsPromiseValueStateType) {
|
||||
ArcCoinsPromiseValueStateType.Loading -> {
|
||||
Box(modifier = Modifier.width(70.dp).height(16.dp).shimmerEffect())
|
||||
}
|
||||
|
||||
else -> {
|
||||
NaviText(
|
||||
text = "${arcRewardCoins}. ",
|
||||
fontSize = 12.sp,
|
||||
lineHeight = 16.sp,
|
||||
fontFamily = naviFontFamily,
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_BODY_REGULAR),
|
||||
color = NaviPayColor.textTertiary,
|
||||
)
|
||||
NaviText(
|
||||
text = stringResource(id = R.string.know_more_navi_pay),
|
||||
fontSize = 12.sp,
|
||||
lineHeight = 16.sp,
|
||||
fontFamily = naviFontFamily,
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_BODY_REGULAR),
|
||||
color = NaviPayColor.textTertiary,
|
||||
textDecoration = TextDecoration.Underline,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -383,54 +383,62 @@ private fun ArcRewardDescriptionSection(
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
Image(
|
||||
painter = painterResource(id = arcStatusWidgetProperties.icon),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(48.dp),
|
||||
)
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Image(
|
||||
painter = painterResource(id = arcStatusWidgetProperties.icon),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(48.dp),
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.width(12.dp))
|
||||
Spacer(modifier = Modifier.width(12.dp))
|
||||
|
||||
Column {
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
NaviText(
|
||||
text = arcStatusWidgetProperties.mainText,
|
||||
color = NaviPayColor.textPrimary,
|
||||
lineHeight = 16.sp,
|
||||
fontSize = 12.sp,
|
||||
fontFamily = naviFontFamily,
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_HEADLINE_REGULAR),
|
||||
)
|
||||
Column {
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
NaviText(
|
||||
text = arcStatusWidgetProperties.mainText,
|
||||
color = NaviPayColor.textPrimary,
|
||||
lineHeight = 16.sp,
|
||||
fontSize = 12.sp,
|
||||
fontFamily = naviFontFamily,
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_HEADLINE_REGULAR),
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.width(4.dp))
|
||||
Image(
|
||||
painter = painterResource(id = CommonR.drawable.ic_np_coin),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(16.dp),
|
||||
)
|
||||
Spacer(modifier = Modifier.width(4.dp))
|
||||
Spacer(modifier = Modifier.width(4.dp))
|
||||
Image(
|
||||
painter = painterResource(id = CommonR.drawable.ic_np_coin),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(16.dp),
|
||||
)
|
||||
Spacer(modifier = Modifier.width(4.dp))
|
||||
|
||||
NaviText(
|
||||
text = arcRewardCoins,
|
||||
color = NaviPayColor.textPrimary,
|
||||
fontSize = 12.sp,
|
||||
lineHeight = 16.sp,
|
||||
fontFamily = naviFontFamily,
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_HEADLINE_REGULAR),
|
||||
)
|
||||
}
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
NaviText(
|
||||
text = arcRewardCoins,
|
||||
color = NaviPayColor.textPrimary,
|
||||
fontSize = 12.sp,
|
||||
lineHeight = 16.sp,
|
||||
fontFamily = naviFontFamily,
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_HEADLINE_REGULAR),
|
||||
)
|
||||
}
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
NaviText(
|
||||
text = arcStatusWidgetProperties.subText,
|
||||
color = NaviPayColor.textTertiary,
|
||||
fontSize = 12.sp,
|
||||
lineHeight = 18.sp,
|
||||
fontFamily = naviFontFamily,
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_BODY_REGULAR),
|
||||
)
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
NaviText(
|
||||
text = arcStatusWidgetProperties.subText,
|
||||
color = NaviPayColor.textTertiary,
|
||||
fontSize = 12.sp,
|
||||
lineHeight = 18.sp,
|
||||
fontFamily = naviFontFamily,
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_BODY_REGULAR),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Image(
|
||||
painter = painterResource(id = com.navi.naviwidgets.R.drawable.ic_chevron_black_right),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(24.dp),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1045,6 +1045,7 @@ constructor(
|
||||
_arcCoinsPromiseValueStateType.update {
|
||||
ArcCoinsPromiseValueStateType.ExactValue
|
||||
}
|
||||
_showArcBottomSheetOnWidgetClick.update { true }
|
||||
return
|
||||
}
|
||||
showArcRewardFromNudgeResponse()
|
||||
@@ -1177,6 +1178,7 @@ constructor(
|
||||
naviPayAnalytics.onLiteSyncCalled()
|
||||
liteAccountSyncUseCase.execute(screenName = screenName)
|
||||
}
|
||||
prepareArcStatusWidgetProperties()
|
||||
}
|
||||
|
||||
prepareRefundStatusWidgetProperties()
|
||||
|
||||
@@ -181,7 +181,7 @@ fun OrderItem.toOrderEntity(
|
||||
coinEquivalentCash = orderDetails?.coinEquivalentCash.orEmpty(),
|
||||
orderTerminalTimestamp = orderTerminalTimestamp,
|
||||
isArcDelayed = isArcDelayed.orFalse(),
|
||||
rewardDetails = orderDetails?.rewardDetails.toJson(),
|
||||
rewardDetails = orderDetails?.rewardDetails?.let { gson.toJson(it) },
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user