diff options
Diffstat (limited to 'androidApp/src/main/res/layout/unit_details_reports.xml')
-rw-r--r-- | androidApp/src/main/res/layout/unit_details_reports.xml | 413 |
1 files changed, 258 insertions, 155 deletions
diff --git a/androidApp/src/main/res/layout/unit_details_reports.xml b/androidApp/src/main/res/layout/unit_details_reports.xml index 903c2c3..c29e4b0 100644 --- a/androidApp/src/main/res/layout/unit_details_reports.xml +++ b/androidApp/src/main/res/layout/unit_details_reports.xml @@ -1,194 +1,297 @@ <?xml version="1.0" encoding="utf-8"?> -<androidx.constraintlayout.widget.ConstraintLayout +<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" - android:layout_height="match_parent"> - - <androidx.fragment.app.FragmentContainerView - android:id="@+id/reportsMapContainer" - android:layout_width="0dp" - android:layout_height="0dp" - android:layout_marginBottom="@dimen/margin" - app:layout_constraintBottom_toTopOf="@id/periodSection" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - android:visibility="gone"/> - - <ScrollView - android:id="@+id/eventsScroll" - android:layout_width="0dp" - android:layout_height="0dp" - android:layout_marginBottom="@dimen/margin" - android:visibility="gone" - app:layout_constraintBottom_toTopOf="@id/periodSection" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent"> - - <HorizontalScrollView - android:layout_width="match_parent" - android:layout_height="wrap_content"> + android:layout_height="match_parent" + xmlns:tools="http://schemas.android.com/tools"> - <TableLayout - android:id="@+id/eventsTable" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:isScrollContainer="true" - android:scrollbars="vertical" - android:stretchColumns="*"> + <!-- Main content --> + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="match_parent"> - <TableRow android:background="@color/colorPrimary"> + <androidx.fragment.app.FragmentContainerView + android:id="@+id/reportsMapContainer" + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_marginBottom="@dimen/margin" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + android:visibility="gone"/> + + <ScrollView + android:id="@+id/eventsScroll" + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_marginBottom="@dimen/bottom_sheet_peak" + android:visibility="visible" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent"> + + <HorizontalScrollView + android:layout_width="match_parent" + android:layout_height="wrap_content"> - <TextView - android:paddingHorizontal="@dimen/padding" - android:text="@string/table_datetime" - android:textColor="@color/background" - android:padding="@dimen/padding" /> + <TableLayout + android:id="@+id/eventsTable" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:isScrollContainer="true" + android:scrollbars="vertical" + android:stretchColumns="*"> - <TextView - android:paddingHorizontal="@dimen/padding" - android:text="@string/table_event" - android:textColor="@color/background" - android:padding="@dimen/padding" /> + <TableRow android:background="@color/colorPrimary"> - <TextView - android:paddingHorizontal="@dimen/padding" - android:text="@string/table_geofence" - android:textColor="@color/background" - android:padding="@dimen/padding" /> + <TextView + android:paddingHorizontal="@dimen/padding" + android:text="@string/table_datetime" + android:textColor="@color/background" + android:padding="@dimen/padding" /> - <TextView - android:paddingHorizontal="@dimen/padding" - android:text="@string/table_address" - android:textColor="@color/background" - android:padding="@dimen/padding" /> + <TextView + android:paddingHorizontal="@dimen/padding" + android:text="@string/table_event" + android:textColor="@color/background" + android:padding="@dimen/padding" /> - </TableRow> + <TextView + android:paddingHorizontal="@dimen/padding" + android:text="@string/table_geofence" + android:textColor="@color/background" + android:padding="@dimen/padding" /> - </TableLayout> + <TextView + android:paddingHorizontal="@dimen/padding" + android:text="@string/table_address" + android:textColor="@color/background" + android:padding="@dimen/padding" /> - </HorizontalScrollView> + </TableRow> - </ScrollView> + </TableLayout> - <LinearLayout - android:id="@+id/periodSection" + </HorizontalScrollView> + + </ScrollView> + + <include + android:id="@+id/reportLoading" + android:layout_width="0dp" + android:layout_height="0dp" + layout="@layout/loading_indicator" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + android:visibility="gone"/> + + </androidx.constraintlayout.widget.ConstraintLayout> + + <!-- Bottom sheet --> + <com.google.android.material.card.MaterialCardView + android:id="@+id/bottomSheet" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_margin="@dimen/margin" + app:contentPadding="@dimen/card_padding" android:orientation="vertical" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent"> + app:behavior_hideable="false" + app:behavior_peekHeight="@dimen/bottom_sheet_peak" + app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior" + style="@style/BottomSheetCardStyle"> <LinearLayout + android:id="@+id/periodSection" android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="horizontal"> + android:orientation="vertical"> - <TextView - android:layout_width="0dp" - android:layout_height="match_parent" - android:layout_weight="1" - android:gravity="center_vertical" - android:text="@string/period" - android:textColor="@color/colorPrimaryDark" - android:textSize="22sp" /> - - <com.google.android.material.button.MaterialButton - android:id="@+id/periodButton" - android:layout_width="wrap_content" + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginEnd="@dimen/fields_spacing" - android:text="@string/select_period" - android:textColor="@color/colorPrimaryDark" - app:backgroundTint="@color/darkBackground" /> + android:layout_marginBottom="@dimen/margin" + android:orientation="horizontal"> - </LinearLayout> + <!-- Report type --> + <com.addisonelliott.segmentedbutton.SegmentedButtonGroup + android:id="@+id/reportType" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginEnd="@dimen/fields_spacing" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toStartOf="@id/toggleSheet" + app:borderWidth="1dp" + app:dividerPadding="10dp" + app:dividerWidth="1dp" + app:position="0" + app:radius="30dp" + app:ripple="true" + app:selectedBackground="@color/colorPrimary"> - <com.addisonelliott.segmentedbutton.SegmentedButtonGroup - android:id="@+id/reportType" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginTop="@dimen/margin" - app:borderWidth="1dp" - app:dividerPadding="10dp" - app:dividerWidth="1dp" - app:position="0" - app:radius="30dp" - app:ripple="true" - app:selectedBackground="@color/colorPrimary"> - - <com.addisonelliott.segmentedbutton.SegmentedButton - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:padding="10dp" - app:drawableGravity="top" - app:selectedTextColor="@color/darkBackground" - app:text="@string/positions" - app:textColor="@color/colorPrimaryDark" /> - - <com.addisonelliott.segmentedbutton.SegmentedButton - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:padding="10dp" - app:drawableGravity="top" - app:selectedTextColor="@color/darkBackground" - app:text="@string/events" - app:textColor="@color/colorPrimaryDark" /> - - <com.addisonelliott.segmentedbutton.SegmentedButton - android:layout_width="0dp" + <com.addisonelliott.segmentedbutton.SegmentedButton + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:padding="10dp" + app:drawableGravity="top" + app:selectedTextColor="@color/darkBackground" + app:text="@string/positions" + app:textColor="@color/colorPrimaryDark" /> + + <com.addisonelliott.segmentedbutton.SegmentedButton + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:padding="10dp" + app:drawableGravity="top" + app:selectedTextColor="@color/darkBackground" + app:text="@string/events" + app:textColor="@color/colorPrimaryDark" /> + + <com.addisonelliott.segmentedbutton.SegmentedButton + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:padding="10dp" + app:drawableGravity="top" + app:selectedTextColor="@color/darkBackground" + app:text="@string/stops" + app:textColor="@color/colorPrimaryDark" /> + + </com.addisonelliott.segmentedbutton.SegmentedButtonGroup> + + <ImageButton + android:id="@+id/toggleSheet" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:src="@drawable/icon_down" + android:contentDescription="@string/shared_slide_down" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + android:background="?selectableItemBackgroundBorderless" /> + + </androidx.constraintlayout.widget.ConstraintLayout> + + <!-- Report period --> + <LinearLayout + android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_weight="1" - android:padding="10dp" - app:drawableGravity="top" - app:selectedTextColor="@color/darkBackground" - app:text="@string/stops" - app:textColor="@color/colorPrimaryDark" /> + android:orientation="horizontal"> - </com.addisonelliott.segmentedbutton.SegmentedButtonGroup> + <TextView + android:layout_width="0dp" + android:layout_height="match_parent" + android:layout_weight="1" + android:gravity="center_vertical" + android:text="@string/period" + android:textColor="@color/colorPrimaryDark" + android:textSize="22sp" /> - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal" - android:layout_marginTop="@dimen/margin"> + <com.google.android.material.button.MaterialButton + android:id="@+id/periodButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/select_period" + android:textColor="@color/colorPrimaryDark" + app:backgroundTint="@color/darkBackground" + style="@style/Widget.AppCompat.Button.Small" /> + </LinearLayout> - <com.google.android.material.button.MaterialButton - android:id="@+id/exportButton" + <!-- Custom period ranges --> + <LinearLayout + android:id="@+id/rangeLayout" android:layout_width="match_parent" android:layout_height="wrap_content" - android:text="@string/export_report" - android:layout_weight="1" - android:layout_marginEnd="@dimen/fields_spacing" - style="?android:buttonStyleSmall"/> + android:gravity="center_vertical" + android:weightSum="2" + android:orientation="horizontal"> + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/fromInputLayout" + style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginEnd="@dimen/fields_spacing" + android:hint="@string/period_from" + android:layout_weight="1"> + + <com.google.android.material.textfield.TextInputEditText + android:id="@+id/fromEditText" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textSize="@dimen/datetime_field" + android:inputType="none" + android:clickable="false" + android:focusable="false" + tools:text="2022-04-11 00:00" + /> - <com.google.android.material.button.MaterialButton - android:id="@+id/shareButton" + </com.google.android.material.textfield.TextInputLayout> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/period_separator" /> + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/toInputLayout" + style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:hint="@string/period_to" + android:layout_marginStart="@dimen/fields_spacing" + android:layout_weight="1"> + + <com.google.android.material.textfield.TextInputEditText + android:id="@+id/toEditText" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textSize="@dimen/datetime_field" + android:inputType="none" + android:clickable="false" + android:focusable="false" + tools:text="2022-04-11 00:39" + /> + + </com.google.android.material.textfield.TextInputLayout> + + </LinearLayout> + + <!-- Action buttons --> + <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_weight="1" - android:text="@string/share_report" - style="?android:buttonStyleSmall"/> + android:orientation="horizontal" + android:layout_marginTop="@dimen/margin"> - </LinearLayout> + <com.google.android.material.button.MaterialButton + android:id="@+id/exportButton" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/export_report" + android:layout_weight="1" + android:layout_marginEnd="@dimen/fields_spacing" + style="?android:buttonStyleSmall"/> + + <com.google.android.material.button.MaterialButton + android:id="@+id/shareButton" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_weight="1" + android:text="@string/share_report" + style="?android:buttonStyleSmall"/> - </LinearLayout> + </LinearLayout> + + </LinearLayout> - <include - android:id="@+id/reportLoading" - android:layout_width="0dp" - android:layout_height="0dp" - layout="@layout/loading_indicator" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintBottom_toTopOf="@id/periodSection" - android:visibility="gone"/> + </com.google.android.material.card.MaterialCardView> -</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file +</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file |