NTP-11267 | Kamlesh | UAT fixes (#13746)
Co-authored-by: Kishan Kumar <kishan.kumar@navi.com>
This commit is contained in:
committed by
GitHub
parent
5a0a9ae945
commit
e7c0f609ab
@@ -10,7 +10,7 @@
|
||||
<activity
|
||||
android:name="com.navi.coin.ui.activity.CoinActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/BaseThemeStyle">
|
||||
</activity>
|
||||
|
||||
@@ -159,7 +159,7 @@ fun CoinHistoryScreen(
|
||||
if (bottomSheetState.isVisible) {
|
||||
viewModel.setBottomSheetState(false)
|
||||
} else {
|
||||
if (!navigator.navigateUp()) {
|
||||
if (!navigator.popBackStack()) {
|
||||
context.finish()
|
||||
}
|
||||
}
|
||||
@@ -434,7 +434,7 @@ fun CoinHistoryScreenHeader(navigator: DestinationsNavigator) {
|
||||
Image(
|
||||
modifier =
|
||||
Modifier.clickable(disableRipple = true) {
|
||||
if (!navigator.navigateUp()) {
|
||||
if (!navigator.popBackStack()) {
|
||||
context.finish()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,6 @@ import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.draw.shadow
|
||||
import androidx.compose.ui.graphics.Brush
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.asAndroidBitmap
|
||||
import androidx.compose.ui.graphics.graphicsLayer
|
||||
import androidx.compose.ui.layout.ContentScale
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
@@ -101,6 +100,7 @@ import com.navi.coin.utils.constant.ImageConstants.REFERRAL_BOTTOM_FLOOR
|
||||
import com.navi.coin.utils.constant.ImageConstants.REFERRAL_PODIUM_IMAGE
|
||||
import com.navi.coin.utils.constant.ImageConstants.SHAREABILITY_LEFT_POLYGON_URL
|
||||
import com.navi.coin.utils.constant.ImageConstants.SHAREABILITY_RIGHT_POLYGON_URL
|
||||
import com.navi.coin.utils.constant.ImageConstants.SHARE_IMAGE_URL
|
||||
import com.navi.coin.utils.constant.ImageConstants.SMALL_WHATSAPP_ICON
|
||||
import com.navi.coin.utils.navigateTo
|
||||
import com.navi.coin.vm.RewardsShareScreenVm
|
||||
@@ -108,6 +108,7 @@ import com.navi.common.navigation.NavArgs
|
||||
import com.navi.common.ui.compose.GratificationLottieAnimation
|
||||
import com.navi.common.uitron.model.action.CtaAction
|
||||
import com.navi.common.utils.Constants.DISPLAY_MESSAGE
|
||||
import com.navi.common.utils.Constants.IMAGE_URL
|
||||
import com.navi.common.utils.Constants.SHAREABLE_LINK
|
||||
import com.navi.design.font.FontWeightEnum
|
||||
import com.navi.design.theme.FF1F002A
|
||||
@@ -498,22 +499,17 @@ fun ReferralShareScreen(
|
||||
.clickable {
|
||||
val contact = it
|
||||
uiScope.launch {
|
||||
var newScreenshot =
|
||||
captureController
|
||||
.captureAsync()
|
||||
.await()
|
||||
it.number?.let {
|
||||
handleContactClick(
|
||||
contact
|
||||
?.isWhatsappContact
|
||||
?: false,
|
||||
contact = contact,
|
||||
bitmap =
|
||||
newScreenshot
|
||||
?.asAndroidBitmap(),
|
||||
bitmap = null,
|
||||
context,
|
||||
message = message,
|
||||
imageUrl = null,
|
||||
imageUrl =
|
||||
SHARE_IMAGE_URL,
|
||||
shareLink =
|
||||
userData
|
||||
?.naviLink
|
||||
@@ -581,10 +577,6 @@ fun ReferralShareScreen(
|
||||
.clickable {
|
||||
val contact = it
|
||||
uiScope.launch {
|
||||
var newScreenshot =
|
||||
captureController
|
||||
.captureAsync()
|
||||
.await()
|
||||
it.number?.let {
|
||||
handleContactClick(
|
||||
contact
|
||||
@@ -592,13 +584,12 @@ fun ReferralShareScreen(
|
||||
?: false,
|
||||
contact =
|
||||
contact,
|
||||
bitmap =
|
||||
newScreenshot
|
||||
?.asAndroidBitmap(),
|
||||
bitmap = null,
|
||||
context,
|
||||
message =
|
||||
message,
|
||||
imageUrl = null,
|
||||
imageUrl =
|
||||
SHARE_IMAGE_URL,
|
||||
shareLink =
|
||||
userData
|
||||
?.naviLink
|
||||
@@ -679,12 +670,13 @@ fun ReferralShareScreen(
|
||||
key = DISPLAY_MESSAGE,
|
||||
value = message
|
||||
),
|
||||
LineItem(
|
||||
key = IMAGE_URL,
|
||||
value = SHARE_IMAGE_URL
|
||||
)
|
||||
)
|
||||
uiScope.launch {
|
||||
var newScreenshot =
|
||||
captureController.captureAsync().await()
|
||||
viewmodel.rrShareApp.shareWhatsApp(
|
||||
bitmap = newScreenshot?.asAndroidBitmap(),
|
||||
parameters = listParameterItems,
|
||||
context = context,
|
||||
updateLoaderState =
|
||||
@@ -750,12 +742,13 @@ fun ReferralShareScreen(
|
||||
key = DISPLAY_MESSAGE,
|
||||
value = message
|
||||
),
|
||||
LineItem(
|
||||
key = IMAGE_URL,
|
||||
value = SHARE_IMAGE_URL
|
||||
)
|
||||
)
|
||||
uiScope.launch {
|
||||
var newScreenshot =
|
||||
captureController.captureAsync().await()
|
||||
viewmodel.rrShareApp.genericShare(
|
||||
bitmap = newScreenshot?.asAndroidBitmap(),
|
||||
parameters = listParameterItems,
|
||||
context = context,
|
||||
updateLoaderState =
|
||||
|
||||
@@ -101,6 +101,8 @@ object Constants {
|
||||
const val SHARE_WITH_FRIENDS = "Share with your friends"
|
||||
const val SHARE_AMAZING_NEWS =
|
||||
"Share this amazing news with your friends and help them earn too!"
|
||||
const val SHARE_AMAZING_REFERRAL_MESSAGE =
|
||||
"Share this amazing referral message with your friends and help them earn too!"
|
||||
const val SHARE_VIA_WHATSAPP = "Share via whatsapp"
|
||||
const val SHARE_AND_EARN = "Share & Earn"
|
||||
const val ON_EVERY_REFERRAL = "on every referral"
|
||||
|
||||
@@ -35,4 +35,6 @@ object ImageConstants {
|
||||
"https://public-assets.prod.navi-sa.in/referral_home_page/png/upi-referrals/coinWithBottomShadowMinified.png"
|
||||
const val SMALL_WHATSAPP_ICON =
|
||||
"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"
|
||||
}
|
||||
|
||||
@@ -35,11 +35,11 @@ object NaviRRColor {
|
||||
val purpleGradient = Color(0x99DDC8E4)
|
||||
val purpleDivider = Color(0xFF9E86A6)
|
||||
val lightGreyBackground = Color(0xFFE3E5E5)
|
||||
val progressBarGreen = Color(0xFF22D081)
|
||||
val progressBarGreen = Color(0xFF22A940)
|
||||
val progressBarBackground = Color(0xFFDBDBDB)
|
||||
val progressBarGray = Color(0xFFA8A8A8)
|
||||
val yellowBackground = Color(0xFFF7B500)
|
||||
val greenBoldText = Color(0xFF22D081)
|
||||
val greenBoldText = Color(0xFF22A940)
|
||||
val refereeTrackerDividerColor = Color(0xFFE2E2E2)
|
||||
val refereeTrackerSummaryPrimaryColor = Color(0xFF2A0038)
|
||||
}
|
||||
|
||||
@@ -75,7 +75,6 @@ import com.google.accompanist.permissions.rememberPermissionState
|
||||
import com.google.accompanist.systemuicontroller.rememberSystemUiController
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import com.navi.alfred.AlfredManager
|
||||
import com.navi.base.deeplink.DeepLinkManager
|
||||
import com.navi.base.model.CtaData
|
||||
import com.navi.base.sharedpref.PreferenceManager
|
||||
import com.navi.base.utils.EMPTY
|
||||
@@ -84,6 +83,8 @@ import com.navi.base.utils.isNull
|
||||
import com.navi.base.utils.orElse
|
||||
import com.navi.common.forge.model.ScreenStructure
|
||||
import com.navi.common.forge.model.WidgetModelDefinition
|
||||
import com.navi.common.navigation.NavArgs
|
||||
import com.navi.common.navigation.NavigationAction
|
||||
import com.navi.common.uitron.model.action.CtaAction
|
||||
import com.navi.common.utils.Constants
|
||||
import com.navi.common.utils.Constants.ALLOW_PERMISSIONS
|
||||
@@ -117,10 +118,13 @@ import com.navi.rr.utils.NaviRRAnalytics
|
||||
import com.navi.rr.utils.NaviRRAnalytics.Companion.MILESTONE_BOTTOMSHEET_VIEW
|
||||
import com.navi.rr.utils.NaviRRAnalytics.Companion.MILESTONE_IDENTIFIER
|
||||
import com.navi.rr.utils.composeutils.Init
|
||||
import com.navi.rr.utils.constants.Constants.BACK
|
||||
import com.navi.rr.utils.constants.Constants.CLOSE_SHEET
|
||||
import com.navi.rr.utils.constants.Constants.COINS_VALUE
|
||||
import com.navi.rr.utils.constants.Constants.DEFAULT_REWARD_AMOUNT
|
||||
import com.navi.rr.utils.constants.Constants.FALSE
|
||||
import com.navi.rr.utils.constants.Constants.GENERIC_SHARE
|
||||
import com.navi.rr.utils.constants.Constants.HIDE_FOOTER
|
||||
import com.navi.rr.utils.constants.Constants.INDEX
|
||||
import com.navi.rr.utils.constants.Constants.INDEX_TH
|
||||
import com.navi.rr.utils.constants.Constants.LAST_INDEX
|
||||
@@ -153,6 +157,7 @@ import com.navi.rr.utils.formatIndianNumericAbbreviation
|
||||
import com.navi.rr.utils.getGsonBuilders
|
||||
import com.navi.rr.utils.getNumberSuffix
|
||||
import com.navi.rr.utils.injectDataV2
|
||||
import com.navi.rr.utils.navigateTo
|
||||
import com.navi.rr.utils.openSettings
|
||||
import com.navi.uitron.model.UiTronResponse
|
||||
import com.ramcosta.composedestinations.annotation.Destination
|
||||
@@ -430,17 +435,38 @@ fun ReferralHomeScreen(
|
||||
CLOSE_SHEET -> {
|
||||
showSheet = false
|
||||
}
|
||||
else ->
|
||||
DeepLinkManager.getDeepLinkListener()
|
||||
?.navigateTo(
|
||||
context,
|
||||
CtaData(
|
||||
url = screenUrl,
|
||||
parameters = parameters,
|
||||
additionalParameters = action.ctaData?.additionalParameters
|
||||
),
|
||||
finish = false
|
||||
)
|
||||
BACK -> {
|
||||
navigateTo(
|
||||
activity = context,
|
||||
navHostOwner = context,
|
||||
navArgs =
|
||||
NavArgs(bundle = Bundle(), ctaData = CtaData(), finish = true),
|
||||
navAction = NavigationAction.Back
|
||||
)
|
||||
}
|
||||
else -> {
|
||||
var newbundle = Bundle()
|
||||
if (type?.equals(HIDE_FOOTER) == true) {
|
||||
newbundle.putString(HIDE_FOOTER, FALSE)
|
||||
}
|
||||
|
||||
navigateTo(
|
||||
activity = context,
|
||||
navHostOwner = context,
|
||||
navArgs =
|
||||
NavArgs(
|
||||
bundle = newbundle,
|
||||
ctaData =
|
||||
CtaData(
|
||||
url = screenUrl,
|
||||
parameters = action.ctaData?.parameters,
|
||||
additionalParameters =
|
||||
action.ctaData?.additionalParameters
|
||||
),
|
||||
finish = false
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -457,18 +483,10 @@ fun ReferralHomeScreen(
|
||||
}
|
||||
}
|
||||
|
||||
LaunchedEffect(Unit) {
|
||||
referralHomeVM.navigateToNextScreen.collect { navigator.navigate(direction = it) }
|
||||
}
|
||||
|
||||
LaunchedEffect(Unit) {
|
||||
NaviRRAnalytics.naviRRAnalytics.Referral().sendEvent(REFERRAL_HOME_SCREEN)
|
||||
}
|
||||
|
||||
LaunchedEffect(Unit) {
|
||||
referralHomeVM.navigateToPreviousScreen.collect { if (it) navigator.navigateUp() }
|
||||
}
|
||||
|
||||
LaunchedEffect(permissionRequested) {
|
||||
if (permissionRequested) {
|
||||
if (contactsPermissionState.status.isGranted) {
|
||||
@@ -871,7 +889,8 @@ fun BottomSheet(
|
||||
dragHandle = { BottomSheetDefaults.ContainerColor },
|
||||
shape = RoundedCornerShape(topStart = 8.dp, topEnd = 8.dp),
|
||||
contentWindowInsets = { WindowInsets(0, 0, 0, 0) },
|
||||
containerColor = Color.White
|
||||
containerColor = Color.White,
|
||||
scrimColor = Color.Black.copy(alpha = 0.9f)
|
||||
) {
|
||||
AlfredManager.setBottomSheetView(LocalView.current.rootView)
|
||||
Column(modifier = Modifier.navigationBarsPadding().imePadding()) {
|
||||
|
||||
@@ -28,7 +28,6 @@ import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.foundation.lazy.rememberLazyListState
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material.Scaffold
|
||||
import androidx.compose.material.Text
|
||||
@@ -50,8 +49,14 @@ import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.SpanStyle
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.buildAnnotatedString
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.BaselineShift
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.text.withStyle
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.hilt.navigation.compose.hiltViewModel
|
||||
@@ -64,6 +69,7 @@ import com.navi.base.deeplink.DeepLinkManager
|
||||
import com.navi.base.model.CtaData
|
||||
import com.navi.base.utils.isNotNull
|
||||
import com.navi.base.utils.isNotNullAndNotEmpty
|
||||
import com.navi.base.utils.isNull
|
||||
import com.navi.common.forge.model.ScreenDefinition
|
||||
import com.navi.common.forge.model.ScreenStructure
|
||||
import com.navi.common.forge.model.WidgetModelDefinition
|
||||
@@ -102,6 +108,7 @@ import com.navi.rr.utils.NaviRRAnalytics.Companion.REFERRAL_REMIND_CTA_CLICK
|
||||
import com.navi.rr.utils.composeutils.Init
|
||||
import com.navi.rr.utils.constants.Constants.CLOSE_SHEET
|
||||
import com.navi.rr.utils.constants.Constants.GENERIC_SHARE
|
||||
import com.navi.rr.utils.constants.Constants.HIDE_FOOTER
|
||||
import com.navi.rr.utils.constants.Constants.REMIND
|
||||
import com.navi.rr.utils.constants.RefereeTrackerConstants.NAME
|
||||
import com.navi.rr.utils.constants.RefereeTrackerConstants.NAVI_COIN
|
||||
@@ -136,6 +143,8 @@ fun RefereeTrackerScreenV2(
|
||||
val naviRRAnalytics: NaviRRAnalytics.RefereeTracker = remember {
|
||||
NaviRRAnalytics.naviRRAnalytics.RefereeTracker()
|
||||
}
|
||||
val showFooter by remember { mutableStateOf(bundle?.getString(HIDE_FOOTER)) }
|
||||
val itemUpdates by viewModel.itemUpdates.collectAsStateWithLifecycle()
|
||||
|
||||
Init(
|
||||
screenName = FORGE_REFEREE_TRACKER_SCREEN_V3,
|
||||
@@ -172,7 +181,9 @@ fun RefereeTrackerScreenV2(
|
||||
immutablerefereeTrackerList = refereeTrackerList,
|
||||
refereeTrackerForgeResponse = state.data,
|
||||
refereeTrackerVM = viewModel,
|
||||
naviRRAnalytics = naviRRAnalytics
|
||||
naviRRAnalytics = naviRRAnalytics,
|
||||
showFooter = showFooter,
|
||||
itemUpdates = itemUpdates
|
||||
)
|
||||
RefereeTrackerScreenHeader(context, navigator)
|
||||
SideEffect {
|
||||
@@ -225,7 +236,9 @@ fun RefereeTrackerScreenBodyV2(
|
||||
immutablerefereeTrackerList: LazyPagingItems<RefereeDetailsV4>,
|
||||
refereeTrackerForgeResponse: ScreenDefinition,
|
||||
refereeTrackerVM: RefereeTrackerVM,
|
||||
naviRRAnalytics: NaviRRAnalytics.RefereeTracker
|
||||
naviRRAnalytics: NaviRRAnalytics.RefereeTracker,
|
||||
showFooter: String?,
|
||||
itemUpdates: Map<Int, RefereeDetailsV4>
|
||||
) {
|
||||
|
||||
val context = LocalContext.current as RRBaseActivity
|
||||
@@ -288,10 +301,10 @@ fun RefereeTrackerScreenBodyV2(
|
||||
val index: Int =
|
||||
ch.indexOfFirst { it?.referenceId == refereeTrackerVM.referenceId }
|
||||
if (index >= 0) {
|
||||
val tt = refereeTrackerList
|
||||
tt[index]?.refereeCardInfo?.referralProgressStatus =
|
||||
val selectedRefereeDetail = refereeTrackerList[index]?.copy()
|
||||
selectedRefereeDetail?.refereeCardInfo?.referralProgressStatus =
|
||||
RefereeStateV2.REMINDED
|
||||
refereeTrackerList = tt
|
||||
refereeTrackerVM.updateItemState(index, selectedRefereeDetail!!)
|
||||
refereeTrackerVM.referenceId?.let {
|
||||
refereeTrackerVM.postReminderToReferee(it)
|
||||
naviRRAnalytics.sendEvent(
|
||||
@@ -337,11 +350,13 @@ fun RefereeTrackerScreenBodyV2(
|
||||
Scaffold(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
bottomBar = {
|
||||
refereeTrackerForgeResponse.screenStructure?.footer?.let {
|
||||
FooterWithShadow(
|
||||
widget = refereeTrackerForgeResponse.screenStructure?.footer,
|
||||
viewModel = refereeTrackerVM
|
||||
)
|
||||
if (showFooter.isNull()) {
|
||||
refereeTrackerForgeResponse.screenStructure?.footer?.let {
|
||||
FooterWithShadow(
|
||||
widget = refereeTrackerForgeResponse.screenStructure?.footer,
|
||||
viewModel = refereeTrackerVM
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
) {
|
||||
@@ -366,7 +381,7 @@ fun RefereeTrackerScreenBodyV2(
|
||||
|
||||
item?.let { referee ->
|
||||
RefereeItemComponent(
|
||||
refereeDetails = referee,
|
||||
refereeDetails = itemUpdates[index] ?: referee,
|
||||
selectedIndex = index,
|
||||
statusProgressTextMap = statusProgressTextMap,
|
||||
onListItemClick = { refereeDetails: RefereeDetailsV4 ->
|
||||
@@ -468,61 +483,79 @@ private fun RefereeItemComponent(
|
||||
}
|
||||
Column(modifier = Modifier.padding(10.dp, 2.dp, 30.dp, 0.dp)) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
refereeDetails.refereeCardInfo?.refereeIdentifier?.let {
|
||||
when {
|
||||
it.name.isNotNullAndNotEmpty() -> it.name
|
||||
it.phoneNumber != null -> it.phoneNumber
|
||||
else -> EMPTY
|
||||
}?.let { it1 ->
|
||||
Text(
|
||||
text = it1,
|
||||
val spannableText = buildAnnotatedString {
|
||||
// Referee Identifier
|
||||
refereeDetails.refereeCardInfo?.refereeIdentifier?.let { identifier ->
|
||||
val displayText =
|
||||
when {
|
||||
identifier.name.isNotNullAndNotEmpty() -> identifier.name
|
||||
identifier.phoneNumber != null -> identifier.phoneNumber
|
||||
else -> EMPTY
|
||||
}
|
||||
withStyle(
|
||||
style =
|
||||
TextStyle(
|
||||
fontSize = 14.sp,
|
||||
lineHeight = 22.sp,
|
||||
fontFamily = ttComposeFontFamily,
|
||||
fontWeight = FontWeight.Medium,
|
||||
SpanStyle(
|
||||
color = primaryText,
|
||||
fontWeight = FontWeight.Medium,
|
||||
fontSize = 14.sp,
|
||||
fontFamily = ttComposeFontFamily,
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
// TODO: Need to check if expiryInDays and expiryin hours is not null
|
||||
refereeDetails.refereeCardInfo?.expiryInDays?.let {
|
||||
Spacer(
|
||||
modifier =
|
||||
Modifier.padding(start = 6.dp)
|
||||
.height(3.dp)
|
||||
.width(3.dp)
|
||||
.background(primaryText, shape = CircleShape)
|
||||
)
|
||||
Row(modifier = Modifier.padding(start = 6.dp)) {
|
||||
Text(
|
||||
text = it.toInt().toString(),
|
||||
style =
|
||||
TextStyle(
|
||||
fontSize = 10.sp,
|
||||
lineHeight = 14.sp,
|
||||
fontFamily = ttComposeFontFamily,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
color = expiryText,
|
||||
)
|
||||
)
|
||||
Text(
|
||||
text =
|
||||
if (it > 0) stringResource(R.string.tracker_expiry_left_days)
|
||||
else stringResource(R.string.tracker_expiry_left_day),
|
||||
style =
|
||||
TextStyle(
|
||||
fontSize = 10.sp,
|
||||
lineHeight = 14.sp,
|
||||
fontFamily = ttComposeFontFamily,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
color = expiryText,
|
||||
)
|
||||
)
|
||||
) {
|
||||
append(displayText)
|
||||
}
|
||||
// Add spacing or separator
|
||||
}
|
||||
|
||||
// Expiry Info
|
||||
refereeDetails.refereeCardInfo?.expiryInDays?.let { expiryInDays ->
|
||||
withStyle(
|
||||
style =
|
||||
SpanStyle(
|
||||
color = primaryText,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
fontSize = 14.sp,
|
||||
fontFamily = ttComposeFontFamily,
|
||||
)
|
||||
) {
|
||||
append(" • ")
|
||||
}
|
||||
withStyle(
|
||||
style =
|
||||
SpanStyle(
|
||||
color = expiryText,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
fontSize = 10.sp,
|
||||
fontFamily = ttComposeFontFamily,
|
||||
baselineShift = BaselineShift(0.08f),
|
||||
)
|
||||
) {
|
||||
append(expiryInDays.toInt().toString())
|
||||
}
|
||||
withStyle(
|
||||
style =
|
||||
SpanStyle(
|
||||
color = expiryText,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
fontSize = 10.sp,
|
||||
fontFamily = ttComposeFontFamily,
|
||||
baselineShift = BaselineShift(0.08f),
|
||||
)
|
||||
) {
|
||||
val expiryTextRes =
|
||||
if (expiryInDays > 0) R.string.tracker_expiry_left_days
|
||||
else R.string.tracker_expiry_left_day
|
||||
append(stringResource(expiryTextRes))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Text(
|
||||
text = spannableText,
|
||||
style = TextStyle(fontFamily = ttComposeFontFamily),
|
||||
maxLines = 2,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
textAlign = TextAlign.Start
|
||||
)
|
||||
}
|
||||
Spacer(modifier = Modifier.height(2.dp))
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
@@ -597,6 +630,8 @@ private fun RefereeItemComponent(
|
||||
onRemindCtaClick = {
|
||||
onRemindCtaClick(refereeDetails.referenceId)
|
||||
refereeTrackerStatus = RefereeStateV2.REMINDED
|
||||
refereeDetails.refereeCardInfo?.referralProgressStatus =
|
||||
RefereeStateV2.REMINDED
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ fun CompletedStateComponent(
|
||||
color = NaviRRColor.greenText,
|
||||
fontFamily = ttComposeFontFamily,
|
||||
fontWeight = getFontWeight(FontWeightEnum.TT_MEDIUM),
|
||||
fontSize = 10.sp
|
||||
fontSize = 12.sp
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.navi.rr.common.constants.FORGE_REFEREE_TRACKER_SCREEN_V2
|
||||
import com.navi.rr.common.constants.FORGE_REFEREE_TRACKER_SCREEN_V3
|
||||
import com.navi.rr.common.models.RRErrorData
|
||||
import com.navi.rr.common.vm.RRBaseVM
|
||||
import com.navi.rr.referral.models.RefereeDetailsV4
|
||||
import com.navi.rr.referral.repo.RefereeTrackerListSourceV2
|
||||
import com.navi.rr.referral.repo.RefereeTrackerListSourceV2.Companion.REFEREE_TRACKER_ITEM_LIMIT
|
||||
import com.navi.rr.referral.repo.RefereeTrackerRepo
|
||||
@@ -35,6 +36,7 @@ import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import javax.inject.Inject
|
||||
import kotlinx.coroutines.flow.MutableSharedFlow
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import kotlinx.coroutines.flow.asSharedFlow
|
||||
import kotlinx.coroutines.flow.asStateFlow
|
||||
import kotlinx.coroutines.flow.update
|
||||
@@ -65,6 +67,13 @@ constructor(
|
||||
val bottomSheetState = _bottomSheetState.asSharedFlow()
|
||||
|
||||
var referenceId: String? = null
|
||||
private val _itemUpdates = MutableStateFlow<Map<Int, RefereeDetailsV4>>(emptyMap())
|
||||
val itemUpdates: StateFlow<Map<Int, RefereeDetailsV4>> = _itemUpdates
|
||||
|
||||
// Call to update an item's text
|
||||
fun updateItemState(index: Int, newState: RefereeDetailsV4) {
|
||||
_itemUpdates.value = _itemUpdates.value + (index to newState)
|
||||
}
|
||||
|
||||
init {
|
||||
launch {
|
||||
|
||||
@@ -21,11 +21,9 @@ import com.navi.rr.common.constants.FORGE_REFERRAL_HOME_SCREEN
|
||||
import com.navi.rr.common.models.RRErrorData
|
||||
import com.navi.rr.common.vm.RRBaseVM
|
||||
import com.navi.rr.referral.repo.ReferralHomeRepo
|
||||
import com.navi.rr.referral.utils.ReferralNavigationActions
|
||||
import com.navi.rr.utils.RRShareApp
|
||||
import com.navi.rr.utils.cacheImages
|
||||
import com.navi.uitron.model.data.UiTronAction
|
||||
import com.ramcosta.composedestinations.spec.Direction
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import javax.inject.Inject
|
||||
import kotlinx.coroutines.flow.MutableSharedFlow
|
||||
@@ -52,12 +50,6 @@ constructor(
|
||||
MutableSharedFlow<ReferralGratificationScreenState>()
|
||||
val referralLeaderboardPopupScreenState = _referralLeaderboardPopupScreenData.asSharedFlow()
|
||||
|
||||
private val _navigateToNextScreen = MutableSharedFlow<Direction>()
|
||||
val navigateToNextScreen = _navigateToNextScreen.asSharedFlow()
|
||||
|
||||
private val _navigateToPreviousScreen = MutableSharedFlow<Boolean>()
|
||||
val navigateToPreviousScreen = _navigateToPreviousScreen.asSharedFlow()
|
||||
|
||||
private val _ctaNavigation = MutableSharedFlow<UiTronAction?>()
|
||||
val ctaNavigation = _ctaNavigation.asSharedFlow()
|
||||
|
||||
@@ -121,23 +113,22 @@ constructor(
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun navigateToScreen(url: String, action: UiTronAction?) {
|
||||
when (url) {
|
||||
ReferralNavigationActions.BACK.name -> {
|
||||
_navigateToPreviousScreen.emit(true)
|
||||
}
|
||||
else -> {
|
||||
rewardsNavigator.composableRegistry
|
||||
.findDirectionByName(destinationName = url, bundle = null)
|
||||
?.let { _navigateToNextScreen.emit(it) } ?: run { _ctaNavigation.emit(action) }
|
||||
}
|
||||
}
|
||||
private suspend fun navigateToScreen(
|
||||
url: String,
|
||||
action: UiTronAction?,
|
||||
) {
|
||||
_ctaNavigation.emit(action)
|
||||
}
|
||||
|
||||
private suspend fun handleReferralHomeScreenActions(action: UiTronAction?) {
|
||||
when (action) {
|
||||
is CtaAction -> {
|
||||
action.ctaData?.url?.let { navigateToScreen(it, action) }
|
||||
action.ctaData?.url?.let {
|
||||
navigateToScreen(
|
||||
it,
|
||||
action,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -472,7 +472,7 @@ class NaviRRAnalytics private constructor() {
|
||||
const val REWARDS_PAN_DETAILS_INTERNAL_SCREEN_LANDS =
|
||||
"rewards_pan_details_internal_screen_lands"
|
||||
const val REWARDS_UPI_PAGE_LANDS = "rewards_upi_page_lands"
|
||||
const val REFERRAL_REMIND_CTA_CLICK = "referral_earning_screen_remind_btn_click"
|
||||
const val REFERRAL_REMIND_CTA_CLICK = "referral_upi_tracking_screen_remind_click"
|
||||
const val YES = "yes"
|
||||
const val NO = "no"
|
||||
const val currency = "INR"
|
||||
|
||||
@@ -100,9 +100,11 @@ object Constants {
|
||||
const val FALSE = "false"
|
||||
const val MD5 = "MD5"
|
||||
const val HEX_FORMAT = "%02x"
|
||||
const val HIDE_FOOTER = "hideFooter"
|
||||
const val NAVI_COINS_WITH_UNDERSCORE = "navi_coins"
|
||||
const val NAVI_COINS = "Navi coins"
|
||||
const val NAVI_COIN = "Navi coin"
|
||||
const val SCREEN_ID = "screenID"
|
||||
}
|
||||
|
||||
object ContentProviderContractConstants {
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<string name="all">ALL</string>
|
||||
<string name="s">S</string>
|
||||
<string name="plus_amount">+%1$s</string>
|
||||
<string name="tracker_expiry_left_days">" days left"</string>
|
||||
<string name="tracker_expiry_left_day">" day left"</string>
|
||||
<string name="tracker_expiry_left_days">" Days left"</string>
|
||||
<string name="tracker_expiry_left_day">" Day left"</string>
|
||||
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user