3 Commits

Author SHA1 Message Date
a90f939428 activity_setting: fine tune layout style 2025-10-26 13:54:17 +01:00
28674e2acc add signature setting
For multiple users it helps to
keep track about who did what.
2025-10-26 13:54:17 +01:00
2d5a56188d DateUtils: move event details formatting to DateUtils
Also do not display seconds, because it is not
meaningful and is not selected in date picker.
2025-10-26 13:54:17 +01:00
5 changed files with 7 additions and 9 deletions

View File

@@ -12,8 +12,8 @@ android {
applicationId = "it.danieleverducci.lunatracker" applicationId = "it.danieleverducci.lunatracker"
minSdk = 21 minSdk = 21
targetSdk = 34 targetSdk = 34
versionCode = 7 versionCode = 5
versionName = "0.9" versionName = "0.7"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
} }

View File

@@ -275,7 +275,7 @@ class MainActivity : AppCompatActivity() {
d.setPositiveButton(android.R.string.ok) { dialogInterface, i -> d.setPositiveButton(android.R.string.ok) { dialogInterface, i ->
val pos = spinner.selectedItemPosition val pos = spinner.selectedItemPosition
logEvent(LunaEvent(LunaEvent.TYPE_PUKE, pos + 1)) logEvent(LunaEvent(LunaEvent.TYPE_PUKE, pos))
} }
d.setNegativeButton(android.R.string.cancel) { dialogInterface, i -> dialogInterface.dismiss() } d.setNegativeButton(android.R.string.cancel) { dialogInterface, i -> dialogInterface.dismiss() }
val alertDialog = d.create() val alertDialog = d.create()

View File

@@ -114,7 +114,7 @@ class DateUtils {
fun formatDateTime(unixTime: Long): String { fun formatDateTime(unixTime: Long): String {
val date = Date(unixTime * 1000) val date = Date(unixTime * 1000)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
val dateFormat = android.icu.text.DateFormat.getDateTimeInstance(android.icu.text.DateFormat.DEFAULT, android.icu.text.DateFormat.SHORT) val dateFormat = android.icu.text.DateFormat.getDateTimeInstance(android.icu.text.DateFormat.RELATIVE_SHORT, android.icu.text.DateFormat.SHORT)
return dateFormat.format(date) return dateFormat.format(date)
} else { } else {
// fallback // fallback

View File

@@ -67,7 +67,7 @@ class NumericUtils (val context: Context) {
LunaEvent.TYPE_TEMPERATURE -> LunaEvent.TYPE_TEMPERATURE ->
(item.quantity / 10.0f).toString() (item.quantity / 10.0f).toString()
LunaEvent.TYPE_PUKE -> LunaEvent.TYPE_PUKE ->
context.resources.getStringArray(R.array.AmountLabels)[item.quantity - 1] context.resources.getStringArray(R.array.AmountLabels)[item.quantity]
else -> else ->
item.quantity item.quantity
}) })

View File

@@ -4,9 +4,7 @@
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:paddingTop="20dp" android:padding="20dp">
android:paddingBottom="10dp"
android:paddingHorizontal="20dp">
<TextView <TextView
android:id="@+id/dialog_event_detail_type_emoji" android:id="@+id/dialog_event_detail_type_emoji"