Weight button, auto list update, better time formatting

This commit is contained in:
2024-11-04 23:03:05 +01:00
parent aaa78139d6
commit 8e8966e906
8 changed files with 147 additions and 16 deletions

View File

@ -18,15 +18,34 @@
android:text="@string/log_an_event"
android:gravity="center_horizontal"/>
<TextView
android:id="@+id/button_bottle"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="@drawable/button_background"
android:gravity="center_horizontal"
android:textSize="50sp"
android:text="@string/event_bottle_type"/>
android:orientation="horizontal">
<TextView
android:id="@+id/button_bottle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:layout_margin="10dp"
android:background="@drawable/button_background"
android:gravity="center_horizontal"
android:textSize="50sp"
android:text="@string/event_bottle_type"/>
<TextView
android:id="@+id/button_scale"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="10dp"
android:background="@drawable/button_background"
android:gravity="center_horizontal"
android:textSize="50sp"
android:text="@string/event_scale_type"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"

View File

@ -0,0 +1,21 @@
<?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">
<EditText
android:id="@+id/dialog_number_edittext"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:inputType="number"
android:hint="0"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="g"/>
</LinearLayout>

View File

@ -4,10 +4,16 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center_horizontal">
android:gravity="center">
<NumberPicker
android:id="@+id/dialog_number_picker"
android:layout_width="wrap_content"
android:layout_width="150dp"
android:layout_height="wrap_content"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="ml"/>
</LinearLayout>

View File

@ -25,6 +25,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_horizontal"
android:text="Qty"/>
<TextView
@ -32,6 +33,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:gravity="center_horizontal"
android:textStyle="bold"
android:text="Time"/>

View File

@ -7,7 +7,11 @@
<string name="log_bottle_dialog_title">Biberon</string>
<string name="log_bottle_dialog_description">Inserisci la quantità contenuta nel biberon</string>
<string name="log_weight_dialog_title">Pesata</string>
<string name="log_weight_dialog_description">Inserisci il peso rilevato</string>
<string name="event_bottle_type">🍼</string>
<string name="event_scale_type">⚖️</string>
<string name="event_breastfeeding_left_type">🤱 ←</string>
<string name="event_breastfeeding_both_type">🤱 ↔</string>
<string name="event_breastfeeding_right_type">🤱 →</string>
@ -16,6 +20,7 @@
<string name="event_unknown_type">-</string>
<string name="event_bottle_desc">Biberon</string>
<string name="event_scale_desc">Pesata</string>
<string name="event_breastfeeding_left_desc">Allatt. al seno (sx)</string>
<string name="event_breastfeeding_both_desc">Allatt. al seno</string>
<string name="event_breastfeeding_right_desc">Allatt. al seno (dx)</string>
@ -24,5 +29,11 @@
<string name="event_unknown_desc"></string>
<string name="toast_event_added">Evento aggiunto!</string>
<string name="toast_integer_error">Valore non valido. Inserire un numero intero.</string>
<string name="now">adesso</string>
<string name="hour_ago">ora</string>
<string name="hours_ago">ore</string>
<string name="minute_ago">min</string>
<string name="minutes_ago">min</string>
</resources>