From b345e54bb8b5e050acc3dec1cc3249ad142d6da9 Mon Sep 17 00:00:00 2001 From: Sandeep Karanam Date: Thu, 8 Feb 2024 17:33:49 +0530 Subject: [PATCH 1/5] Issue 2927 Fixed issue 2927 --- .../main/java/com/ivy/accounts/AccountsTab.kt | 28 +++++++------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/screen/accounts/src/main/java/com/ivy/accounts/AccountsTab.kt b/screen/accounts/src/main/java/com/ivy/accounts/AccountsTab.kt index 837e704d52..1bade94e89 100644 --- a/screen/accounts/src/main/java/com/ivy/accounts/AccountsTab.kt +++ b/screen/accounts/src/main/java/com/ivy/accounts/AccountsTab.kt @@ -31,17 +31,17 @@ import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.ivy.design.l0_system.UI import com.ivy.design.l0_system.style +import com.ivy.legacy.IvyWalletPreview +import com.ivy.legacy.data.model.AccountData import com.ivy.legacy.datamodel.Account import com.ivy.legacy.utils.clickableNoIndication import com.ivy.legacy.utils.horizontalSwipeListener import com.ivy.legacy.utils.rememberInteractionSource import com.ivy.legacy.utils.rememberSwipeListenerState -import com.ivy.navigation.IvyPreview import com.ivy.navigation.TransactionsScreen import com.ivy.navigation.navigation import com.ivy.navigation.screenScopedViewModel import com.ivy.resources.R -import com.ivy.wallet.ui.theme.Gray import com.ivy.wallet.ui.theme.Green import com.ivy.wallet.ui.theme.GreenDark import com.ivy.wallet.ui.theme.GreenLight @@ -110,20 +110,12 @@ private fun BoxWithConstraintsScope.UI( Spacer(Modifier.height(4.dp)) - Text( - text = state.totalBalanceWithExcludedText, - style = UI.typo.nB2.style( - color = Gray, - fontWeight = FontWeight.Bold - ) - ) - - Text( - text = state.totalBalanceWithoutExcludedText, - style = UI.typo.nC.style( - color = Gray, - fontWeight = FontWeight.Bold - ) + IncomeExpensesRow( + currency = state.baseCurrency, + incomeLabel = "Total Balance", + income = state.totalBalanceWithoutExcluded.toDouble(), + expensesLabel = "Total Balance ${stringResource(id = R.string.excluded)}", + expenses = state.totalBalanceWithExcluded.toDouble() ) } @@ -140,7 +132,6 @@ private fun BoxWithConstraintsScope.UI( Spacer(Modifier.height(16.dp)) } - items(state.accountsData) { Spacer(Modifier.height(16.dp)) AccountCard( @@ -330,7 +321,7 @@ private fun AccountHeader( @Preview @Composable private fun PreviewAccountsTab() { - IvyPreview { + IvyWalletPreview { val state = AccountsState( baseCurrency = "BGN", accountsData = persistentListOf( @@ -379,5 +370,6 @@ private fun PreviewAccountsTab() { totalBalanceWithoutExcludedText = "BGN 25.54", reorderVisible = false ) + UI(state = state) } } From 3f82da549340cf0780e143760affb53c8b0ac857 Mon Sep 17 00:00:00 2001 From: Sandeep Karanam Date: Thu, 8 Feb 2024 17:56:51 +0530 Subject: [PATCH 2/5] Strings Changes Added required string parameter for different languages --- screen/accounts/src/main/java/com/ivy/accounts/AccountsTab.kt | 4 ++-- shared/resources/src/main/res/values-ar/strings.xml | 1 + shared/resources/src/main/res/values-bg/strings.xml | 1 + shared/resources/src/main/res/values-es/strings.xml | 1 + shared/resources/src/main/res/values-hi/strings.xml | 1 + shared/resources/src/main/res/values-id/strings.xml | 1 + shared/resources/src/main/res/values-in/strings.xml | 1 + shared/resources/src/main/res/values-it/strings.xml | 1 + shared/resources/src/main/res/values-kn/strings.xml | 1 + shared/resources/src/main/res/values-mn/strings.xml | 1 + shared/resources/src/main/res/values-pl/strings.xml | 1 + shared/resources/src/main/res/values-ru/strings.xml | 1 + shared/resources/src/main/res/values/strings.xml | 1 + 13 files changed, 14 insertions(+), 2 deletions(-) diff --git a/screen/accounts/src/main/java/com/ivy/accounts/AccountsTab.kt b/screen/accounts/src/main/java/com/ivy/accounts/AccountsTab.kt index 1bade94e89..654b19d353 100644 --- a/screen/accounts/src/main/java/com/ivy/accounts/AccountsTab.kt +++ b/screen/accounts/src/main/java/com/ivy/accounts/AccountsTab.kt @@ -112,9 +112,9 @@ private fun BoxWithConstraintsScope.UI( IncomeExpensesRow( currency = state.baseCurrency, - incomeLabel = "Total Balance", + incomeLabel = stringResource(id = R.string.total_balance), income = state.totalBalanceWithoutExcluded.toDouble(), - expensesLabel = "Total Balance ${stringResource(id = R.string.excluded)}", + expensesLabel = "${stringResource(id = R.string.total_balance)} ${stringResource(id = R.string.excluded)}", expenses = state.totalBalanceWithExcluded.toDouble() ) } diff --git a/shared/resources/src/main/res/values-ar/strings.xml b/shared/resources/src/main/res/values-ar/strings.xml index b3ded1ce1c..efaa11f54c 100644 --- a/shared/resources/src/main/res/values-ar/strings.xml +++ b/shared/resources/src/main/res/values-ar/strings.xml @@ -438,4 +438,5 @@ الإعدادات التجريبية رصيد المحفظة %1$s %2$s: المجموع (حصريا) + المجموع المحفظة diff --git a/shared/resources/src/main/res/values-bg/strings.xml b/shared/resources/src/main/res/values-bg/strings.xml index 330d12ed74..ac6b4d8774 100644 --- a/shared/resources/src/main/res/values-bg/strings.xml +++ b/shared/resources/src/main/res/values-bg/strings.xml @@ -438,4 +438,5 @@ Experimental Settings Wallet balance Общо (без): %1$s %2$s + Общо БАЛАНС \ No newline at end of file diff --git a/shared/resources/src/main/res/values-es/strings.xml b/shared/resources/src/main/res/values-es/strings.xml index 0896a70878..13ea13b587 100644 --- a/shared/resources/src/main/res/values-es/strings.xml +++ b/shared/resources/src/main/res/values-es/strings.xml @@ -438,4 +438,5 @@ Ajustes experimentales Wallet balance Total (exclusivo): %1$s %2$s + Total Balance diff --git a/shared/resources/src/main/res/values-hi/strings.xml b/shared/resources/src/main/res/values-hi/strings.xml index cb1cdf627f..1f08b630c8 100644 --- a/shared/resources/src/main/res/values-hi/strings.xml +++ b/shared/resources/src/main/res/values-hi/strings.xml @@ -438,4 +438,5 @@ प्रायोगिक सेटिंग्स वॉलेट बैलेंस कुल (अनन्य): %1$s %2$s + कुल बैलेंस \ No newline at end of file diff --git a/shared/resources/src/main/res/values-id/strings.xml b/shared/resources/src/main/res/values-id/strings.xml index 6f1ee8f6f1..26eb0c2bdb 100644 --- a/shared/resources/src/main/res/values-id/strings.xml +++ b/shared/resources/src/main/res/values-id/strings.xml @@ -441,4 +441,5 @@ Pengaturan Eksperimental Saldo dompet Total (eksklusif): %1$s %2$s + Total dompet diff --git a/shared/resources/src/main/res/values-in/strings.xml b/shared/resources/src/main/res/values-in/strings.xml index 6f1ee8f6f1..26eb0c2bdb 100644 --- a/shared/resources/src/main/res/values-in/strings.xml +++ b/shared/resources/src/main/res/values-in/strings.xml @@ -441,4 +441,5 @@ Pengaturan Eksperimental Saldo dompet Total (eksklusif): %1$s %2$s + Total dompet diff --git a/shared/resources/src/main/res/values-it/strings.xml b/shared/resources/src/main/res/values-it/strings.xml index 0381f6a532..5973bbc3d1 100644 --- a/shared/resources/src/main/res/values-it/strings.xml +++ b/shared/resources/src/main/res/values-it/strings.xml @@ -438,4 +438,5 @@ Impostazioni Sperimentali Wallet balance Totale (esclusivo): %1$s %2$s + Totale Saldo diff --git a/shared/resources/src/main/res/values-kn/strings.xml b/shared/resources/src/main/res/values-kn/strings.xml index be9c16cc03..8f9f49a678 100644 --- a/shared/resources/src/main/res/values-kn/strings.xml +++ b/shared/resources/src/main/res/values-kn/strings.xml @@ -438,4 +438,5 @@ ಪ್ರಯೋಗಾತ್ಮಕ ಸೆಟ್ಟಿಂಗ್‌ಗಳು Wallet balance ಒಟ್ಟು (ವಿಶೇಷ): %1$s %2$s + ಒಟ್ಟು ಮೊತ್ತ diff --git a/shared/resources/src/main/res/values-mn/strings.xml b/shared/resources/src/main/res/values-mn/strings.xml index 0499f51bd2..24d1ffbe06 100644 --- a/shared/resources/src/main/res/values-mn/strings.xml +++ b/shared/resources/src/main/res/values-mn/strings.xml @@ -438,4 +438,5 @@ Туршилтын тохиргоо Хэтэвчний үлдэгдэл Нийт (онцгой): %1$s %2$s + Нийт ҮЛДЭГДЭЛ diff --git a/shared/resources/src/main/res/values-pl/strings.xml b/shared/resources/src/main/res/values-pl/strings.xml index 098c84a2c7..6a23e622bd 100644 --- a/shared/resources/src/main/res/values-pl/strings.xml +++ b/shared/resources/src/main/res/values-pl/strings.xml @@ -441,4 +441,5 @@ Ustawienia eksperymentalne Saldo portfela Łącznie (exclusive): %1$s %2$s + Łącznie Saldo diff --git a/shared/resources/src/main/res/values-ru/strings.xml b/shared/resources/src/main/res/values-ru/strings.xml index 8795d187c2..4aab0ac2ed 100644 --- a/shared/resources/src/main/res/values-ru/strings.xml +++ b/shared/resources/src/main/res/values-ru/strings.xml @@ -438,4 +438,5 @@ Experimental Settings Wallet balance Итого (эксклюзивно): %1$s %2$s + Итого БАЛАНС diff --git a/shared/resources/src/main/res/values/strings.xml b/shared/resources/src/main/res/values/strings.xml index e6469a772b..0e731cdabe 100644 --- a/shared/resources/src/main/res/values/strings.xml +++ b/shared/resources/src/main/res/values/strings.xml @@ -441,4 +441,5 @@ Experimental Settings Wallet balance Total (exclusive): %1$s %2$s + Total Balance From d3eba0d824bb53f035564dc30bdb1ef945d31051 Mon Sep 17 00:00:00 2001 From: Sandeep Karanam Date: Thu, 8 Feb 2024 18:58:12 +0530 Subject: [PATCH 3/5] Total Balance Excluded in one string Total Balance Excluded string addition in all languages with single string --- screen/accounts/src/main/java/com/ivy/accounts/AccountsTab.kt | 2 +- shared/resources/src/main/res/values-ar/strings.xml | 1 + shared/resources/src/main/res/values-bg/strings.xml | 1 + shared/resources/src/main/res/values-es/strings.xml | 1 + shared/resources/src/main/res/values-hi/strings.xml | 1 + shared/resources/src/main/res/values-id/strings.xml | 1 + shared/resources/src/main/res/values-in/strings.xml | 1 + shared/resources/src/main/res/values-it/strings.xml | 1 + shared/resources/src/main/res/values-kn/strings.xml | 1 + shared/resources/src/main/res/values-mn/strings.xml | 1 + shared/resources/src/main/res/values-pl/strings.xml | 1 + shared/resources/src/main/res/values-ru/strings.xml | 1 + shared/resources/src/main/res/values/strings.xml | 1 + 13 files changed, 13 insertions(+), 1 deletion(-) diff --git a/screen/accounts/src/main/java/com/ivy/accounts/AccountsTab.kt b/screen/accounts/src/main/java/com/ivy/accounts/AccountsTab.kt index 654b19d353..f0dfd06589 100644 --- a/screen/accounts/src/main/java/com/ivy/accounts/AccountsTab.kt +++ b/screen/accounts/src/main/java/com/ivy/accounts/AccountsTab.kt @@ -114,7 +114,7 @@ private fun BoxWithConstraintsScope.UI( currency = state.baseCurrency, incomeLabel = stringResource(id = R.string.total_balance), income = state.totalBalanceWithoutExcluded.toDouble(), - expensesLabel = "${stringResource(id = R.string.total_balance)} ${stringResource(id = R.string.excluded)}", + expensesLabel = stringResource(id = R.string.total_balance_excluded), expenses = state.totalBalanceWithExcluded.toDouble() ) } diff --git a/shared/resources/src/main/res/values-ar/strings.xml b/shared/resources/src/main/res/values-ar/strings.xml index efaa11f54c..bd2067e446 100644 --- a/shared/resources/src/main/res/values-ar/strings.xml +++ b/shared/resources/src/main/res/values-ar/strings.xml @@ -439,4 +439,5 @@ رصيد المحفظة %1$s %2$s: المجموع (حصريا) المجموع المحفظة + المجموع المحفظة(مستبعد) diff --git a/shared/resources/src/main/res/values-bg/strings.xml b/shared/resources/src/main/res/values-bg/strings.xml index ac6b4d8774..9971a58d4f 100644 --- a/shared/resources/src/main/res/values-bg/strings.xml +++ b/shared/resources/src/main/res/values-bg/strings.xml @@ -439,4 +439,5 @@ Wallet balance Общо (без): %1$s %2$s Общо БАЛАНС + Общо БАЛАНС (изключен) \ No newline at end of file diff --git a/shared/resources/src/main/res/values-es/strings.xml b/shared/resources/src/main/res/values-es/strings.xml index 13ea13b587..4e0610f39a 100644 --- a/shared/resources/src/main/res/values-es/strings.xml +++ b/shared/resources/src/main/res/values-es/strings.xml @@ -439,4 +439,5 @@ Wallet balance Total (exclusivo): %1$s %2$s Total Balance + Total Balance (excluido) diff --git a/shared/resources/src/main/res/values-hi/strings.xml b/shared/resources/src/main/res/values-hi/strings.xml index 1f08b630c8..d06a5566be 100644 --- a/shared/resources/src/main/res/values-hi/strings.xml +++ b/shared/resources/src/main/res/values-hi/strings.xml @@ -439,4 +439,5 @@ वॉलेट बैलेंस कुल (अनन्य): %1$s %2$s कुल बैलेंस + कुल बैलेंस (छोड़ा गया) \ No newline at end of file diff --git a/shared/resources/src/main/res/values-id/strings.xml b/shared/resources/src/main/res/values-id/strings.xml index 26eb0c2bdb..3502e0c2b5 100644 --- a/shared/resources/src/main/res/values-id/strings.xml +++ b/shared/resources/src/main/res/values-id/strings.xml @@ -442,4 +442,5 @@ Saldo dompet Total (eksklusif): %1$s %2$s Total dompet + Total dompet (tidak termasuk) diff --git a/shared/resources/src/main/res/values-in/strings.xml b/shared/resources/src/main/res/values-in/strings.xml index 26eb0c2bdb..3502e0c2b5 100644 --- a/shared/resources/src/main/res/values-in/strings.xml +++ b/shared/resources/src/main/res/values-in/strings.xml @@ -442,4 +442,5 @@ Saldo dompet Total (eksklusif): %1$s %2$s Total dompet + Total dompet (tidak termasuk) diff --git a/shared/resources/src/main/res/values-it/strings.xml b/shared/resources/src/main/res/values-it/strings.xml index 5973bbc3d1..caf4391851 100644 --- a/shared/resources/src/main/res/values-it/strings.xml +++ b/shared/resources/src/main/res/values-it/strings.xml @@ -439,4 +439,5 @@ Wallet balance Totale (esclusivo): %1$s %2$s Totale Saldo + Totale Saldo (escluso) diff --git a/shared/resources/src/main/res/values-kn/strings.xml b/shared/resources/src/main/res/values-kn/strings.xml index 8f9f49a678..7272a5edd0 100644 --- a/shared/resources/src/main/res/values-kn/strings.xml +++ b/shared/resources/src/main/res/values-kn/strings.xml @@ -439,4 +439,5 @@ Wallet balance ಒಟ್ಟು (ವಿಶೇಷ): %1$s %2$s ಒಟ್ಟು ಮೊತ್ತ + ಒಟ್ಟು ಮೊತ್ತ (ಹೊರತುಪಡಿಸಿ) diff --git a/shared/resources/src/main/res/values-mn/strings.xml b/shared/resources/src/main/res/values-mn/strings.xml index 24d1ffbe06..5b5ded1812 100644 --- a/shared/resources/src/main/res/values-mn/strings.xml +++ b/shared/resources/src/main/res/values-mn/strings.xml @@ -439,4 +439,5 @@ Хэтэвчний үлдэгдэл Нийт (онцгой): %1$s %2$s Нийт ҮЛДЭГДЭЛ + Нийт ҮЛДЭГДЭЛ (үлдэгдэл тооцохгүй) diff --git a/shared/resources/src/main/res/values-pl/strings.xml b/shared/resources/src/main/res/values-pl/strings.xml index 6a23e622bd..cdde823cbb 100644 --- a/shared/resources/src/main/res/values-pl/strings.xml +++ b/shared/resources/src/main/res/values-pl/strings.xml @@ -442,4 +442,5 @@ Saldo portfela Łącznie (exclusive): %1$s %2$s Łącznie Saldo + Łącznie Saldo (wykluczony) diff --git a/shared/resources/src/main/res/values-ru/strings.xml b/shared/resources/src/main/res/values-ru/strings.xml index 4aab0ac2ed..77c22f8cf1 100644 --- a/shared/resources/src/main/res/values-ru/strings.xml +++ b/shared/resources/src/main/res/values-ru/strings.xml @@ -439,4 +439,5 @@ Wallet balance Итого (эксклюзивно): %1$s %2$s Итого БАЛАНС + Итого БАЛАНС (исключенный) diff --git a/shared/resources/src/main/res/values/strings.xml b/shared/resources/src/main/res/values/strings.xml index 0e731cdabe..e41371e072 100644 --- a/shared/resources/src/main/res/values/strings.xml +++ b/shared/resources/src/main/res/values/strings.xml @@ -442,4 +442,5 @@ Wallet balance Total (exclusive): %1$s %2$s Total Balance + Total Balance (excluded) From 501df64469d0600fb4269017cfc760cc6eb0da41 Mon Sep 17 00:00:00 2001 From: Sandeep Karanam Date: Thu, 8 Feb 2024 21:48:37 +0530 Subject: [PATCH 4/5] Account Spacing and Balance Row Spacer changes Account Spacing and Balance Row Spacer changes --- screen/accounts/src/main/java/com/ivy/accounts/AccountsTab.kt | 2 +- .../com/ivy/legacy/legacy/ui/theme/components/BalanceRow.kt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/screen/accounts/src/main/java/com/ivy/accounts/AccountsTab.kt b/screen/accounts/src/main/java/com/ivy/accounts/AccountsTab.kt index f0dfd06589..4692819c8e 100644 --- a/screen/accounts/src/main/java/com/ivy/accounts/AccountsTab.kt +++ b/screen/accounts/src/main/java/com/ivy/accounts/AccountsTab.kt @@ -108,7 +108,7 @@ private fun BoxWithConstraintsScope.UI( ) ) - Spacer(Modifier.height(4.dp)) + Spacer(Modifier.height(16.dp)) IncomeExpensesRow( currency = state.baseCurrency, diff --git a/temp/legacy-code/src/main/java/com/ivy/legacy/legacy/ui/theme/components/BalanceRow.kt b/temp/legacy-code/src/main/java/com/ivy/legacy/legacy/ui/theme/components/BalanceRow.kt index ce396f53b6..835037d190 100644 --- a/temp/legacy-code/src/main/java/com/ivy/legacy/legacy/ui/theme/components/BalanceRow.kt +++ b/temp/legacy-code/src/main/java/com/ivy/legacy/legacy/ui/theme/components/BalanceRow.kt @@ -122,6 +122,7 @@ fun BalanceRow( } if (!doubleRowDisplay) { + Spacer(Modifier.width(spacerCurrency)) Text( text = when { hiddenMode -> "****" From 0a7796e6129e352017d127f735c7b9465cfacf8d Mon Sep 17 00:00:00 2001 From: Sandeep Karanam Date: Fri, 9 Feb 2024 00:45:55 +0530 Subject: [PATCH 5/5] Account tab Crash Issue Account Tab crash issue resolved --- .../accounts/src/main/java/com/ivy/accounts/AccountsTab.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/screen/accounts/src/main/java/com/ivy/accounts/AccountsTab.kt b/screen/accounts/src/main/java/com/ivy/accounts/AccountsTab.kt index 4692819c8e..9760276310 100644 --- a/screen/accounts/src/main/java/com/ivy/accounts/AccountsTab.kt +++ b/screen/accounts/src/main/java/com/ivy/accounts/AccountsTab.kt @@ -32,7 +32,6 @@ import androidx.compose.ui.unit.sp import com.ivy.design.l0_system.UI import com.ivy.design.l0_system.style import com.ivy.legacy.IvyWalletPreview -import com.ivy.legacy.data.model.AccountData import com.ivy.legacy.datamodel.Account import com.ivy.legacy.utils.clickableNoIndication import com.ivy.legacy.utils.horizontalSwipeListener @@ -113,9 +112,9 @@ private fun BoxWithConstraintsScope.UI( IncomeExpensesRow( currency = state.baseCurrency, incomeLabel = stringResource(id = R.string.total_balance), - income = state.totalBalanceWithoutExcluded.toDouble(), + income = state.totalBalanceWithoutExcluded.toDoubleOrNull() ?: 0.00, expensesLabel = stringResource(id = R.string.total_balance_excluded), - expenses = state.totalBalanceWithExcluded.toDouble() + expenses = state.totalBalanceWithExcluded.toDoubleOrNull() ?: 0.00 ) }