Recording without GPS: show a Snackbar to warn user that recording is not using GPS.

This commit is contained in:
Román Ginés
2022-01-26 18:37:52 +01:00
committed by Román Martínez
parent 5c06c7548f
commit 7ca6925e7d
10 changed files with 131 additions and 65 deletions
+24 -15
View File
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
@@ -17,22 +19,29 @@
android:layout_width="wrap_content"
android:layout_height="match_parent" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.google.android.material.tabs.TabLayout
android:id="@+id/track_detail_activity_tablayout"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/track_detail_activity_view_pager"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<com.google.android.material.tabs.TabLayout
android:id="@+id/track_detail_activity_tablayout"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/track_recording_coordinator_layout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/track_detail_activity_view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
+2 -2
View File
@@ -4,7 +4,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
style="@style/StatsScrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/stats_recycler_view"
@@ -14,4 +14,4 @@
app:layout_constraintStart_toEndOf="parent"
app:layout_constraintTop_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
+14 -4
View File
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
@@ -11,15 +13,23 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/track_detail_activity_view_pager"
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/track_recording_coordinator_layout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
android:layout_weight="1">
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/track_detail_activity_view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<androidx.fragment.app.FragmentContainerView
android:id="@+id/controller_fragment"
android:name="de.dennisguse.opentracks.ControllerFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
+1
View File
@@ -42,4 +42,5 @@ limitations under the License.
<color name="track_controller_background_activated">#3F0000</color>
<color name="splashscreen_background">#272727</color>
</resources>
+3
View File
@@ -244,12 +244,15 @@ limitations under the License.
<string name="generic_to">To</string>
<string name="generic_today">Today</string>
<string name="generic_yesterday">Yesterday</string>
<string name="generic_dismiss">Dismiss</string>
<!-- Gps -->
<string name="gps_starting">Starting GPS</string>
<string name="gps_wait_for_better_signal">Waiting for a better GPS signal</string>
<string name="gps_wait_for_signal">Waiting for GPS signal</string>
<string name="gps_disabled_msg">GPS disabled</string>
<string name="gps_fixed_and_ready">GPS fixed and ready</string>
<string name="gps_recording_status">%1$s: %2$s</string>
<string name="gps_recording_without_signal">OpenTracks is recording without GPS data.</string>
<!-- Image -->
<string name="image_arrow">Arrow</string>
<string name="image_marker">Marker</string>
+25
View File
@@ -333,4 +333,29 @@ limitations under the License.
<item name="cardPreventCornerOverlap">true</item>
<item name="cardUseCompatPadding">true</item>
</style>
<!-- Snackbar -->
<style name="MaterialSnackbarTheme" parent="@style/Widget.MaterialComponents.Snackbar">
<item name="materialThemeOverlay">@style/ThemeOverlay.App.Snackbar</item>
<item name="actionTextColorAlpha">1</item>
<item name="backgroundTint">@android:color/holo_red_dark</item>
</style>
<style name="MaterialSnackbarTextButtonTheme" parent="@style/Widget.MaterialComponents.Button.TextButton.Snackbar">
<item name="android:textColor">@android:color/white</item>
<item name="android:textSize">14sp</item>
</style>
<style name="MaterialSnackbarTextViewTheme" parent="@style/Widget.MaterialComponents.Snackbar.TextView">
<item name="android:textColor">@android:color/white</item>
<item name="android:textAppearance">?textAppearanceLabelMedium</item>
<item name="android:textSize">14sp</item>
</style>
<style name="ThemeOverlay.App.Snackbar" parent="">
<item name="colorSurface">@android:color/holo_red_dark</item>
<item name="colorOnSurface">@android:color/holo_red_dark</item>
</style>
</resources>
+6
View File
@@ -23,6 +23,12 @@ limitations under the License.
<item name="android:activatedBackgroundIndicator">@drawable/activated_background</item>
<item name="windowActionModeOverlay">true</item>
<!-- Snackbar -->
<item name="snackbarStyle">@style/MaterialSnackbarTheme</item>
<item name="snackbarButtonStyle">@style/MaterialSnackbarTextButtonTheme</item>
<item name="snackbarTextViewStyle">@style/MaterialSnackbarTextViewTheme</item>
</style>
<style name="SplashTheme" parent="ThemeCustom">