forked from penguin86/luna-tracker
add statistics for bottle and sleep
This commit is contained in:
55
app/src/main/res/layout/activity_statistics.xml
Normal file
55
app/src/main/res/layout/activity_statistics.xml
Normal file
@@ -0,0 +1,55 @@
|
||||
<?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:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
|
||||
<com.github.mikephil.charting.charts.HorizontalBarChart
|
||||
android:id="@+id/bar_chart"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/no_data"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"
|
||||
android:gravity="center"
|
||||
android:text="No Data"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/type_selection"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/data_selection"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/time_selection"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
@@ -10,10 +10,21 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/button_statistics"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="10dp"
|
||||
android:padding="10dp"
|
||||
android:background="@drawable/dropdown_list_item_background"
|
||||
style="@style/OverflowMenuText"
|
||||
android:text="📊 Statistics"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/button_medicine"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="10dp"
|
||||
android:padding="10dp"
|
||||
android:background="@drawable/dropdown_list_item_background"
|
||||
style="@style/OverflowMenuText"
|
||||
|
||||
8
app/src/main/res/layout/statistics_spinner_item.xml
Normal file
8
app/src/main/res/layout/statistics_spinner_item.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="20sp"
|
||||
android:gravity="center"
|
||||
android:padding="5dip" />
|
||||
@@ -6,4 +6,44 @@
|
||||
<item>@string/amount_normal</item>
|
||||
<item>@string/amount_plenty</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="StatisticsTypeLabels">
|
||||
<item>Bottle</item>
|
||||
<item>Sleep</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="StatisticsTypeValues">
|
||||
<item>BOTTLE</item>
|
||||
<item>SLEEP</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="StatisticsDataLabels">
|
||||
<item>Event</item>
|
||||
<item>Amount</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="StatisticsDataValues">
|
||||
<item>EVENT</item>
|
||||
<item>AMOUNT</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="StatisticsTimeLabels">
|
||||
<item>Day</item>
|
||||
<item>Week</item>
|
||||
<item>Month</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="StatisticsTimeValues">
|
||||
<item>DAY</item>
|
||||
<item>WEEK</item>
|
||||
<item>MONTH</item>
|
||||
</string-array>
|
||||
|
||||
<!--
|
||||
<string-array name="speakerphoneModeValues">
|
||||
<item>auto</item>
|
||||
<item>on</item>
|
||||
<item>off</item>
|
||||
</string-array>
|
||||
-->
|
||||
</resources>
|
||||
|
||||
@@ -77,6 +77,8 @@
|
||||
<string name="no_connection_go_to_settings">Settings</string>
|
||||
<string name="no_connection_retry">Retry</string>
|
||||
|
||||
<string name="statistics_title">Statistics</string>
|
||||
|
||||
<string name="settings_title">Settings</string>
|
||||
<string name="settings_signature">Signature</string>
|
||||
<string name="settings_signature_desc">Attach a signature to each event you create and for others to see. Useful if multiple people add events.</string>
|
||||
|
||||
Reference in New Issue
Block a user