NTP-38637 | Venkat Praneeth Reddy | Scratch card revamp (#15123)
This commit is contained in:
committed by
GitHub
parent
4bace4a3bb
commit
6cdb3cca80
@@ -47,9 +47,9 @@ interface RetrofitService {
|
||||
@Query("pageSize") pageSize: String,
|
||||
): Response<GenericResponse<TransactionHistoryResponse>>
|
||||
|
||||
@GET("/forge/screen/{screenId}")
|
||||
@GET("/alchemist/inflate/v2/{screenId}")
|
||||
@RetryPolicy
|
||||
suspend fun fetchScreenUiTronConfigs(
|
||||
suspend fun fetchAlchemistScreenUiTronConfigsV2(
|
||||
@Header("Accept-Encoding") acceptEncoding: String,
|
||||
@Header("X-Target") target: String,
|
||||
@Header("vpa") vpa: String? = null,
|
||||
|
||||
@@ -41,9 +41,9 @@ constructor(
|
||||
responseHandler.handleResponse(
|
||||
metricInfo = metricInfo,
|
||||
response =
|
||||
retrofitService.fetchScreenUiTronConfigs(
|
||||
retrofitService.fetchAlchemistScreenUiTronConfigsV2(
|
||||
acceptEncoding = GZIP,
|
||||
target = ModuleNameV2.FORGE.name,
|
||||
target = ModuleNameV2.ALCHEMIST.name,
|
||||
screenId = TRANSACTION_HISTORY_COINS_SCREEN_NAME,
|
||||
),
|
||||
)
|
||||
|
||||
@@ -65,9 +65,9 @@ constructor(
|
||||
responseHandler.handleResponse(
|
||||
metricInfo = metricInfo,
|
||||
response =
|
||||
retrofitService.fetchScreenUiTronConfigs(
|
||||
retrofitService.fetchAlchemistScreenUiTronConfigsV2(
|
||||
acceptEncoding = GZIP,
|
||||
target = ModuleNameV2.FORGE.name,
|
||||
target = ModuleNameV2.ALCHEMIST.name,
|
||||
screenId = COINS_SCREEN_SCREEN_NAME,
|
||||
vpa = vpa,
|
||||
),
|
||||
@@ -138,9 +138,9 @@ constructor(
|
||||
responseHandler.handleResponse(
|
||||
metricInfo = metricInfo,
|
||||
response =
|
||||
retrofitService.fetchScreenUiTronConfigs(
|
||||
retrofitService.fetchAlchemistScreenUiTronConfigsV2(
|
||||
acceptEncoding = GZIP,
|
||||
target = ModuleNameV2.FORGE.name,
|
||||
target = ModuleNameV2.ALCHEMIST.name,
|
||||
screenId = COINS_LOADING_SCREEN_SCREEN_NAME,
|
||||
),
|
||||
)
|
||||
|
||||
@@ -41,9 +41,9 @@ constructor(
|
||||
responseHandler.handleResponse(
|
||||
metricInfo = metricInfo,
|
||||
response =
|
||||
retrofitService.fetchScreenUiTronConfigs(
|
||||
retrofitService.fetchAlchemistScreenUiTronConfigsV2(
|
||||
acceptEncoding = GZIP,
|
||||
target = ModuleNameV2.FORGE.name,
|
||||
target = ModuleNameV2.ALCHEMIST.name,
|
||||
screenId = REWARDS_SCRATCH_CARD_SUMMARY_SCREEN_NAME,
|
||||
),
|
||||
)
|
||||
|
||||
@@ -15,8 +15,12 @@ val onSurfaceHighlight = Color(0xFF22A940)
|
||||
val brandSupportingMidGreen = Color(0xFFAFECCD).copy(alpha = 0.7f)
|
||||
val textPrimary = Color(0xFF191919)
|
||||
val borderAlt = Color(0xFFE3E5E5)
|
||||
val textGray = Color(0xFF444444)
|
||||
val textTertiary = Color(0xFF6B6B6B)
|
||||
val Color_824992 = Color(0xFF824992)
|
||||
val Color_601978 = Color(0xFF601978)
|
||||
val Color_F9F9F9 = Color(0xFFF9F9F9)
|
||||
val ctaTertiary = Color(0xFF1F002A)
|
||||
val Color_F3F1F3 = Color(0xFFF3F1F3)
|
||||
val Color_757375 = Color(0xFF757375)
|
||||
val topBarGradientStartColor = Color(0xFF451156)
|
||||
val topBarGradientEndColor = Color(0xFF340D41)
|
||||
|
||||
@@ -36,6 +36,7 @@ import androidx.compose.foundation.lazy.grid.LazyGridScope
|
||||
import androidx.compose.foundation.lazy.grid.LazyGridState
|
||||
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material.Divider
|
||||
import androidx.compose.material.Icon
|
||||
import androidx.compose.material.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
@@ -72,13 +73,16 @@ import com.navi.coin.R
|
||||
import com.navi.coin.models.model.ScratchCard
|
||||
import com.navi.coin.models.states.ScratchCardPaginatedHistoryScreenState
|
||||
import com.navi.coin.models.states.ScratchCardStatus
|
||||
import com.navi.coin.theme.Color_757375
|
||||
import com.navi.coin.theme.Color_824992
|
||||
import com.navi.coin.theme.Color_F3F1F3
|
||||
import com.navi.coin.theme.Color_F9F9F9
|
||||
import com.navi.coin.theme.borderAlt
|
||||
import com.navi.coin.theme.brandSupportingMidGreen
|
||||
import com.navi.coin.theme.ctaTertiary
|
||||
import com.navi.coin.theme.midGoldColor
|
||||
import com.navi.coin.theme.onSurfaceHighlight
|
||||
import com.navi.coin.theme.textGray
|
||||
import com.navi.coin.theme.textOrange
|
||||
import com.navi.coin.theme.textPrimary
|
||||
import com.navi.coin.theme.textTertiary
|
||||
@@ -92,6 +96,7 @@ import com.navi.coin.utils.constant.Constants.SCRATCH_CARD_EXPIRED_BOTTOM_SHEET
|
||||
import com.navi.coin.utils.constant.Constants.SCRATCH_CARD_IN_PROGRESS_BOTTOM_SHEET
|
||||
import com.navi.coin.utils.constant.Constants.SCRATCH_CARD_RECEIVED_BOTTOM_SHEET
|
||||
import com.navi.coin.utils.constant.Constants.ScratchCardHistoryScreen.VIEW_MORE_SCROLL_DOWN_IN_DP
|
||||
import com.navi.coin.utils.constant.ImageConstants.NO_SCRATCH_CARD_URL
|
||||
import com.navi.coin.utils.ext.scaledSp
|
||||
import com.navi.coin.utils.formatDuration
|
||||
import com.navi.coin.vm.ScratchCardScreenVM
|
||||
@@ -136,7 +141,6 @@ fun ScratchCardListRenderer(
|
||||
val analyticsHandler by remember { mutableStateOf(viewModel.analyticsHandler.Rewards()) }
|
||||
val paginatedHistoryScreenState =
|
||||
viewModel.scratchCardPager.scratchCardHistoryListData.collectAsStateWithLifecycle()
|
||||
|
||||
var hasMoreItemsToLoad by remember { mutableStateOf(true) }
|
||||
var isLoading by remember { mutableStateOf(false) }
|
||||
val localDensity = LocalDensity.current
|
||||
@@ -186,35 +190,45 @@ fun ScratchCardListRenderer(
|
||||
}
|
||||
item(span = { GridItemSpan(2) }) {
|
||||
Column {
|
||||
Spacer(modifier = Modifier.height(30.dp))
|
||||
Image(
|
||||
painter = painterResource(id = WidgetsR.drawable.curve),
|
||||
contentDescription = EMPTY,
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
contentScale = ContentScale.FillWidth,
|
||||
)
|
||||
Row(
|
||||
modifier =
|
||||
Modifier.background(Color_F9F9F9)
|
||||
.fillMaxSize()
|
||||
.padding(top = 24.dp),
|
||||
.padding(
|
||||
top = 24.dp,
|
||||
start = 16.dp,
|
||||
end = 16.dp,
|
||||
bottom = 8.dp,
|
||||
),
|
||||
horizontalArrangement = Arrangement.Center,
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
Divider(
|
||||
color = Color_F3F1F3,
|
||||
thickness = 1.dp,
|
||||
modifier = Modifier.weight(1f),
|
||||
)
|
||||
Text(
|
||||
text = Constants.SCRATCH_CARD_HISTORY,
|
||||
modifier = Modifier.padding(bottom = 8.dp),
|
||||
modifier = Modifier.padding(horizontal = 8.dp),
|
||||
style =
|
||||
TextStyle(
|
||||
fontSize = 14.scaledSp(),
|
||||
lineHeight = 22.scaledSp(),
|
||||
fontSize = 12.scaledSp(),
|
||||
lineHeight = 20.scaledSp(),
|
||||
fontFamily = naviFontFamily,
|
||||
fontWeight =
|
||||
getFontWeight(
|
||||
FontWeightEnum.NAVI_BODY_DEMI_BOLD
|
||||
),
|
||||
color = ctaTertiary,
|
||||
color = Color_757375,
|
||||
letterSpacing = 1.5.sp,
|
||||
),
|
||||
)
|
||||
Divider(
|
||||
color = Color_F3F1F3,
|
||||
thickness = 1.dp,
|
||||
modifier = Modifier.weight(1f),
|
||||
)
|
||||
}
|
||||
val notifyWidgetDataMap =
|
||||
jsonMetaData?.get("notifyWidgetData")?.toJsonObject()
|
||||
@@ -383,21 +397,40 @@ fun scratchCardList(
|
||||
if (paginatedHistoryScreenState is ScratchCardPaginatedHistoryScreenState.Empty) {
|
||||
lazyGridScope.item(span = { GridItemSpan(2) }) {
|
||||
Column(
|
||||
modifier = Modifier.fillMaxWidth().padding(top = 56.dp),
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
verticalArrangement = Arrangement.Center,
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
) {
|
||||
AsyncImage(
|
||||
model = NO_SCRATCH_CARD_URL,
|
||||
contentDescription = EMPTY,
|
||||
contentScale = ContentScale.FillBounds,
|
||||
modifier = Modifier.size(180.dp),
|
||||
)
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
Text(
|
||||
text =
|
||||
"You have not won any scratch cards,\npay via Navi UPI to start earning.",
|
||||
text = stringResource(R.string.no_scratch_card),
|
||||
style =
|
||||
TextStyle(
|
||||
fontSize = 16.scaledSp(),
|
||||
lineHeight = 24.scaledSp(),
|
||||
fontFamily = naviFontFamily,
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_BODY_REGULAR),
|
||||
color = textGray,
|
||||
textAlign = TextAlign.Center,
|
||||
),
|
||||
)
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
Text(
|
||||
text = stringResource(R.string.pay_via_upi),
|
||||
style =
|
||||
TextStyle(
|
||||
fontSize = 14.sp,
|
||||
lineHeight = 22.sp,
|
||||
fontFamily = naviFontFamily,
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_HEADLINE_REGULAR),
|
||||
color = Color.Black,
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_BODY_REGULAR),
|
||||
color = textTertiary,
|
||||
textAlign = TextAlign.Center,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -74,8 +74,8 @@ import com.navi.coin.R
|
||||
import com.navi.coin.models.model.ScratchCard
|
||||
import com.navi.coin.models.states.ScratchCardHistoryScreenState
|
||||
import com.navi.coin.models.states.ScratchCardStatus
|
||||
import com.navi.coin.theme.Color_601978
|
||||
import com.navi.coin.theme.Color_F9F9F9
|
||||
import com.navi.coin.theme.topBarGradientEndColor
|
||||
import com.navi.coin.theme.topBarGradientStartColor
|
||||
import com.navi.coin.ui.activity.CoinBaseActivity
|
||||
import com.navi.coin.ui.compose.common.Init
|
||||
import com.navi.coin.ui.compose.common.ScratchCardListRenderer
|
||||
@@ -95,11 +95,9 @@ import com.navi.common.permission.rememberMultiplePermissions
|
||||
import com.navi.common.uitron.model.action.CtaAction
|
||||
import com.navi.common.utils.CommonNaviAnalytics
|
||||
import com.navi.common.utils.EMPTY
|
||||
import com.navi.common.utils.getScreenHeight
|
||||
import com.navi.design.font.FontWeightEnum
|
||||
import com.navi.design.font.getFontWeight
|
||||
import com.navi.design.font.naviFontFamily
|
||||
import com.navi.design.utils.dpToPx
|
||||
import com.navi.rr.common.bottomsheet.InitBottomSheet
|
||||
import com.navi.rr.common.bottomsheet.RRBottomSheetStateHolder
|
||||
import com.navi.rr.common.constants.RNR_SCRATCH_CARD_HISTORY_SCREEN
|
||||
@@ -541,24 +539,7 @@ fun ScratchCardHistorySuccessScreen(
|
||||
pagerStates: PagerStateHolder<ScratchCard>,
|
||||
) {
|
||||
val systemUiController = rememberSystemUiController()
|
||||
val uiTronTopConfigHeightInPx = dpToPx(396)
|
||||
val gradientLevel by remember {
|
||||
mutableFloatStateOf(uiTronTopConfigHeightInPx / getScreenHeight().toFloat())
|
||||
}
|
||||
Scaffold(
|
||||
modifier =
|
||||
Modifier.fillMaxSize()
|
||||
.background(
|
||||
brush =
|
||||
Brush.verticalGradient(
|
||||
colorStops =
|
||||
arrayOf(
|
||||
(0f to Color_601978),
|
||||
(gradientLevel to Color.Black),
|
||||
(gradientLevel to Color_F9F9F9),
|
||||
)
|
||||
)
|
||||
),
|
||||
topBar = { ScratchCardHistoryScreenHeader(viewModel = viewModel, navigator = navigator) },
|
||||
content = {
|
||||
LaunchedEffect(Unit) {
|
||||
@@ -691,7 +672,19 @@ fun ScratchCardHistoryScreenHeader(
|
||||
val coroutineScope = rememberCoroutineScope()
|
||||
val context = LocalContext.current as Activity
|
||||
Box(
|
||||
modifier = Modifier.fillMaxWidth().padding(top = 24.dp),
|
||||
modifier =
|
||||
Modifier.fillMaxWidth()
|
||||
.background(
|
||||
brush =
|
||||
Brush.verticalGradient(
|
||||
colorStops =
|
||||
arrayOf(
|
||||
(0f to topBarGradientStartColor),
|
||||
(1f to topBarGradientEndColor),
|
||||
)
|
||||
)
|
||||
)
|
||||
.padding(top = 24.dp),
|
||||
contentAlignment = Alignment.CenterStart,
|
||||
) {
|
||||
Box(modifier = Modifier.padding(start = 16.dp, top = 20.dp, bottom = 20.dp, end = 40.dp)) {
|
||||
|
||||
@@ -16,7 +16,7 @@ object Constants {
|
||||
const val DESCRIPTION = "description"
|
||||
const val EXPIRY_DATE = "expiry_date"
|
||||
const val DATE = "date"
|
||||
const val SCRATCH_CARD_HISTORY = "–Scratch card history–"
|
||||
const val SCRATCH_CARD_HISTORY = "SCRATCH CARD HISTORY"
|
||||
const val IN_PROGRESS = "In Progress"
|
||||
const val EXPIRED = "Expired"
|
||||
const val SCRATCH_CARD_EXPIRED_BOTTOM_SHEET = "SCRATCH_CARD_EXPIRED_BOTTOM_SHEET"
|
||||
@@ -73,7 +73,7 @@ object Constants {
|
||||
const val COINS_SCREEN_SCREEN_NAME = "COINS_HOME_SCREEN"
|
||||
const val COINS_SCREEN_SCREEN_V2_NAME = "COINS_HOME_SCREEN_V2"
|
||||
const val TRANSACTION_HISTORY_COINS_SCREEN_NAME = "TRANSACTION_HISTORY_COIN_BALANCE_SCREEN"
|
||||
const val REWARDS_SCRATCH_CARD_SUMMARY_SCREEN_NAME = "REWARDS_SCRATCH_CARD_SUMMARY"
|
||||
const val REWARDS_SCRATCH_CARD_SUMMARY_SCREEN_NAME = "REWARDS_SCRATCH_CARD_SUMMARY_V2"
|
||||
const val COINS_LOADING_SCREEN_SCREEN_NAME = "COINS_HOME_LOADING_SCREEN_M2"
|
||||
const val REWARDS_SHARE_SCREEN_SCREEN_NAME = "REWARDS_SHARE_SCREEN"
|
||||
const val REFERRAL_SHARE_SCREEN_SCREEN_NAME = "REFERRAL_SHARE_SCREEN_SCREEN_NAME"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2024 by Navi Technologies Limited
|
||||
* * Copyright © 2024-2025 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
@@ -37,4 +37,6 @@ object ImageConstants {
|
||||
"https://public-assets.prod.navi-sa.in/referral_home_page/png/upi-referrals/smallWtspIcon.png"
|
||||
const val SHARE_IMAGE_URL =
|
||||
"https://public-assets.prod.navi-sa.in/referral_home_page/png/upi-referrals/referral_share_image.png"
|
||||
const val NO_SCRATCH_CARD_URL =
|
||||
"https://public-assets.prod.navi-sa.in/navi-coin/svg/scratch_card_history_empty_state.svg"
|
||||
}
|
||||
|
||||
@@ -50,4 +50,6 @@
|
||||
<string name="failed_start_gold">You earned a gold reward of </string>
|
||||
<string name="failed_middle_key">failedMiddle</string>
|
||||
<string name="failed_middle_default">by converting them to</string>
|
||||
<string name="no_scratch_card">"You have not won any scratch card"</string>
|
||||
<string name="pay_via_upi">"Pay via Navi UPI to start earning"</string>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user