summaryrefslogtreecommitdiff
path: root/android-app/app
diff options
context:
space:
mode:
Diffstat (limited to 'android-app/app')
-rw-r--r--android-app/app/src/main/kotlin/org/terst/nav/MainActivity.kt14
-rw-r--r--android-app/app/src/main/res/layout/layout_instruments_sheet.xml54
2 files changed, 66 insertions, 2 deletions
diff --git a/android-app/app/src/main/kotlin/org/terst/nav/MainActivity.kt b/android-app/app/src/main/kotlin/org/terst/nav/MainActivity.kt
index 0f2eb91..3f09309 100644
--- a/android-app/app/src/main/kotlin/org/terst/nav/MainActivity.kt
+++ b/android-app/app/src/main/kotlin/org/terst/nav/MainActivity.kt
@@ -93,6 +93,14 @@ class MainActivity : AppCompatActivity(), SafetyFragment.SafetyListener {
setupBottomNavigation()
setupHandlers()
setupMap()
+
+ findViewById<MaterialButton>(R.id.btn_nav_pretrip).setOnClickListener {
+ showReport(org.terst.nav.tripreport.PreTripReportFragment())
+ }
+
+ findViewById<MaterialButton>(R.id.btn_nav_tripreport).setOnClickListener {
+ showReport(org.terst.nav.tripreport.TripReportFragment())
+ }
fabRecordTrack.setOnClickListener {
if (viewModel.isRecording.value) viewModel.stopTrack() else viewModel.startTrack()
@@ -162,6 +170,12 @@ class MainActivity : AppCompatActivity(), SafetyFragment.SafetyListener {
fragmentContainer.visibility = View.GONE
}
+ private fun showReport(fragment: androidx.fragment.app.Fragment) {
+ bottomSheetBehavior.isHideable = true
+ bottomSheetBehavior.state = BottomSheetBehavior.STATE_HIDDEN
+ showOverlay(fragment)
+ }
+
override fun onActivateMob() {
lifecycleScope.launch {
LocationService.locationFlow.firstOrNull()?.let { gpsData ->
diff --git a/android-app/app/src/main/res/layout/layout_instruments_sheet.xml b/android-app/app/src/main/res/layout/layout_instruments_sheet.xml
index a6b74b0..16410c0 100644
--- a/android-app/app/src/main/res/layout/layout_instruments_sheet.xml
+++ b/android-app/app/src/main/res/layout/layout_instruments_sheet.xml
@@ -159,8 +159,7 @@
android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@id/label_conditions"
app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintBottom_toBottomOf="parent">
+ app:layout_constraintEnd_toEndOf="parent">
<LinearLayout
android:layout_width="0dp"
@@ -197,4 +196,55 @@
</LinearLayout>
+ <!-- Reports Section -->
+ <View
+ android:id="@+id/reports_divider"
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:background="@color/md_theme_outline"
+ android:layout_marginTop="20dp"
+ app:layout_constraintTop_toBottomOf="@id/conditions_row"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintEnd_toEndOf="parent" />
+
+ <TextView
+ android:id="@+id/label_reports"
+ style="@style/InstrumentLabel"
+ android:text="TRIP REPORTS &amp; PLANNING"
+ android:layout_marginTop="12dp"
+ app:layout_constraintTop_toBottomOf="@id/reports_divider"
+ app:layout_constraintStart_toStartOf="parent" />
+
+ <LinearLayout
+ android:id="@+id/reports_row"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:layout_marginTop="12dp"
+ app:layout_constraintTop_toBottomOf="@id/label_reports"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintBottom_toBottomOf="parent">
+
+ <com.google.android.material.button.MaterialButton
+ android:id="@+id/btn_nav_pretrip"
+ style="@style/Widget.Material3.Button.TonalButton"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:text="PRE-TRIP PLAN"
+ android:layout_marginEnd="8dp"
+ android:textSize="12sp" />
+
+ <com.google.android.material.button.MaterialButton
+ android:id="@+id/btn_nav_tripreport"
+ style="@style/Widget.Material3.Button.TonalButton"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:text="GENERATE REPORT"
+ android:textSize="12sp" />
+
+ </LinearLayout>
+
</androidx.constraintlayout.widget.ConstraintLayout>