From 1e7669f62dbed715a04c079f6c223be3849c7930 Mon Sep 17 00:00:00 2001
From: DennisBauer <37552885+DennisBauer@users.noreply.github.com>
Date: Sat, 7 Oct 2023 19:25:38 +0200
Subject: [PATCH] Improve displaying long expenses
When expenses have a non monthly recurrence and have a long name
the price substring was cutting the long name even though that could
be prevented.
---
.../expensetracker/ui/RecurringExpenseOverview.kt | 11 +++++++++++
app/src/main/res/values-de/strings.xml | 8 ++++----
app/src/main/res/values/strings.xml | 8 ++++----
3 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/app/src/main/java/de/dbauer/expensetracker/ui/RecurringExpenseOverview.kt b/app/src/main/java/de/dbauer/expensetracker/ui/RecurringExpenseOverview.kt
index 87105c6..fad8169 100644
--- a/app/src/main/java/de/dbauer/expensetracker/ui/RecurringExpenseOverview.kt
+++ b/app/src/main/java/de/dbauer/expensetracker/ui/RecurringExpenseOverview.kt
@@ -19,6 +19,7 @@ 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.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
@@ -166,6 +167,7 @@ private fun RecurringExpense(
"${recurringExpenseData.everyXRecurrence} " +
stringResource(id = recurringExpenseData.recurrence.stringRes),
style = MaterialTheme.typography.bodyLarge,
+ textAlign = TextAlign.End,
)
}
}
@@ -213,6 +215,15 @@ private fun RecurringExpenseOverviewPreview() {
everyXRecurrence = 1,
recurrence = Recurrence.Monthly,
),
+ RecurringExpenseData(
+ id = 3,
+ name = "Yearly Test Subscription",
+ description = "Test Description with another very long name",
+ price = 72f,
+ monthlyPrice = 6f,
+ everyXRecurrence = 1,
+ recurrence = Recurrence.Yearly,
+ ),
),
onItemClicked = {},
)
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index 5574652..c01e204 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -21,10 +21,10 @@
z.B. Netflix
Preis
Abrechnungszeitraum
- Tag(e)
- Woche(n)
- Monat(e)
- Jahr(e)
+ T
+ W
+ M
+ J
Einstellungen
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index dab6c7e..a09ffcd 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -23,10 +23,10 @@
e.g. Netflix
Price
Recurrence
- Day(s)
- Week(s)
- Month(s)
- Year(s)
+ D
+ W
+ M
+ Y
Settings