AggregatedStatisticsActivity: added filter option (by category, start and/or end date).

Fixes #1039.
This commit is contained in:
Román Ginés
2021-12-15 23:22:13 +01:00
committed by Román Martínez
parent 4d333bbafa
commit b4ce99440a
20 changed files with 940 additions and 18 deletions
+1
View File
@@ -16,6 +16,7 @@
style="@style/TextLarge"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
android:gravity="center_horizontal|center_vertical"
android:text="@string/aggregated_stats_empty_message" />
@@ -0,0 +1,106 @@
<?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"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical">
<ScrollView style="@style/ScrollView.WithBottomButtons">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="8dp">
<GridLayout
android:id="@+id/filter_items"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="2"
android:orientation="horizontal"
android:padding="8dp"
android:alignmentMode="alignBounds"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@id/filter_date_from" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/filter_date_from"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/generic_from"
android:imeOptions="actionNext"
android:importantForAutofill="no"
android:padding="8dp"
app:layout_constraintTop_toBottomOf="@id/filter_items"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@id/filter_date_picker_from">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/filter_date_edit_text_from"
android:drawableStart="@drawable/ic_baseline_date_range_24"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:enabled="true"
android:focusable="false"
android:focusableInTouchMode="false"
android:inputType="date"
android:selectAllOnFocus="true" />
</com.google.android.material.textfield.TextInputLayout>
<DatePicker
android:id="@+id/filter_date_picker_from"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
tools:visibility="visible"
android:paddingLeft="8dp"
android:paddingRight="8dp"
app:layout_constraintTop_toBottomOf="@id/filter_date_from"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@id/filter_date_to" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/filter_date_to"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/generic_to"
android:imeOptions="actionNext"
android:importantForAutofill="no"
android:padding="8dp"
app:layout_constraintTop_toBottomOf="@id/filter_date_picker_from"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@id/filter_date_picker_to">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/filter_date_edit_text_to"
android:drawableStart="@drawable/ic_baseline_date_range_24"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:enabled="true"
android:focusable="false"
android:focusableInTouchMode="false"
android:inputType="date"
android:selectAllOnFocus="true" />
</com.google.android.material.textfield.TextInputLayout>
<DatePicker
android:id="@+id/filter_date_picker_to"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
tools:visibility="visible"
android:paddingLeft="8dp"
android:paddingRight="8dp"
app:layout_constraintTop_toBottomOf="@id/filter_date_to"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</LinearLayout>
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<CheckBox xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/filter_dialog_check_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
tools:text="Check Button" />