Compare commits

..

8 Commits

Author SHA1 Message Date
mwarning 50baa76d35 activity_setting: fine tune layout style 2025-10-26 13:50:28 +01:00
mwarning 31531b0e7c add signature setting
For multiple users it helps to
keep track about who did what.
2025-10-26 13:50:28 +01:00
mwarning 7fdd4afa06 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:47:54 +01:00
mwarning 0633b4d084 add bath event type 2025-09-29 17:50:06 +02:00
mwarning 0a9821aef7 add no-breastfeeding help text 2025-09-29 17:50:02 +02:00
mwarning 01f24694b5 more_events_popup: move enema to bottom and adjust padding
Enemas are usually are rare thing. Let's
move it to the bottom. Also adjust padding
to have more space to display all items.
2025-09-29 09:33:10 +02:00
mwarning 693405cadb simplify puke event 2025-09-29 09:33:07 +02:00
mwarning 730ef95220 add complex puke event 2025-09-29 04:56:14 +02:00
8 changed files with 5 additions and 61 deletions
+2 -2
View File
@@ -12,8 +12,8 @@ android {
applicationId = "it.danieleverducci.lunatracker"
minSdk = 21
targetSdk = 34
versionCode = 6
versionName = "0.8"
versionCode = 5
versionName = "0.7"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
@@ -262,26 +262,6 @@ class MainActivity : AppCompatActivity() {
alertDialog.show()
}
fun askPukeValue() {
val d = AlertDialog.Builder(this)
val dialogView = layoutInflater.inflate(R.layout.puke_dialog, null)
d.setTitle(R.string.log_puke_dialog_title)
d.setMessage(R.string.log_puke_dialog_description)
d.setView(dialogView)
val spinner = dialogView.findViewById<Spinner>(R.id.dialog_puke_value)
spinner.adapter = ArrayAdapter.createFromResource(this, R.array.AmountLabels, android.R.layout.simple_spinner_dropdown_item)
spinner.setSelection(1)
d.setPositiveButton(android.R.string.ok) { dialogInterface, i ->
val pos = spinner.selectedItemPosition
logEvent(LunaEvent(LunaEvent.TYPE_PUKE, pos + 1))
}
d.setNegativeButton(android.R.string.cancel) { dialogInterface, i -> dialogInterface.dismiss() }
val alertDialog = d.create()
alertDialog.show()
}
fun askNotes(lunaEvent: LunaEvent) {
val d = AlertDialog.Builder(this)
val dialogView = layoutInflater.inflate(R.layout.dialog_notes, null)
@@ -817,7 +797,7 @@ class MainActivity : AppCompatActivity() {
dismiss()
})
contentView.findViewById<View>(R.id.button_puke).setOnClickListener({
askPukeValue()
logEvent(LunaEvent(LunaEvent.TYPE_PUKE))
dismiss()
})
contentView.findViewById<View>(R.id.button_colic).setOnClickListener({
+1 -1
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
-2
View File
@@ -66,8 +66,6 @@ class NumericUtils (val context: Context) {
formatted.append(when (item.type) {
LunaEvent.TYPE_TEMPERATURE ->
(item.quantity / 10.0f).toString()
LunaEvent.TYPE_PUKE ->
context.resources.getStringArray(R.array.AmountLabels)[item.quantity - 1]
else ->
item.quantity
})
@@ -4,9 +4,7 @@
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="20dp"
android:paddingBottom="10dp"
android:paddingHorizontal="20dp">
android:padding="20dp">
<TextView
android:id="@+id/dialog_event_detail_type_emoji"
-17
View File
@@ -1,17 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical">
<Spinner
android:id="@+id/dialog_puke_value"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp"/>
</LinearLayout>
-8
View File
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="AmountLabels">
<item>@string/amount_little</item>
<item>@string/amount_normal</item>
<item>@string/amount_plenty</item>
</string-array>
</resources>
-7
View File
@@ -12,9 +12,6 @@
<string name="log_temperature_dialog_title">Temperature</string>
<string name="log_temperature_dialog_description">Insert the temperature</string>
<string name="log_puke_dialog_title">Puke</string>
<string name="log_puke_dialog_description">Select the amount</string>
<string name="event_bottle_type" translatable="false">🍼</string>
<string name="event_food_type" translatable="false">🥣</string>
<string name="event_scale_type" translatable="false">⚖️</string>
@@ -75,10 +72,6 @@
<string name="year_ago">year</string>
<string name="years_ago">years</string>
<string name="amount_little">Little</string>
<string name="amount_normal">Normal</string>
<string name="amount_plenty">Plenty</string>
<string name="no_connection">No connection</string>
<string name="no_connection_explain">Unable to reach WebDAV service</string>
<string name="no_connection_go_to_settings">Settings</string>