3 Commits

Author SHA1 Message Date
71cf754ac8 activity_setting: fine tune layout style 2025-10-26 20:23:32 +01:00
a200e40816 add signature setting
For multiple users it helps to
keep track about who did what.
2025-10-26 20:23:29 +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
4 changed files with 6 additions and 6 deletions

View File

@@ -12,8 +12,8 @@ android {
applicationId = "it.danieleverducci.lunatracker"
minSdk = 21
targetSdk = 34
versionCode = 7
versionName = "0.9"
versionCode = 5
versionName = "0.7"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
@@ -60,4 +60,4 @@ dependencies {
androidTestImplementation(libs.androidx.ui.test.junit4)
debugImplementation(libs.androidx.ui.tooling)
debugImplementation(libs.androidx.ui.test.manifest)
}
}

View File

@@ -275,7 +275,7 @@ class MainActivity : AppCompatActivity() {
d.setPositiveButton(android.R.string.ok) { dialogInterface, i ->
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() }
val alertDialog = d.create()

View File

@@ -114,7 +114,7 @@ class DateUtils {
fun formatDateTime(unixTime: Long): String {
val date = Date(unixTime * 1000)
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)
} else {
// fallback

View File

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