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

Commit

Permalink
Added strings in strings.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
code-a1 committed Apr 20, 2022
1 parent 3574250 commit 5746341
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 27 deletions.
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
23 changes: 23 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,27 @@
<string name="failed">Failed</string>
<string name="rows_from_csv_not_recognized">%1$d rows from CSV file not recognized</string>
<string name="finish">Finish</string>
<string name="add_description">Add description</string>
<string name="description_text">Description</string>
<string name="planned_for">Planned for</string>
<string name="add_money_to">Add money to</string>
<string name="pay_with">Pay with</string>
<string name="from">From</string>
<string name="account">Account</string>
<string name="to">To</string>
<string name="add_account">Add account</string>
<string name="income_title">Income title</string>
<string name="expense_title">Expense title</string>
<string name="transfer_title">Transfer title</string>
<string name="expense">Expense</string>
<string name="add_planned_date_payment">Add planned date of payment</string>
<string name="pay">Pay</string>
<string name="get">Get</string>
<string name="confirm_deletion">Confirm deletion</string>
<string name="confirm_deletion_description">Deleting this transaction will remove it from the transaction history and update the balance accordingly.</string>
<string name="confirm_account_change">Confirm Account Change</string>
<string name="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 </string>
<string name="confirm">Confirm</string>
<string name="account_change_recalculating">Please wait, re-calculating all loan records</string>
<string name="created_on">Created on</string>
</resources>

0 comments on commit 5746341

Please sign in to comment.