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 a8163f4 commit fbf8770
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
Expand Down Expand Up @@ -242,16 +243,16 @@ private fun BoxWithConstraintsScope.UI(

DeleteModal(
visible = deleteModalVisible,
title = "Confirm deletion",
description = "Note: Deleting this loan will remove it permanently and delete all associated loan records with it.",
title = stringResource(R.string.confirm_deletion),
description = stringResource(R.string.confirm_loan_deletion_description),
dismiss = { deleteModalVisible = false }
) {
onDeleteLoan()
}

ProgressModal(
title = "Confirm Account Change",
description = "Please wait, re-calculating all loan records",
title = stringResource(R.string.confirm_account_change),
description = stringResource(R.string.confirm_account_loan_change),
visible = waitModalVisible
)
}
Expand Down Expand Up @@ -404,7 +405,7 @@ private fun LoanInfoCard(
) {
Text(
modifier = Modifier.padding(top = 8.dp, start = 24.dp),
text = "Paid",
text = stringResource(R.string.paid),
style = UI.typo.c.style(
color = contrastColor,
fontWeight = FontWeight.ExtraBold
Expand Down Expand Up @@ -484,7 +485,7 @@ private fun LoanInfoCard(
Text(
modifier = Modifier
.testTag("left_to_pay"),
text = "${leftToPay.format(baseCurrency)} $baseCurrency left",
text = stringResource(R.string.left_to_pay),
style = UI.typo.nB2.style(
color = Gray,
fontWeight = FontWeight.ExtraBold
Expand Down Expand Up @@ -515,7 +516,7 @@ private fun LoanInfoCard(

Text(
modifier = Modifier.padding(horizontal = 24.dp),
text = "Loan Interest",
text = stringResource(R.string.loan_interest),
style = UI.typo.c.style(
color = contrastColor,
fontWeight = FontWeight.ExtraBold
Expand Down Expand Up @@ -545,7 +546,7 @@ private fun LoanInfoCard(
Text(
modifier = Modifier
.testTag("interest_paid"),
text = "${loanAmountPaid.format(baseCurrency)} $baseCurrency paid",
text = stringResource(R.string.interest_paid, loanAmountPaid.format(baseCurrency), baseCurrency),
style = UI.typo.nB2.style(
color = Gray,
fontWeight = FontWeight.ExtraBold
Expand All @@ -572,7 +573,7 @@ private fun LoanInfoCard(
.fillMaxWidth()
.padding(horizontal = 16.dp)
.align(Alignment.CenterHorizontally),
text = "Add record",
text = stringResource(R.string.add_record),
shadowAlpha = 0.1f,
backgroundGradient = Gradient.solid(contrastColor),
textStyle = UI.typo.b2.style(
Expand Down Expand Up @@ -671,7 +672,7 @@ private fun LoanRecordItem(
backgroundGradient = Gradient.solid(loan.color.toComposeColor()),
hasGlow = false,
iconTint = textIconColor,
text = "Interest",
text = stringResource(R.string.interest),
iconStart = getCustomIconIdS(
iconName = "currency",
defaultIcon = R.drawable.ic_currency
Expand Down Expand Up @@ -754,7 +755,7 @@ private fun NoLoanRecordsEmptyState() {
Spacer(Modifier.height(24.dp))

Text(
text = "No records",
text = stringResource(R.string.no_records),
style = UI.typo.b1.style(
color = Gray,
fontWeight = FontWeight.ExtraBold
Expand All @@ -765,7 +766,7 @@ private fun NoLoanRecordsEmptyState() {

Text(
modifier = Modifier.padding(horizontal = 32.dp),
text = "You don't have any records for this loan. Tap \"Add record\" to create one.",
text = stringResource(R.string.no_records_for_the_loan),
style = UI.typo.b2.style(
color = Gray,
fontWeight = FontWeight.Medium,
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,14 @@
<string name="add_loan">Add loan</string>
<string name="no_loans">No loans</string>
<string name="no_loans_description">You don\'t have any loans.\nTap the \"+ Add loan\" to add one.</string>
<string name="confirm_loan_deletion_description">Note: Deleting this loan will remove it permanently and delete all associated loan records with it.</string>
<string name="confirm_account_loan_change">Please wait, re-calculating all loan records</string>
<string name="paid">Paid</string>
<string name="left_to_pay">%1$s %2$s left</string>
<string name="loan_interest">Loan Interest</string>
<string name="interest_paid">%1$s %2$s paid</string>
<string name="add_record">Add record</string>
<string name="interest">Interest</string>
<string name="no_records">No records</string>
<string name="no_records_for_the_loan">You don\'t have any records for this loan. Tap "Add record" to create one.</string>
</resources>

0 comments on commit fbf8770

Please sign in to comment.