NTP-42649 | Gold landing page crash fix (#15139)
Co-authored-by: Sayed Owais Ali <sayed.owais@navi.com>
This commit is contained in:
@@ -11,7 +11,7 @@ import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.width
|
||||
@@ -83,39 +83,46 @@ fun FundBoxComposable(
|
||||
ShapeUtil.getShape(shape = cardData.property?.borderStrokeData?.shape),
|
||||
)
|
||||
.width(cardWidth)
|
||||
.height(134.dp)
|
||||
.clickableWithNoGesture(onClick = { onFundClick(cardData.actionData) })
|
||||
) {
|
||||
Column(modifier = Modifier.setPadding(cardData.property?.padding)) {
|
||||
NaviTextWidgetized(textFieldData = cardData.fundName)
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
verticalAlignment = Alignment.Bottom,
|
||||
) {
|
||||
Column(
|
||||
horizontalAlignment = Alignment.Start,
|
||||
modifier =
|
||||
Modifier.padding(
|
||||
end =
|
||||
cardData.returnsAmount?.textLayoutParams?.padding?.endDp?.dp
|
||||
?: R.integer.value_16.dp
|
||||
)
|
||||
.weight(columnWeight),
|
||||
) {
|
||||
NaviTextWidgetized(textFieldData = cardData.returnsDuration)
|
||||
NaviTextWidgetized(textFieldData = cardData.returnsAmount)
|
||||
}
|
||||
Column(horizontalAlignment = Alignment.End) {
|
||||
NaviImage(
|
||||
imageFieldData = cardData.rightIcon,
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Column(
|
||||
horizontalAlignment = Alignment.Start,
|
||||
modifier =
|
||||
Modifier.width(
|
||||
(cardData.rightIcon?.iconWidth ?: R.integer.value_16).dp
|
||||
Modifier.padding(
|
||||
end =
|
||||
cardData.returnsAmount
|
||||
?.textLayoutParams
|
||||
?.padding
|
||||
?.endDp
|
||||
?.dp ?: R.integer.value_16.dp
|
||||
)
|
||||
.height(
|
||||
(cardData.rightIcon?.iconHeight ?: R.integer.value_16).dp
|
||||
),
|
||||
)
|
||||
.weight(columnWeight),
|
||||
) {
|
||||
NaviTextWidgetized(textFieldData = cardData.returnsDuration)
|
||||
NaviTextWidgetized(textFieldData = cardData.returnsAmount)
|
||||
}
|
||||
Column(horizontalAlignment = Alignment.End) {
|
||||
NaviImage(
|
||||
imageFieldData = cardData.rightIcon,
|
||||
modifier =
|
||||
Modifier.width(
|
||||
(cardData.rightIcon?.iconWidth ?: R.integer.value_16).dp
|
||||
)
|
||||
.height(
|
||||
(cardData.rightIcon?.iconHeight ?: R.integer.value_16)
|
||||
.dp
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -428,11 +428,13 @@ constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
|
||||
|
||||
if (amount == 0.0) {
|
||||
info.actionData()?.disabled = true
|
||||
widgetCallback.widgetStateChanged(
|
||||
position = widgetPosition,
|
||||
data = Pair(first = info.toString(), second = info),
|
||||
action = WIDGET_STATE_CHANGE,
|
||||
)
|
||||
widgetCallback.getLifeCycle()?.coroutineScope?.launch {
|
||||
widgetCallback.widgetStateChanged(
|
||||
position = widgetPosition,
|
||||
data = Pair(first = info.toString(), second = info),
|
||||
action = WIDGET_STATE_CHANGE,
|
||||
)
|
||||
}
|
||||
widgetCallback.widgetUserData(
|
||||
DIGITAL_GOLD_USER_ENTERED_AMOUNT,
|
||||
info.actualAmount() ?: 0.0,
|
||||
@@ -470,11 +472,13 @@ constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
|
||||
|
||||
if (weight == 0.0) {
|
||||
info.actionData()?.disabled = true
|
||||
widgetCallback.widgetStateChanged(
|
||||
position = widgetPosition,
|
||||
data = Pair(first = info.toString(), second = info),
|
||||
action = WIDGET_STATE_CHANGE,
|
||||
)
|
||||
widgetCallback.getLifeCycle()?.coroutineScope?.launch {
|
||||
widgetCallback.widgetStateChanged(
|
||||
position = widgetPosition,
|
||||
data = Pair(first = info.toString(), second = info),
|
||||
action = WIDGET_STATE_CHANGE,
|
||||
)
|
||||
}
|
||||
widgetCallback.widgetUserData(STORE_DIGITAL_GOLD_AMOUNT, info.actualAmount() ?: 0.0)
|
||||
return
|
||||
}
|
||||
@@ -556,11 +560,13 @@ constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
|
||||
.orZero()
|
||||
)
|
||||
}
|
||||
widgetCallback.widgetStateChanged(
|
||||
position = widgetPosition,
|
||||
data = Pair(first = info.toString(), second = info),
|
||||
action = WIDGET_STATE_CHANGE,
|
||||
)
|
||||
widgetCallback.getLifeCycle()?.coroutineScope?.launch {
|
||||
widgetCallback.widgetStateChanged(
|
||||
position = widgetPosition,
|
||||
data = Pair(first = info.toString(), second = info),
|
||||
action = WIDGET_STATE_CHANGE,
|
||||
)
|
||||
}
|
||||
widgetCallback.widgetUserData(DIGITAL_GOLD_USER_ENTERED_AMOUNT, info.actualAmount() ?: 0.0)
|
||||
widgetCallback.widgetUserData(STORE_DIGITAL_GOLD_AMOUNT, info.actualAmount() ?: 0.0)
|
||||
info.rewardInfoData()?.let { rewardInfoData ->
|
||||
@@ -694,11 +700,13 @@ constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
|
||||
binding.tvError.text =
|
||||
updatedText.text.spannedText(context = context, span = updatedText.span)
|
||||
binding.ivError.isVisible = false
|
||||
widgetCallback.widgetStateChanged(
|
||||
position = widgetPosition,
|
||||
data = Pair(first = dynamicText.toString(), second = dynamicText),
|
||||
action = WIDGET_STATE_CHANGE,
|
||||
)
|
||||
widgetCallback.getLifeCycle()?.coroutineScope?.launch {
|
||||
widgetCallback.widgetStateChanged(
|
||||
position = widgetPosition,
|
||||
data = Pair(first = dynamicText.toString(), second = dynamicText),
|
||||
action = WIDGET_STATE_CHANGE,
|
||||
)
|
||||
}
|
||||
widgetCallback.widgetUserData(
|
||||
STORE_DIGITAL_GOLD_AMOUNT,
|
||||
formattedRoundOffAmount.toSafeDouble(),
|
||||
|
||||
Reference in New Issue
Block a user