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

Develop #756

Merged
merged 5 commits into from
Apr 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions app/src/main/java/com/ivy/wallet/ui/edit/EditTransactionScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.layout.positionInParent
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.tooling.preview.Preview
Expand Down Expand Up @@ -335,7 +336,7 @@ private fun BoxWithConstraintsScope.UI(
val nav = navigation()
AddPrimaryAttributeButton(
icon = R.drawable.ic_planned_payments,
text = "Add planned date of payment",
text = stringResource(R.string.add_planned_date_payment),
onClick = {
nav.back()
nav.navigateTo(
Expand Down Expand Up @@ -386,7 +387,7 @@ private fun BoxWithConstraintsScope.UI(
}
} else {
//no changes, pay
ModalCheck(label = if (transactionType == TransactionType.EXPENSE) "Pay" else "Get") {
ModalCheck(label = if (transactionType == TransactionType.EXPENSE) stringResource(R.string.pay) else stringResource(R.string.get)) {
onPayPlannedPayment()
}
}
Expand Down Expand Up @@ -485,8 +486,8 @@ private fun BoxWithConstraintsScope.UI(

DeleteModal(
visible = deleteTrnModalVisible,
title = "Confirm deletion",
description = "Deleting this transaction will remove it from the transaction history and update the balance accordingly.",
title = stringResource(R.string.confirm_deletion),
description = stringResource(R.string.confirm_deletion_description),
dismiss = { deleteTrnModalVisible = false }
) {
onDelete()
Expand All @@ -505,10 +506,9 @@ private fun BoxWithConstraintsScope.UI(

DeleteModal(
visible = accountChangeModal,
title = "Confirm Account Change",
description = "Note: You are trying to change the account associated with the loan with an account of different currency, " +
"\nAll the loan records will be re-calculated based on today's exchanges rates ",
buttonText = "Confirm",
title = stringResource(R.string.confirm_account_change),
description = stringResource(R.string.confirm_account_change_description),
buttonText = stringResource(R.string.confirm),
iconStart = R.drawable.ic_agreed,
dismiss = {
accountChangeModal = false
Expand All @@ -519,8 +519,8 @@ private fun BoxWithConstraintsScope.UI(
}

ProgressModal(
title = "Confirm Account Change",
description = "Please wait, re-calculating all loan records",
title = stringResource(R.string.confirm_account_change),
description = stringResource(R.string.account_change_recalculating),
visible = waitModalVisible
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -66,7 +67,7 @@ private fun PreviewPrimaryAttributeColumn() {
IvyWalletComponentPreview {
PrimaryAttributeColumn(
icon = R.drawable.ic_description,
title = "Description",
title = stringResource(R.string.description_text),
onClick = { }
) {
Spacer(Modifier.height(12.dp))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -50,7 +51,7 @@ fun TransactionDateTime(
Spacer(Modifier.width(8.dp))

Text(
text = "Created on",
text = stringResource(R.string.created_on),
style = UI.typo.b2.style(
color = UI.colors.gray,
fontWeight = FontWeight.Bold
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/ivy/wallet/ui/edit/core/Category.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.ivy.wallet.ui.edit.core
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import com.ivy.design.l0_system.UI
Expand Down Expand Up @@ -31,7 +32,7 @@ fun Category(
modifier = Modifier.padding(start = 24.dp),
iconStart = R.drawable.ic_plus,
iconTint = UI.colors.pureInverse,
text = "Add category"
text = stringResource(R.string.add_category)
) {
onChooseCategory()
}
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/java/com/ivy/wallet/ui/edit/core/Description.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -33,7 +34,7 @@ fun Description(
} else {
AddPrimaryAttributeButton(
icon = R.drawable.ic_description,
text = "Add description",
text = stringResource(R.string.add_description),
onClick = onAddDescription
)
}
Expand All @@ -46,7 +47,7 @@ private fun DescriptionText(
) {
PrimaryAttributeColumn(
icon = R.drawable.ic_description,
title = "Description",
title = stringResource(R.string.description_text),
onClick = onClick
) {
Spacer(Modifier.height(12.dp))
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/ivy/wallet/ui/edit/core/DueDate.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -56,7 +57,7 @@ private fun DueDateCard(
Spacer(Modifier.width(8.dp))

Text(
text = "Planned for",
text = stringResource(R.string.planned_for),
style = UI.typo.b2.style(
fontWeight = FontWeight.ExtraBold,
color = UI.colors.pureInverse
Expand Down
13 changes: 7 additions & 6 deletions app/src/main/java/com/ivy/wallet/ui/edit/core/EditBottomSheet.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import androidx.compose.ui.layout.layout
import androidx.compose.ui.layout.onSizeChanged
import androidx.compose.ui.platform.LocalView
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
Expand Down Expand Up @@ -135,9 +136,9 @@ fun BoxWithConstraintsScope.EditBottomSheet(
) {
//Accounts label
val label = when (type) {
TransactionType.INCOME -> "Add money to"
TransactionType.EXPENSE -> "Pay with"
TransactionType.TRANSFER -> "From"
TransactionType.INCOME -> stringResource(R.string.add_money_to)
TransactionType.EXPENSE -> stringResource(R.string.pay_with)
TransactionType.TRANSFER -> stringResource(R.string.from)
}

SheetHeader(
Expand Down Expand Up @@ -223,7 +224,7 @@ fun BoxWithConstraintsScope.EditBottomSheet(

Text(
modifier = Modifier.padding(start = 32.dp),
text = "Account",
text = stringResource(R.string.account),
style = UI.typo.b1.style(
color = UI.colors.pureInverse,
fontWeight = FontWeight.ExtraBold
Expand Down Expand Up @@ -439,7 +440,7 @@ private fun SheetHeader(

Text(
modifier = Modifier.padding(start = 32.dp),
text = "To",
text = stringResource(R.string.to),
style = UI.typo.b1.style(
color = UI.colors.pureInverse,
fontWeight = FontWeight.ExtraBold
Expand Down Expand Up @@ -588,7 +589,7 @@ private fun AddAccount(

Text(
modifier = Modifier.padding(vertical = 10.dp),
text = "Add account",
text = stringResource(R.string.add_account),
style = UI.typo.b2.style(
color = UI.colors.pureInverse,
fontWeight = FontWeight.ExtraBold
Expand Down
8 changes: 5 additions & 3 deletions app/src/main/java/com/ivy/wallet/ui/edit/core/Title.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardCapitalization
Expand All @@ -24,6 +25,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.ivy.design.l0_system.UI
import com.ivy.design.l0_system.style
import com.ivy.wallet.R
import com.ivy.wallet.domain.data.TransactionType
import com.ivy.wallet.ui.IvyWalletComponentPreview
import com.ivy.wallet.ui.theme.components.IvyTitleTextField
Expand Down Expand Up @@ -56,9 +58,9 @@ fun ColumnScope.Title(
.padding(horizontal = 24.dp),
value = titleTextFieldValue,
hint = when (type) {
TransactionType.INCOME -> "Income title"
TransactionType.EXPENSE -> "Expense title"
TransactionType.TRANSFER -> "Transfer title"
TransactionType.INCOME -> stringResource(R.string.income_title)
TransactionType.EXPENSE -> stringResource(R.string.expense_title)
TransactionType.TRANSFER -> stringResource(R.string.transfer_title)
},
keyboardOptions = KeyboardOptions(
autoCorrect = true,
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/java/com/ivy/wallet/ui/edit/core/Toolbar.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import androidx.compose.foundation.layout.width
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.ivy.design.api.navigation
import com.ivy.wallet.R
Expand Down Expand Up @@ -38,7 +39,7 @@ fun Toolbar(
when (type) {
TransactionType.INCOME -> {
IvyOutlinedButton(
text = "Income",
text = stringResource(R.string.income),
iconStart = R.drawable.ic_income
) {
onChangeTransactionTypeModal()
Expand All @@ -48,7 +49,7 @@ fun Toolbar(
}
TransactionType.EXPENSE -> {
IvyOutlinedButton(
text = "Expense",
text = stringResource(R.string.expense),
iconStart = R.drawable.ic_expense
) {
onChangeTransactionTypeModal()
Expand Down
9 changes: 5 additions & 4 deletions app/src/main/java/com/ivy/wallet/ui/home/HomeHeader.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import androidx.compose.ui.draw.alpha
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import com.ivy.design.api.navigation
Expand Down Expand Up @@ -120,7 +121,7 @@ private fun HeaderStickyRow(
modifier = Modifier
.alpha(percentExpanded)
.testTag("home_greeting_text"),
text = if (name.isNotNullOrBlank()) "Hi $name" else "Hi",
text = if (name.isNotNullOrBlank()) stringResource(R.string.hi_name, name) else stringResource(R.string.hi),
style = UI.typo.b1.style(
fontWeight = FontWeight.ExtraBold,
color = UI.colors.pureInverse
Expand Down Expand Up @@ -234,7 +235,7 @@ fun CashFlowInfo(
modifier = Modifier.padding(
start = 24.dp
),
text = "Cashflow: ${if (cashflow > 0) "+" else ""}${cashflow.format(currency)} $currency",
text = stringResource(R.string.cashflow, (if (cashflow > 0) "+" else ""), cashflow.format(currency), currency),
style = UI.typo.nB2.style(
color = if (cashflow < 0) Gray else Green
)
Expand Down Expand Up @@ -268,7 +269,7 @@ private fun IncomeExpenses(
icon = R.drawable.ic_income,
backgroundGradient = GradientGreen,
textColor = White,
label = "Income",
label = stringResource(R.string.income),
currency = currency,
amount = monthlyIncome
) {
Expand All @@ -286,7 +287,7 @@ private fun IncomeExpenses(
icon = R.drawable.ic_expense,
backgroundGradient = Gradient(UI.colors.pureInverse, UI.colors.gray),
textColor = UI.colors.pure,
label = "Expenses",
label = stringResource(R.string.expenses),
currency = currency,
amount = monthlyExpenses.absoluteValue
) {
Expand Down
Loading