diff options
author | Isidro Henoch <imhenoch@protonmail.com> | 2022-01-03 13:55:58 -0600 |
---|---|---|
committer | Isidro Henoch <imhenoch@protonmail.com> | 2022-01-03 13:55:58 -0600 |
commit | 35b24e898717bffcb76d42528b453d949e663ba9 (patch) | |
tree | 34aa54fc226e3cde4544dad822f5d6b735d38f4e /androidApp/src/main/res | |
parent | 7b57080cc0badb472c7f8184d01c9a258ac08a89 (diff) | |
parent | 0650761584d66991fe5dd5114939ab14ec70feb0 (diff) | |
download | etbsa-trackermap-mobile-35b24e898717bffcb76d42528b453d949e663ba9.tar.gz etbsa-trackermap-mobile-35b24e898717bffcb76d42528b453d949e663ba9.tar.bz2 etbsa-trackermap-mobile-35b24e898717bffcb76d42528b453d949e663ba9.zip |
Merge branch 'reports'
# Conflicts:
# androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt
# androidApp/src/main/res/values/strings.xml
Diffstat (limited to 'androidApp/src/main/res')
-rw-r--r-- | androidApp/src/main/res/layout/details_activity.xml | 14 | ||||
-rw-r--r-- | androidApp/src/main/res/layout/unit_details_commands.xml | 29 | ||||
-rw-r--r-- | androidApp/src/main/res/layout/unit_details_reports.xml | 136 | ||||
-rw-r--r-- | androidApp/src/main/res/menu/report_period_options.xml | 17 | ||||
-rw-r--r-- | androidApp/src/main/res/values/dimen.xml | 1 | ||||
-rw-r--r-- | androidApp/src/main/res/values/strings.xml | 17 |
6 files changed, 188 insertions, 26 deletions
diff --git a/androidApp/src/main/res/layout/details_activity.xml b/androidApp/src/main/res/layout/details_activity.xml index 00ebdbf..f79ea69 100644 --- a/androidApp/src/main/res/layout/details_activity.xml +++ b/androidApp/src/main/res/layout/details_activity.xml @@ -1,25 +1,25 @@ <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout 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" - xmlns:app="http://schemas.android.com/apk/res-auto"> + android:layout_height="match_parent"> <com.google.android.material.tabs.TabLayout android:id="@+id/detailsTabs" android:layout_width="match_parent" android:layout_height="wrap_content" + app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintEnd_toEndOf="parent"/> + app:layout_constraintTop_toTopOf="parent" /> <androidx.viewpager2.widget.ViewPager2 android:id="@+id/detailsPager" android:layout_width="match_parent" android:layout_height="0dp" - app:layout_constraintTop_toBottomOf="@id/detailsTabs" - app:layout_constraintStart_toStartOf="parent" + app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintBottom_toBottomOf="parent"/> + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/detailsTabs" /> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file diff --git a/androidApp/src/main/res/layout/unit_details_commands.xml b/androidApp/src/main/res/layout/unit_details_commands.xml index dfd6516..e98b113 100644 --- a/androidApp/src/main/res/layout/unit_details_commands.xml +++ b/androidApp/src/main/res/layout/unit_details_commands.xml @@ -1,19 +1,30 @@ <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout 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:layout_width="match_parent" + android:layout_height="match_parent"> + + <ListView + android:id="@+id/commandsList" + android:layout_width="0dp" + android:layout_height="0dp" + android:choiceMode="singleChoice" + android:listSelector="@color/darkBackground" + app:layout_constraintBottom_toTopOf="@id/sendCommandButton" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> - <TextView - android:id="@+id/unitCommandsText" + <com.google.android.material.button.MaterialButton + android:id="@+id/sendCommandButton" android:layout_width="wrap_content" android:layout_height="wrap_content" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent" + android:layout_marginBottom="@dimen/margin" + android:text="@string/send_command" app:layout_constraintBottom_toBottomOf="parent" - tools:text="COMMANDS"/> + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/commandsList" /> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file diff --git a/androidApp/src/main/res/layout/unit_details_reports.xml b/androidApp/src/main/res/layout/unit_details_reports.xml index f1b52e3..cf3c7b2 100644 --- a/androidApp/src/main/res/layout/unit_details_reports.xml +++ b/androidApp/src/main/res/layout/unit_details_reports.xml @@ -1,19 +1,137 @@ <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout 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:layout_width="match_parent" + android:layout_height="match_parent"> - <TextView - android:id="@+id/unitReportsText" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - app:layout_constraintTop_toTopOf="parent" + <View + android:id="@+id/reportMap" + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_margin="@dimen/margin" + android:background="@color/darkBackground" + android:visibility="gone" + app:layout_constraintBottom_toTopOf="@id/periodSection" + app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <ScrollView + android:id="@+id/eventsScroll" + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_margin="@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"> + + <TableLayout + android:id="@+id/eventsTable" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:isScrollContainer="true" + android:scrollbars="vertical" + android:stretchColumns="*"> + + <TableRow android:background="@color/colorPrimary"> + + <TextView + android:paddingHorizontal="@dimen/padding" + android:text="@string/table_event" + android:textColor="@color/background" /> + + <TextView + android:paddingHorizontal="@dimen/padding" + android:text="@string/table_datetime" + android:textColor="@color/background" /> + + </TableRow> + + </TableLayout> + </ScrollView> + + <LinearLayout + android:id="@+id/periodSection" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="@dimen/margin" + android:orientation="vertical" app:layout_constraintBottom_toBottomOf="parent" - tools:text="REPORTS"/> + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal"> + + <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" + android:layout_height="wrap_content" + android:text="@string/select_period" + android:textColor="@color/colorPrimaryDark" + app:backgroundTint="@color/darkBackground" /> + + </LinearLayout> + + <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" + 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> + + </LinearLayout> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file diff --git a/androidApp/src/main/res/menu/report_period_options.xml b/androidApp/src/main/res/menu/report_period_options.xml new file mode 100644 index 0000000..cf54ec3 --- /dev/null +++ b/androidApp/src/main/res/menu/report_period_options.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu + xmlns:android="http://schemas.android.com/apk/res/android"> + + <item + android:id="@+id/dayOption" + android:title="@string/day_period" /> + + <item + android:id="@+id/weekOption" + android:title="@string/week_period" /> + + <item + android:id="@+id/monthOption" + android:title="@string/month_period" /> + +</menu>
\ No newline at end of file diff --git a/androidApp/src/main/res/values/dimen.xml b/androidApp/src/main/res/values/dimen.xml index 6ce7887..18fd0eb 100644 --- a/androidApp/src/main/res/values/dimen.xml +++ b/androidApp/src/main/res/values/dimen.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <resources> <dimen name="padding">8dp</dimen> + <dimen name="margin">16dp</dimen> <!-- CardView --> <dimen name="card_border_radius">20dp</dimen> diff --git a/androidApp/src/main/res/values/strings.xml b/androidApp/src/main/res/values/strings.xml index d68c68c..453bc16 100644 --- a/androidApp/src/main/res/values/strings.xml +++ b/androidApp/src/main/res/values/strings.xml @@ -24,11 +24,26 @@ <string name="unit_speed_format">%1$d km/h</string> + <!-- Details --> <string name="unit_details">Details</string> <string name="unit_reports">Reports</string> <string name="unit_commands">Commands</string> <string name="units_search">Type to search</string> + <!-- Commads --> <string name="key">Key</string> <string name="value">Value</string> -</resources>
\ No newline at end of file + <string name="send_command">Send Command</string> + + <!-- Reports --> + <string name="positions">Positions</string> + <string name="events">Events</string> + <string name="stops">Stops</string> + <string name="day_period">Day</string> + <string name="week_period">Week</string> + <string name="month_period">Month</string> + <string name="period">Period</string> + <string name="select_period">Select</string> + <string name="table_event">Event</string> + <string name="table_datetime">Datetime</string> +</resources> |