Merge pull request #634 from OpenTracksApp/ui#566

Recorded fragment shows name, desc, start datetime.
This commit is contained in:
Román Martínez
2021-03-12 19:55:12 +01:00
committed by GitHub
7 changed files with 260 additions and 170 deletions
@@ -17,6 +17,7 @@
package de.dennisguse.opentracks; package de.dennisguse.opentracks;
import android.Manifest; import android.Manifest;
import android.app.ActivityOptions;
import android.app.SearchManager; import android.app.SearchManager;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
@@ -29,6 +30,7 @@ import android.location.LocationManager;
import android.os.Bundle; import android.os.Bundle;
import android.provider.Settings; import android.provider.Settings;
import android.util.Log; import android.util.Log;
import android.util.Pair;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
@@ -195,17 +197,20 @@ public class TrackListActivity extends AbstractListActivity implements ConfirmDe
viewBinding.trackList.setEmptyView(viewBinding.trackListEmptyView); viewBinding.trackList.setEmptyView(viewBinding.trackListEmptyView);
viewBinding.trackList.setOnItemClickListener((parent, view, position, trackId) -> { viewBinding.trackList.setOnItemClickListener((parent, view, position, trackId) -> {
Intent newIntent;
if (trackId == recordingTrackId.getId()) { if (trackId == recordingTrackId.getId()) {
// Is recording -> open record activity. // Is recording -> open record activity.
newIntent = IntentUtils.newIntent(TrackListActivity.this, TrackRecordingActivity.class) Intent newIntent = IntentUtils.newIntent(TrackListActivity.this, TrackRecordingActivity.class)
.putExtra(TrackRecordedActivity.EXTRA_TRACK_ID, new Track.Id(trackId)); .putExtra(TrackRecordedActivity.EXTRA_TRACK_ID, new Track.Id(trackId));
startActivity(newIntent);
} else { } else {
// Not recording -> open detail activity. // Not recording -> open detail activity.
newIntent = IntentUtils.newIntent(TrackListActivity.this, TrackRecordedActivity.class) Intent newIntent = IntentUtils.newIntent(TrackListActivity.this, TrackRecordedActivity.class)
.putExtra(TrackRecordedActivity.EXTRA_TRACK_ID, new Track.Id(trackId)); .putExtra(TrackRecordedActivity.EXTRA_TRACK_ID, new Track.Id(trackId));
ActivityOptions activityOptions = ActivityOptions.makeSceneTransitionAnimation(
this,
new Pair<>(view.findViewById(R.id.list_item_icon), TrackRecordedActivity.VIEW_TRACK_ICON));
startActivity(newIntent, activityOptions.toBundle());
} }
startActivity(newIntent);
}); });
resourceCursorAdapter = new ResourceCursorAdapter(this, R.layout.list_item, null, 0) { resourceCursorAdapter = new ResourceCursorAdapter(this, R.layout.list_item, null, 0) {
@@ -24,6 +24,7 @@ import android.view.MenuItem;
import android.view.View; import android.view.View;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.core.view.ViewCompat;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.adapter.FragmentStateAdapter; import androidx.viewpager2.adapter.FragmentStateAdapter;
@@ -55,6 +56,8 @@ public class TrackRecordedActivity extends AbstractListActivity implements Confi
private static final String TAG = TrackRecordedActivity.class.getSimpleName(); private static final String TAG = TrackRecordedActivity.class.getSimpleName();
public static final String VIEW_TRACK_ICON = "track_icon";
public static final String EXTRA_TRACK_ID = "track_id"; public static final String EXTRA_TRACK_ID = "track_id";
public static final String EXTRA_MARKER_ID = "marker_id"; public static final String EXTRA_MARKER_ID = "marker_id";
@@ -84,6 +87,8 @@ public class TrackRecordedActivity extends AbstractListActivity implements Confi
if (savedInstanceState != null) { if (savedInstanceState != null) {
viewBinding.trackDetailActivityViewPager.setCurrentItem(savedInstanceState.getInt(CURRENT_TAB_TAG_KEY)); viewBinding.trackDetailActivityViewPager.setCurrentItem(savedInstanceState.getInt(CURRENT_TAB_TAG_KEY));
} }
postponeEnterTransition();
} }
@Override @Override
@@ -275,4 +280,9 @@ public class TrackRecordedActivity extends AbstractListActivity implements Confi
} }
} }
} }
public void startPostponedEnterTransitionWith(View viewIcon, View viewName) {
ViewCompat.setTransitionName(viewIcon, TrackRecordedActivity.VIEW_TRACK_ICON);
startPostponedEnterTransition();
}
} }
@@ -34,6 +34,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import de.dennisguse.opentracks.R; import de.dennisguse.opentracks.R;
import de.dennisguse.opentracks.TrackRecordedActivity;
import de.dennisguse.opentracks.adapters.SensorsAdapter; import de.dennisguse.opentracks.adapters.SensorsAdapter;
import de.dennisguse.opentracks.content.data.Track; import de.dennisguse.opentracks.content.data.Track;
import de.dennisguse.opentracks.content.provider.ContentProviderUtils; import de.dennisguse.opentracks.content.provider.ContentProviderUtils;
@@ -64,7 +65,6 @@ public class StatisticsRecordedFragment extends Fragment {
return fragment; return fragment;
} }
private TrackStatistics trackStatistics; private TrackStatistics trackStatistics;
private SensorStatistics sensorStatistics; private SensorStatistics sensorStatistics;
private SensorsAdapter sensorsAdapter; private SensorsAdapter sensorsAdapter;
@@ -152,26 +152,35 @@ public class StatisticsRecordedFragment extends Fragment {
getActivity().runOnUiThread(() -> { getActivity().runOnUiThread(() -> {
if (isResumed()) { if (isResumed()) {
Track track = contentProviderUtils.getTrack(trackId); Track track = contentProviderUtils.getTrack(trackId);
trackStatistics = track != null ? track.getTrackStatistics() : null; trackStatistics = track.getTrackStatistics();
sensorStatistics = contentProviderUtils.getSensorStats(trackId); sensorStatistics = contentProviderUtils.getSensorStats(trackId);
String newCategory = track != null ? track.getCategory() : ""; String newCategory = track.getCategory();
if (!category.equals(newCategory)) { if (!category.equals(newCategory)) {
category = newCategory; category = newCategory;
sharedPreferenceChangeListener.onSharedPreferenceChanged(sharedPreferences, getString(R.string.stats_rate_key)); sharedPreferenceChangeListener.onSharedPreferenceChanged(sharedPreferences, getString(R.string.stats_rate_key));
} }
loadTrackDescription(track);
updateUI(); updateUI();
updateSensorUI(); updateSensorUI();
((TrackRecordedActivity) getActivity()).startPostponedEnterTransitionWith(viewBinding.statsActivityTypeIcon, viewBinding.statsNameValue);
} }
}); });
} }
} }
private void loadTrackDescription(@NonNull Track track) {
viewBinding.statsNameValue.setText(track.getName());
viewBinding.statsDescriptionValue.setText(track.getDescription());
viewBinding.statsStartDatetimeValue.setText(StringUtils.formatDateTime(getContext(), trackStatistics.getStartTime()));
}
private void updateUI() { private void updateUI() {
// Set total distance // Set total distance
{ {
double totalDistance = trackStatistics == null ? Double.NaN : trackStatistics.getTotalDistance(); double totalDistance = trackStatistics.getTotalDistance();
Pair<String, String> parts = StringUtils.getDistanceParts(getContext(), totalDistance, preferenceMetricUnits); Pair<String, String> parts = StringUtils.getDistanceParts(getContext(), totalDistance, preferenceMetricUnits);
viewBinding.statsDistanceValue.setText(parts.first); viewBinding.statsDistanceValue.setText(parts.first);
@@ -185,14 +194,14 @@ public class StatisticsRecordedFragment extends Fragment {
} }
// Set time and start datetime // Set time and start datetime
if (trackStatistics != null) { {
viewBinding.statsMovingTimeValue.setText(StringUtils.formatElapsedTime(trackStatistics.getMovingTime())); viewBinding.statsMovingTimeValue.setText(StringUtils.formatElapsedTime(trackStatistics.getMovingTime()));
viewBinding.statsTotalTimeValue.setText(StringUtils.formatElapsedTime(trackStatistics.getTotalTime())); viewBinding.statsTotalTimeValue.setText(StringUtils.formatElapsedTime(trackStatistics.getTotalTime()));
} }
// Set average speed/pace // Set average speed/pace
{ {
double speed = trackStatistics != null ? trackStatistics.getAverageSpeed() : Double.NaN; double speed = trackStatistics.getAverageSpeed();
viewBinding.statsAverageSpeedLabel.setText(preferenceReportSpeed ? R.string.stats_average_speed : R.string.stats_average_pace); viewBinding.statsAverageSpeedLabel.setText(preferenceReportSpeed ? R.string.stats_average_speed : R.string.stats_average_pace);
Pair<String, String> parts = StringUtils.getSpeedParts(getContext(), speed, preferenceMetricUnits, preferenceReportSpeed); Pair<String, String> parts = StringUtils.getSpeedParts(getContext(), speed, preferenceMetricUnits, preferenceReportSpeed);
@@ -202,7 +211,7 @@ public class StatisticsRecordedFragment extends Fragment {
// Set max speed/pace // Set max speed/pace
{ {
double speed = trackStatistics == null ? Double.NaN : trackStatistics.getMaxSpeed(); double speed = trackStatistics.getMaxSpeed();
viewBinding.statsMaxSpeedLabel.setText(preferenceReportSpeed ? R.string.stats_max_speed : R.string.stats_fastest_pace); viewBinding.statsMaxSpeedLabel.setText(preferenceReportSpeed ? R.string.stats_max_speed : R.string.stats_fastest_pace);
@@ -213,7 +222,7 @@ public class StatisticsRecordedFragment extends Fragment {
// Set moving speed/pace // Set moving speed/pace
{ {
double speed = trackStatistics != null ? trackStatistics.getAverageMovingSpeed() : Double.NaN; double speed = trackStatistics.getAverageMovingSpeed();
viewBinding.statsMovingSpeedLabel.setText(preferenceReportSpeed ? R.string.stats_average_moving_speed : R.string.stats_average_moving_pace); viewBinding.statsMovingSpeedLabel.setText(preferenceReportSpeed ? R.string.stats_average_moving_speed : R.string.stats_average_moving_pace);
@@ -228,8 +237,8 @@ public class StatisticsRecordedFragment extends Fragment {
boolean showElevation = PreferencesUtils.isShowStatsElevation(getContext()); boolean showElevation = PreferencesUtils.isShowStatsElevation(getContext());
viewBinding.statsElevationGroup.setVisibility(showElevation ? View.VISIBLE : View.GONE); viewBinding.statsElevationGroup.setVisibility(showElevation ? View.VISIBLE : View.GONE);
Float elevationGain_m = trackStatistics != null ? trackStatistics.getTotalElevationGain() : null; Float elevationGain_m = trackStatistics.getTotalElevationGain();
Float elevationLoss_m = trackStatistics != null ? trackStatistics.getTotalElevationLoss() : null; Float elevationLoss_m = trackStatistics.getTotalElevationLoss();
Pair<String, String> parts; Pair<String, String> parts;
+4 -3
View File
@@ -25,8 +25,9 @@
android:id="@+id/stats_sensor_value" android:id="@+id/stats_sensor_value"
style="@style/StatsLargeValue" style="@style/StatsLargeValue"
android:value="@string/value_unknown" android:value="@string/value_unknown"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent" 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" app:layout_constraintTop_toBottomOf="@id/stats_sensor_sensor_value"
tools:text="90" /> tools:text="90" />
@@ -34,8 +35,8 @@
android:id="@+id/stats_sensor_unit" android:id="@+id/stats_sensor_unit"
style="@style/StatsUnit" style="@style/StatsUnit"
tools:text="@string/sensor_unit_beats_per_minute" 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_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/stats_sensor_value" /> app:layout_constraintBottom_toBottomOf="@id/stats_sensor_value" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
+183 -150
View File
@@ -30,91 +30,124 @@
android:orientation="vertical" android:orientation="vertical"
app:layout_constraintGuide_end="8dp" /> app:layout_constraintGuide_end="8dp" />
<!-- Activity information: icon, name, description and start datetime -->
<ImageView
android:id="@+id/stats_activity_type_icon"
style="@style/IconStats"
app:layout_constraintStart_toEndOf="@id/guideline"
app:layout_constraintTop_toTopOf="@id/stats_name_value"
tools:src="@drawable/ic_activity_bike_24dp" />
<TextView
android:id="@+id/stats_name_value"
style="@style/TextLargeStats"
android:layout_width="0dp"
app:layout_constrainedWidth="true"
app:layout_constraintEnd_toStartOf="@id/guideline3"
app:layout_constraintStart_toEndOf="@id/stats_activity_type_icon"
app:layout_constraintTop_toTopOf="parent"
tools:text="Name of the activity" />
<TextView
android:id="@+id/stats_description_value"
style="@style/TextMediumStats"
android:layout_width="0dp"
app:layout_constrainedWidth="true"
app:layout_constraintEnd_toStartOf="@id/guideline3"
app:layout_constraintStart_toStartOf="@id/stats_name_value"
app:layout_constraintTop_toBottomOf="@id/stats_name_value"
tools:text="Here will be a description that could be really long and it would show completely without problems." />
<TextView
android:id="@+id/stats_start_datetime_value"
style="@style/TextSmallStats"
android:layout_width="0dp"
app:layout_constrainedWidth="true"
app:layout_constraintEnd_toStartOf="@id/guideline3"
app:layout_constraintStart_toStartOf="@id/guideline"
app:layout_constraintTop_toBottomOf="@id/stats_description_barrier"
tools:text="Saturday 6th, 16:44" />
<!-- Barrier -->
<androidx.constraintlayout.widget.Barrier
android:id="@+id/stats_description_barrier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="stats_activity_type_icon,stats_name_value,stats_description_value" />
<!-- Horizontal line -->
<View
android:id="@+id/stats_information_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_start_datetime_value" />
<!-- Distance --> <!-- Distance -->
<TextView <TextView
android:id="@+id/stats_distance_label" android:id="@+id/stats_distance_label"
style="@style/StatsLargeLabel" style="@style/StatsLargeLabel"
android:text="@string/stats_distance" android:text="@string/stats_distance"
app:layout_constrainedWidth="true" app:layout_constrainedWidth="true"
app:layout_constraintStart_toEndOf="@+id/guideline" app:layout_constraintStart_toEndOf="@id/guideline"
app:layout_constraintEnd_toStartOf="@+id/guideline2" app:layout_constraintEnd_toStartOf="@id/guideline2"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toBottomOf="@id/stats_information_horizontal_line" />
<TextView <TextView
android:id="@+id/stats_distance_value" android:id="@+id/stats_distance_value"
style="@style/StatsLargeValue" style="@style/StatsLargeValue"
android:value="@string/value_unknown" android:value="@string/value_unknown"
app:layout_constraintHorizontal_chainStyle="packed" app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toEndOf="@+id/guideline" app:layout_constraintStart_toEndOf="@id/guideline"
app:layout_constraintEnd_toStartOf="@+id/stats_distance_unit" app:layout_constraintEnd_toStartOf="@id/stats_distance_unit"
app:layout_constraintTop_toBottomOf="@+id/stats_distance_label" app:layout_constraintTop_toBottomOf="@id/stats_distance_label"
tools:text="100" /> tools:text="100" />
<TextView <TextView
android:id="@+id/stats_distance_unit" android:id="@+id/stats_distance_unit"
style="@style/StatsUnit" style="@style/StatsUnit"
app:layout_constraintBottom_toBottomOf="@+id/stats_distance_value" app:layout_constraintBottom_toBottomOf="@id/stats_distance_value"
app:layout_constraintStart_toEndOf="@+id/stats_distance_value" app:layout_constraintStart_toEndOf="@id/stats_distance_value"
app:layout_constraintEnd_toStartOf="@+id/guideline2" app:layout_constraintEnd_toStartOf="@id/guideline2"
tools:text="km" /> tools:text="km" />
<!-- Activity Type -->
<TextView
android:id="@+id/stats_activity_type_label"
style="@style/StatsLargeLabel"
android:text="@string/track_edit_activity_type_hint"
app:layout_constrainedWidth="true"
app:layout_constraintStart_toEndOf="@+id/guideline2"
app:layout_constraintEnd_toStartOf="@+id/guideline3"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/stats_activity_type_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toEndOf="@+id/guideline2"
app:layout_constraintEnd_toStartOf="@+id/guideline3"
app:layout_constraintBottom_toBottomOf="@+id/stats_distance_value"
app:layout_constraintTop_toTopOf="@+id/stats_distance_value"
app:tint="?android:textColorPrimary" />
<!-- Total time -->
<TextView
android:id="@+id/stats_total_time_label"
style="@style/StatsLargeLabel"
android:text="@string/stats_total_time"
app:layout_constrainedWidth="true"
app:layout_constraintStart_toEndOf="@+id/guideline"
app:layout_constraintEnd_toStartOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/stats_distance_value" />
<TextView
android:id="@+id/stats_total_time_value"
style="@style/StatsLargeValue"
app:layout_constraintStart_toEndOf="@+id/guideline"
app:layout_constraintEnd_toStartOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/stats_total_time_label"
tools:text="00:00:00" />
<!-- Moving time --> <!-- Moving time -->
<TextView <TextView
android:id="@+id/stats_moving_time_label" android:id="@+id/stats_moving_time_label"
style="@style/StatsLargeLabel" style="@style/StatsLargeLabel"
android:text="@string/stats_moving_time" android:text="@string/stats_moving_time"
app:layout_constrainedWidth="true" app:layout_constrainedWidth="true"
app:layout_constraintBottom_toBottomOf="@+id/stats_total_time_label" app:layout_constraintStart_toEndOf="@id/guideline2"
app:layout_constraintEnd_toStartOf="@+id/guideline3" app:layout_constraintEnd_toStartOf="@id/guideline3"
app:layout_constraintStart_toEndOf="@+id/guideline2" app:layout_constraintTop_toBottomOf="@id/stats_information_horizontal_line" />
app:layout_constraintTop_toTopOf="@+id/stats_total_time_label"
app:layout_constraintVertical_bias="1.0" />
<TextView <TextView
android:id="@+id/stats_moving_time_value" android:id="@+id/stats_moving_time_value"
style="@style/StatsLargeValue" style="@style/StatsLargeValue"
android:value="@string/value_unknown" android:value="@string/value_unknown"
app:layout_constraintStart_toEndOf="@+id/guideline2" app:layout_constraintStart_toEndOf="@id/guideline2"
app:layout_constraintEnd_toStartOf="@+id/guideline3" app:layout_constraintEnd_toStartOf="@id/guideline3"
app:layout_constraintTop_toBottomOf="@+id/stats_moving_time_label" app:layout_constraintTop_toBottomOf="@id/stats_moving_time_label"
tools:text="00:00:00" />
<!-- Total time -->
<TextView
android:id="@+id/stats_total_time_label"
style="@style/StatsSmallLabel"
android:text="@string/stats_total_time"
app:layout_constrainedWidth="true"
app:layout_constraintStart_toEndOf="@id/guideline2"
app:layout_constraintEnd_toStartOf="@id/guideline3"
app:layout_constraintTop_toBottomOf="@id/stats_moving_time_value" />
<TextView
android:id="@+id/stats_total_time_value"
style="@style/StatsSmallValue"
app:layout_constraintStart_toEndOf="@id/guideline2"
app:layout_constraintEnd_toStartOf="@id/guideline3"
app:layout_constraintTop_toBottomOf="@id/stats_total_time_label"
tools:text="00:00:00" /> tools:text="00:00:00" />
<!-- Barrier --> <!-- Barrier -->
@@ -130,18 +163,74 @@
android:id="@+id/stats_speed_horizontal_line" android:id="@+id/stats_speed_horizontal_line"
style="@style/StatsHorizontalLine" style="@style/StatsHorizontalLine"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
app:layout_constraintStart_toEndOf="@+id/guideline" app:layout_constraintStart_toEndOf="@id/guideline"
app:layout_constraintEnd_toStartOf="@+id/guideline3" app:layout_constraintEnd_toStartOf="@id/guideline3"
app:layout_constraintTop_toBottomOf="@+id/stats_time_barrier" /> app:layout_constraintTop_toBottomOf="@id/stats_time_barrier" />
<!-- Speed/Pace max -->
<TextView
android:id="@+id/stats_max_speed_label"
style="@style/StatsLargeLabel"
app:layout_constrainedWidth="true"
app:layout_constraintStart_toEndOf="@id/guideline"
app:layout_constraintEnd_toStartOf="@id/guideline2"
app:layout_constraintTop_toBottomOf="@id/stats_speed_horizontal_line"
tools:text="Max. Speed" />
<TextView
android:id="@+id/stats_max_speed_value"
style="@style/StatsLargeValue"
android:value="@string/value_unknown"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toEndOf="@id/guideline"
app:layout_constraintEnd_toStartOf="@id/stats_max_speed_unit"
app:layout_constraintTop_toBottomOf="@id/stats_max_speed_label"
tools:text="30.00" />
<TextView
android:id="@+id/stats_max_speed_unit"
style="@style/StatsUnit"
app:layout_constraintBottom_toBottomOf="@id/stats_max_speed_value"
app:layout_constraintStart_toEndOf="@id/stats_max_speed_value"
app:layout_constraintEnd_toStartOf="@id/guideline2"
tools:text="km/h" />
<!-- Avg. moving speed/pace -->
<TextView
android:id="@+id/stats_moving_speed_label"
style="@style/StatsLargeLabel"
app:layout_constrainedWidth="true"
app:layout_constraintStart_toEndOf="@id/guideline2"
app:layout_constraintEnd_toStartOf="@id/guideline3"
app:layout_constraintTop_toBottomOf="@id/stats_speed_horizontal_line"
tools:text="Avg. Moving Speed" />
<TextView
android:id="@+id/stats_moving_speed_value"
style="@style/StatsLargeValue"
android:value="@string/value_unknown"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toEndOf="@id/guideline2"
app:layout_constraintEnd_toStartOf="@id/stats_moving_speed_unit"
app:layout_constraintTop_toBottomOf="@id/stats_moving_speed_label"
tools:text="30.00" />
<TextView
android:id="@+id/stats_moving_speed_unit"
style="@style/StatsUnit"
app:layout_constraintBottom_toBottomOf="@id/stats_moving_speed_value"
app:layout_constraintStart_toEndOf="@id/stats_moving_speed_value"
app:layout_constraintEnd_toStartOf="@id/guideline3"
tools:text="km/h" />
<!-- Average speed/pace --> <!-- Average speed/pace -->
<TextView <TextView
android:id="@+id/stats_average_speed_label" android:id="@+id/stats_average_speed_label"
style="@style/StatsSmallLabel" style="@style/StatsSmallLabel"
app:layout_constrainedWidth="true" app:layout_constrainedWidth="true"
app:layout_constraintStart_toEndOf="@+id/guideline2" app:layout_constraintStart_toEndOf="@id/guideline2"
app:layout_constraintEnd_toStartOf="@+id/guideline3" app:layout_constraintEnd_toStartOf="@id/guideline3"
app:layout_constraintTop_toBottomOf="@id/stats_speed_horizontal_line" app:layout_constraintTop_toBottomOf="@id/stats_moving_speed_value"
tools:text="Avg. Speed" /> tools:text="Avg. Speed" />
<TextView <TextView
@@ -149,73 +238,17 @@
style="@style/StatsSmallValue" style="@style/StatsSmallValue"
android:value="@string/value_unknown" android:value="@string/value_unknown"
app:layout_constraintHorizontal_chainStyle="packed" app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toEndOf="@+id/guideline2" app:layout_constraintStart_toEndOf="@id/guideline2"
app:layout_constraintEnd_toStartOf="@+id/stats_average_speed_unit" app:layout_constraintEnd_toStartOf="@id/stats_average_speed_unit"
app:layout_constraintTop_toBottomOf="@+id/stats_average_speed_label" app:layout_constraintTop_toBottomOf="@id/stats_average_speed_label"
tools:text="30.00" /> tools:text="30.00" />
<TextView <TextView
android:id="@+id/stats_average_speed_unit" android:id="@+id/stats_average_speed_unit"
style="@style/StatsUnit" style="@style/StatsUnit"
app:layout_constraintBottom_toBottomOf="@+id/stats_average_speed_value" app:layout_constraintBottom_toBottomOf="@id/stats_average_speed_value"
app:layout_constraintStart_toEndOf="@+id/stats_average_speed_value" app:layout_constraintStart_toEndOf="@id/stats_average_speed_value"
app:layout_constraintEnd_toStartOf="@+id/guideline3" app:layout_constraintEnd_toStartOf="@id/guideline3"
tools:text="km/h" />
<!-- Speed max -->
<TextView
android:id="@+id/stats_max_speed_label"
style="@style/StatsSmallLabel"
app:layout_constrainedWidth="true"
app:layout_constraintStart_toEndOf="@+id/guideline"
app:layout_constraintEnd_toStartOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@id/stats_average_speed_value"
tools:text="Max. Speed" />
<TextView
android:id="@+id/stats_max_speed_value"
style="@style/StatsSmallValue"
android:value="@string/value_unknown"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toEndOf="@+id/guideline"
app:layout_constraintEnd_toStartOf="@+id/stats_max_speed_unit"
app:layout_constraintTop_toBottomOf="@+id/stats_max_speed_label"
tools:text="30.00" />
<TextView
android:id="@+id/stats_max_speed_unit"
style="@style/StatsUnit"
app:layout_constraintBottom_toBottomOf="@+id/stats_max_speed_value"
app:layout_constraintStart_toEndOf="@+id/stats_max_speed_value"
app:layout_constraintEnd_toStartOf="@+id/guideline2"
tools:text="km/h" />
<!-- Moving speed max -->
<TextView
android:id="@+id/stats_moving_speed_label"
style="@style/StatsSmallLabel"
app:layout_constrainedWidth="true"
app:layout_constraintStart_toEndOf="@+id/guideline2"
app:layout_constraintEnd_toStartOf="@+id/guideline3"
app:layout_constraintTop_toBottomOf="@id/stats_average_speed_value"
tools:text="Max. Moving Speed" />
<TextView
android:id="@+id/stats_moving_speed_value"
style="@style/StatsSmallValue"
android:value="@string/value_unknown"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toEndOf="@+id/guideline2"
app:layout_constraintEnd_toStartOf="@+id/stats_moving_speed_unit"
app:layout_constraintTop_toBottomOf="@+id/stats_moving_speed_label"
tools:text="30.00" />
<TextView
android:id="@+id/stats_moving_speed_unit"
style="@style/StatsUnit"
app:layout_constraintBottom_toBottomOf="@+id/stats_moving_speed_value"
app:layout_constraintStart_toEndOf="@+id/stats_moving_speed_value"
app:layout_constraintEnd_toStartOf="@+id/guideline3"
tools:text="km/h" /> tools:text="km/h" />
<!-- Barrier --> <!-- Barrier -->
@@ -224,16 +257,16 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:barrierDirection="bottom" 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" />
<!-- Horizontal line --> <!-- Horizontal line -->
<View <View
android:id="@+id/stats_elevation_horizontal_line" android:id="@+id/stats_elevation_horizontal_line"
style="@style/StatsHorizontalLine" style="@style/StatsHorizontalLine"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
app:layout_constraintStart_toEndOf="@+id/guideline" app:layout_constraintStart_toEndOf="@id/guideline"
app:layout_constraintEnd_toStartOf="@+id/guideline3" app:layout_constraintEnd_toStartOf="@id/guideline3"
app:layout_constraintTop_toBottomOf="@+id/stats_speed_barrier" /> app:layout_constraintTop_toBottomOf="@id/stats_speed_barrier" />
<!-- Elevation gain and loss --> <!-- Elevation gain and loss -->
<androidx.constraintlayout.widget.Group <androidx.constraintlayout.widget.Group
@@ -244,56 +277,56 @@
<TextView <TextView
android:id="@+id/stats_elevation_gain_label" android:id="@+id/stats_elevation_gain_label"
style="@style/StatsSmallLabel" style="@style/StatsLargeLabel"
android:text="@string/stats_gain" android:text="@string/stats_gain"
app:layout_constrainedWidth="true" app:layout_constrainedWidth="true"
app:layout_constraintStart_toEndOf="@+id/guideline" app:layout_constraintStart_toEndOf="@id/guideline"
app:layout_constraintEnd_toStartOf="@+id/guideline2" app:layout_constraintEnd_toStartOf="@id/guideline2"
app:layout_constraintTop_toBottomOf="@id/stats_elevation_horizontal_line" /> app:layout_constraintTop_toBottomOf="@id/stats_elevation_horizontal_line" />
<TextView <TextView
android:id="@+id/stats_elevation_gain_value" android:id="@+id/stats_elevation_gain_value"
style="@style/StatsSmallValue" style="@style/StatsLargeValue"
android:value="@string/value_unknown" android:value="@string/value_unknown"
app:layout_constraintHorizontal_chainStyle="packed" app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toEndOf="@+id/guideline" app:layout_constraintStart_toEndOf="@id/guideline"
app:layout_constraintEnd_toStartOf="@+id/stats_elevation_gain_unit" app:layout_constraintEnd_toStartOf="@id/stats_elevation_gain_unit"
app:layout_constraintTop_toBottomOf="@+id/stats_elevation_gain_label" app:layout_constraintTop_toBottomOf="@id/stats_elevation_gain_label"
tools:text="100" /> tools:text="100" />
<TextView <TextView
android:id="@+id/stats_elevation_gain_unit" android:id="@+id/stats_elevation_gain_unit"
style="@style/StatsUnit" style="@style/StatsUnit"
app:layout_constraintBottom_toBottomOf="@+id/stats_elevation_gain_value" app:layout_constraintBottom_toBottomOf="@id/stats_elevation_gain_value"
app:layout_constraintStart_toEndOf="@+id/stats_elevation_gain_value" app:layout_constraintStart_toEndOf="@id/stats_elevation_gain_value"
app:layout_constraintEnd_toStartOf="@+id/guideline2" app:layout_constraintEnd_toStartOf="@id/guideline2"
tools:text="m" /> tools:text="m" />
<TextView <TextView
android:id="@+id/stats_elevation_loss_label" android:id="@+id/stats_elevation_loss_label"
style="@style/StatsSmallLabel" style="@style/StatsLargeLabel"
android:text="@string/stats_loss" android:text="@string/stats_loss"
app:layout_constrainedWidth="true" app:layout_constrainedWidth="true"
app:layout_constraintStart_toEndOf="@+id/guideline2" app:layout_constraintStart_toEndOf="@id/guideline2"
app:layout_constraintEnd_toStartOf="@+id/guideline3" app:layout_constraintEnd_toStartOf="@id/guideline3"
app:layout_constraintTop_toBottomOf="@id/stats_elevation_horizontal_line" /> app:layout_constraintTop_toBottomOf="@id/stats_elevation_horizontal_line" />
<TextView <TextView
android:id="@+id/stats_elevation_loss_value" android:id="@+id/stats_elevation_loss_value"
style="@style/StatsSmallValue" style="@style/StatsLargeValue"
android:value="@string/value_unknown" android:value="@string/value_unknown"
app:layout_constraintHorizontal_chainStyle="packed" app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toEndOf="@+id/guideline2" app:layout_constraintStart_toEndOf="@id/guideline2"
app:layout_constraintEnd_toStartOf="@+id/stats_elevation_loss_unit" app:layout_constraintEnd_toStartOf="@id/stats_elevation_loss_unit"
app:layout_constraintTop_toBottomOf="@+id/stats_elevation_loss_label" app:layout_constraintTop_toBottomOf="@id/stats_elevation_loss_label"
tools:text="100" /> tools:text="100" />
<TextView <TextView
android:id="@+id/stats_elevation_loss_unit" android:id="@+id/stats_elevation_loss_unit"
style="@style/StatsUnit" style="@style/StatsUnit"
app:layout_constraintBottom_toBottomOf="@+id/stats_elevation_loss_value" app:layout_constraintBottom_toBottomOf="@id/stats_elevation_loss_value"
app:layout_constraintStart_toEndOf="@+id/stats_elevation_loss_value" app:layout_constraintStart_toEndOf="@id/stats_elevation_loss_value"
app:layout_constraintEnd_toStartOf="@+id/guideline3" app:layout_constraintEnd_toStartOf="@id/guideline3"
tools:text="m" /> tools:text="m" />
<!-- Barrier --> <!-- Barrier -->
@@ -309,9 +342,9 @@
android:id="@+id/stats_end_horizontal_line" android:id="@+id/stats_end_horizontal_line"
style="@style/StatsHorizontalLine" style="@style/StatsHorizontalLine"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
app:layout_constraintStart_toEndOf="@+id/guideline" app:layout_constraintStart_toEndOf="@id/guideline"
app:layout_constraintEnd_toStartOf="@+id/guideline3" app:layout_constraintEnd_toStartOf="@id/guideline3"
app:layout_constraintTop_toBottomOf="@+id/stats_elevation_barrier" /> app:layout_constraintTop_toBottomOf="@id/stats_elevation_barrier" />
<!-- Sensors data --> <!-- Sensors data -->
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
+3 -3
View File
@@ -25,9 +25,9 @@ limitations under the License.
<string name="marker_icon_url" translatable="false">http://maps.google.com/mapfiles/ms/micons/blue-pushpin.png</string> <string name="marker_icon_url" translatable="false">http://maps.google.com/mapfiles/ms/micons/blue-pushpin.png</string>
<string name="sensor_unit_beats_per_minute" translatable="false">BPM</string> <string name="sensor_unit_beats_per_minute" translatable="false">bpm</string>
<string name="sensor_unit_rounds_per_minute" translatable="false">RPM</string> <string name="sensor_unit_rounds_per_minute" translatable="false">rpm</string>
<string name="sensor_unit_power" translatable="false">W</string> <string name="sensor_unit_power" translatable="false">w</string>
<string name="value_unknown" translatable="false">-</string> <string name="value_unknown" translatable="false">-</string>
+32
View File
@@ -209,6 +209,38 @@ limitations under the License.
<item name="android:singleLine">true</item> <item name="android:singleLine">true</item>
</style> </style>
<style name="TextLargeStats" parent="TextAppearance.AppCompat.Large">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:paddingLeft">8dp</item>
<item name="android:paddingRight">4dp</item>
<item name="android:layout_marginTop">16dp</item>
</style>
<style name="TextMediumStats" parent="TextAppearance.AppCompat.Medium">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:paddingLeft">8dp</item>
<item name="android:paddingRight">4dp</item>
<item name="android:color">@android:color/secondary_text_light</item>
</style>
<style name="TextSmallStats" parent="TextAppearance.AppCompat.Small">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:paddingLeft">8dp</item>
<item name="android:paddingRight">4dp</item>
<item name="android:paddingTop">8dp</item>
<item name="android:textAlignment">viewEnd</item>
<item name="android:color">@android:color/secondary_text_light</item>
</style>
<style name="IconStats">
<item name="android:layout_width">48dp</item>
<item name="android:layout_height">48dp</item>
<item name="tint">?android:textColorPrimary</item>
</style>
<style name="TextMicro" parent="@style/TextSmall"> <style name="TextMicro" parent="@style/TextSmall">
<item name="android:textSize">12sp</item> <item name="android:textSize">12sp</item>
<item name="android:layout_height">wrap_content</item> <item name="android:layout_height">wrap_content</item>