Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
Account Tab Decimal Formatting Added(Detekt issues Fixed + Paparazzi …
Browse files Browse the repository at this point in the history
…snapshots updated)
  • Loading branch information
shamim-emon committed Oct 6, 2024
1 parent 7af02ae commit 2064dbd
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 41 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -549,9 +549,7 @@ private fun CategoryHeader(

balanceFontSize = 30.sp,
currencyFontSize = 30.sp,

currencyUpfront = false,
balanceAmountPrefix = balancePrefixValue
currencyUpfront = false
)

Spacer(Modifier.height(16.dp))
Expand Down
3 changes: 0 additions & 3 deletions screen/home/src/main/java/com/ivy/home/HomeHeader.kt
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ private fun HeaderStickyRow(
},
currency = currency,
balance = balance,
shortenBigNumbers = true,
hiddenMode = hideBalance,
doubleRowDisplay = true,
)
Expand Down Expand Up @@ -249,7 +248,6 @@ fun CashFlowInfo(
.testTag("home_balance"),
currency = currency,
balance = balance,
shortenBigNumbers = true,
hiddenMode = hideBalance
)

Expand Down Expand Up @@ -416,7 +414,6 @@ private fun RowScope.HeaderCard(
currency = currency,
textColor = textColor,
hideIncome = hideIncome,
shortenBigNumbers = true,
)

Spacer(Modifier.width(4.dp))
Expand Down
6 changes: 1 addition & 5 deletions screen/reports/src/main/java/com/ivy/reports/ReportScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,7 @@ private fun BoxWithConstraintsScope.UI(
.padding(start = 32.dp),
textColor = UI.colors.pureInverse,
currency = state.baseCurrency,
balance = state.balance,
balanceAmountPrefix = when {
state.balance > 0 -> "+"
else -> null
}
balance = state.balance
)

Spacer(Modifier.height(20.dp))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ import com.ivy.legacy.ivyWalletCtx
import com.ivy.legacy.ui.component.IncomeExpensesCards
import com.ivy.legacy.ui.component.ItemStatisticToolbar
import com.ivy.legacy.ui.component.transaction.transactions
import com.ivy.legacy.utils.balancePrefix
import com.ivy.legacy.utils.clickableNoIndication
import com.ivy.legacy.utils.horizontalSwipeListener
import com.ivy.legacy.utils.rememberInteractionSource
Expand Down Expand Up @@ -641,15 +640,7 @@ private fun Header(
},
textColor = contrastColor,
currency = currency,
balance = balance,
balanceAmountPrefix = if (category != null) {
balancePrefix(
income = income,
expenses = expenses
)
} else {
null
}
balance = balance
)

if (currency != baseCurrency && balanceBaseCurrency != null) {
Expand All @@ -661,15 +652,7 @@ private fun Header(
},
textColor = itemColor.dynamicContrast(),
currency = baseCurrency,
balance = balanceBaseCurrency,
balanceAmountPrefix = if (category != null) {
balancePrefix(
income = income,
expenses = expenses
)
} else {
null
}
balance = balanceBaseCurrency
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ fun BalanceRowMedium(
balance: Double,
modifier: Modifier = Modifier,
textColor: Color = UI.colors.pureInverse,
balanceAmountPrefix: String? = null,
currencyUpfront: Boolean = true,
shortenBigNumbers: Boolean = false,
hiddenMode: Boolean = false,
) {
BalanceRow(
Expand All @@ -61,9 +59,7 @@ fun BalanceRowMini(
balance: Double,
modifier: Modifier = Modifier,
textColor: Color = UI.colors.pureInverse,
balanceAmountPrefix: String? = null,
currencyUpfront: Boolean = true,
shortenBigNumbers: Boolean = false,
hiddenMode: Boolean = false,
doubleRowDisplay: Boolean = false,
) {
Expand Down Expand Up @@ -99,7 +95,7 @@ fun BalanceRow(
val context = LocalContext.current
val scope = rememberCoroutineScope()
var formattedBalance by remember {
mutableStateOf("")
mutableStateOf("$balance")
}
scope.launch {
formattedBalance = balance.toDecimalFormat(context)
Expand Down Expand Up @@ -218,8 +214,7 @@ private fun Preview_Medium() {
BalanceRowMedium(
textColor = UI.colors.pureInverse,
currency = "BGN",
balance = 3520.60,
balanceAmountPrefix = null
balance = 3520.60
)
}
}
Expand All @@ -231,9 +226,7 @@ private fun Preview_Mini() {
BalanceRowMini(
textColor = UI.colors.pureInverse,
currency = "BGN",
balance = 3520.60,
balanceAmountPrefix = null,
shortenBigNumbers = true
balance = 3520.60
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fun AmountCurrencyB1(
) {
val context = LocalContext.current
val scope = rememberCoroutineScope()
var formattedAmount by remember { mutableStateOf("") }
var formattedAmount by remember { mutableStateOf("$amount") }
scope.launch {
formattedAmount = amount.toDecimalFormat(context)
}
Expand Down

0 comments on commit 2064dbd

Please sign in to comment.