From 5db3aa7ac1cd61b107266f46ff99fd32d8e2a3e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rom=C3=A1n=20Mart=C3=ADnez?= Date: Sat, 6 Mar 2021 15:12:57 +0100 Subject: [PATCH 1/4] Lowercase units for sensors and unit next to value. --- src/main/res/layout/sensor_item.xml | 7 ++++--- src/main/res/values/do_not_translate.xml | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/res/layout/sensor_item.xml b/src/main/res/layout/sensor_item.xml index 4d89022bf..b2c80e31c 100644 --- a/src/main/res/layout/sensor_item.xml +++ b/src/main/res/layout/sensor_item.xml @@ -25,8 +25,9 @@ android:id="@+id/stats_sensor_value" style="@style/StatsLargeValue" android:value="@string/value_unknown" + app:layout_constraintHorizontal_chainStyle="packed" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintEnd_toStartOf="@id/stats_sensor_unit" app:layout_constraintTop_toBottomOf="@id/stats_sensor_sensor_value" tools:text="90" /> @@ -34,8 +35,8 @@ android:id="@+id/stats_sensor_unit" style="@style/StatsUnit" tools:text="@string/sensor_unit_beats_per_minute" - app:layout_constraintStart_toStartOf="parent" + app:layout_constraintStart_toEndOf="@id/stats_sensor_value" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintTop_toBottomOf="@id/stats_sensor_value" /> + app:layout_constraintBottom_toBottomOf="@id/stats_sensor_value" /> \ No newline at end of file diff --git a/src/main/res/values/do_not_translate.xml b/src/main/res/values/do_not_translate.xml index ebe5bc591..5e8aa2bdb 100644 --- a/src/main/res/values/do_not_translate.xml +++ b/src/main/res/values/do_not_translate.xml @@ -25,9 +25,9 @@ limitations under the License. http://maps.google.com/mapfiles/ms/micons/blue-pushpin.png - BPM - RPM - W + bpm + rpm + w - From 34eb7a833a6f0a7d490aff9fb633892f304025cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rom=C3=A1n=20Mart=C3=ADnez?= Date: Sat, 6 Mar 2021 17:18:47 +0100 Subject: [PATCH 2/4] Statistics recorded fragment shows activity's information (name, description, start datetime). Re-arrange stats putting the focus on moving stats. Fixes #566. --- .../fragments/StatisticsRecordedFragment.java | 12 + src/main/res/layout/statistics_recorded.xml | 333 ++++++++++-------- src/main/res/values/styles.xml | 32 ++ 3 files changed, 227 insertions(+), 150 deletions(-) diff --git a/src/main/java/de/dennisguse/opentracks/fragments/StatisticsRecordedFragment.java b/src/main/java/de/dennisguse/opentracks/fragments/StatisticsRecordedFragment.java index 6329a5b15..764e9b623 100644 --- a/src/main/java/de/dennisguse/opentracks/fragments/StatisticsRecordedFragment.java +++ b/src/main/java/de/dennisguse/opentracks/fragments/StatisticsRecordedFragment.java @@ -161,6 +161,7 @@ public class StatisticsRecordedFragment extends Fragment { sharedPreferenceChangeListener.onSharedPreferenceChanged(sharedPreferences, getString(R.string.stats_rate_key)); } + loadTrackDescription(track); updateUI(); updateSensorUI(); } @@ -168,6 +169,17 @@ public class StatisticsRecordedFragment extends Fragment { } } + private void loadTrackDescription(Track track) { + if (track == null) { + return; + } + viewBinding.statsNameValue.setText(track.getName()); + viewBinding.statsDescriptionValue.setText(track.getDescription()); + if (track.getTrackStatistics() != null) { + viewBinding.statsStartDatetimeValue.setText(StringUtils.formatDateTime(getContext(), track.getTrackStatistics().getStartTime())); + } + } + private void updateUI() { // Set total distance { diff --git a/src/main/res/layout/statistics_recorded.xml b/src/main/res/layout/statistics_recorded.xml index 7514af11f..5ec56c1ab 100644 --- a/src/main/res/layout/statistics_recorded.xml +++ b/src/main/res/layout/statistics_recorded.xml @@ -30,91 +30,124 @@ android:orientation="vertical" app:layout_constraintGuide_end="8dp" /> + + + + + + + + + + + + + + + + app:layout_constraintStart_toEndOf="@id/guideline" + app:layout_constraintEnd_toStartOf="@id/guideline2" + app:layout_constraintTop_toBottomOf="@id/stats_information_horizontal_line" /> - - - - - - - - - - + app:layout_constraintStart_toEndOf="@id/guideline2" + app:layout_constraintEnd_toStartOf="@id/guideline3" + app:layout_constraintTop_toBottomOf="@id/stats_information_horizontal_line" /> + + + + + @@ -130,18 +163,74 @@ android:id="@+id/stats_speed_horizontal_line" style="@style/StatsHorizontalLine" android:layout_marginBottom="8dp" - app:layout_constraintStart_toEndOf="@+id/guideline" - app:layout_constraintEnd_toStartOf="@+id/guideline3" - app:layout_constraintTop_toBottomOf="@+id/stats_time_barrier" /> + app:layout_constraintStart_toEndOf="@id/guideline" + app:layout_constraintEnd_toStartOf="@id/guideline3" + app:layout_constraintTop_toBottomOf="@id/stats_time_barrier" /> + + + + + + + + + + + + + + - - - - - - - - - - - - - - @@ -224,16 +257,16 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" app:barrierDirection="bottom" - app:constraint_referenced_ids="stats_moving_speed_value,stats_max_speed_value" /> + app:constraint_referenced_ids="stats_max_speed_value,stats_moving_speed_value,stats_average_speed_value" /> + app:layout_constraintStart_toEndOf="@id/guideline" + app:layout_constraintEnd_toStartOf="@id/guideline3" + app:layout_constraintTop_toBottomOf="@id/stats_speed_barrier" /> @@ -309,9 +342,9 @@ android:id="@+id/stats_end_horizontal_line" style="@style/StatsHorizontalLine" android:layout_marginBottom="8dp" - app:layout_constraintStart_toEndOf="@+id/guideline" - app:layout_constraintEnd_toStartOf="@+id/guideline3" - app:layout_constraintTop_toBottomOf="@+id/stats_elevation_barrier" /> + app:layout_constraintStart_toEndOf="@id/guideline" + app:layout_constraintEnd_toStartOf="@id/guideline3" + app:layout_constraintTop_toBottomOf="@id/stats_elevation_barrier" /> true + + + + + + + +