Recorded/Recording nested layouts converted to constraint layout. Fixes #15.

This commit is contained in:
Román
2020-05-23 17:13:58 +02:00
parent d86f42e2e9
commit 12e6f03098
7 changed files with 665 additions and 513 deletions
+2 -1
View File
@@ -100,7 +100,7 @@ android {
dependencies { dependencies {
implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.preference:preference:1.1.0' implementation 'androidx.preference:preference:1.1.1'
implementation 'androidx.documentfile:documentfile:1.0.1' implementation 'androidx.documentfile:documentfile:1.0.1'
androidTestImplementation 'androidx.test:core:1.2.0' androidTestImplementation 'androidx.test:core:1.2.0'
@@ -114,4 +114,5 @@ dependencies {
testImplementation 'androidx.test:core:1.2.0' testImplementation 'androidx.test:core:1.2.0'
testImplementation 'org.mockito:mockito-core:3.0.0' testImplementation 'org.mockito:mockito-core:3.0.0'
implementation 'com.google.android.material:material:1.1.0' implementation 'com.google.android.material:material:1.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
} }
+1 -1
View File
@@ -16,7 +16,7 @@ TrackListActivity --> TrackRecordedActivity : Show track
TrackListActivity --> TrackDeleteActivity TrackListActivity --> TrackDeleteActivity
SearchListActivity --> MarkerDetailActivity : Search result SearchListActivity --> MarkerDetailActivity : Search result
SearchListActivity --> TrackDetailActivity : Search result SearchListActivity --> TrackRecordedActivity : Search result
TrackRecordedActivity --> TrackDeleteActivity TrackRecordedActivity --> TrackDeleteActivity
TrackRecordedActivity --> TrackEditActivity TrackRecordedActivity --> TrackEditActivity
@@ -15,6 +15,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.Group;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import de.dennisguse.opentracks.R; import de.dennisguse.opentracks.R;
@@ -99,10 +100,11 @@ public class StatisticsRecordingFragment extends Fragment implements TrackDataLi
} }
/* Views */ /* Views */
private View heartRateContainer; private View sensorHorizontalLine;
private Group heartRateGroup;
private TextView heartRateValueView; private TextView heartRateValueView;
private TextView heartRateSensorView; private TextView heartRateSensorView;
private View cadenceContainer; private Group cadenceGroup;
private TextView cadenceValueView; private TextView cadenceValueView;
private TextView cadenceSensorView; private TextView cadenceSensorView;
@@ -133,16 +135,13 @@ public class StatisticsRecordingFragment extends Fragment implements TrackDataLi
private TextView speedMovingLabel; private TextView speedMovingLabel;
private TextView speedMovingValue; private TextView speedMovingValue;
private TextView speedMovingUnit; private TextView speedMovingUnit;
private View elevationSeparator; private Group elevationGroup;
private View elevationContainer;
private View speedContainer;
private TextView speedLabel; private TextView speedLabel;
private TextView speedValue; private TextView speedValue;
private TextView speedUnit; private TextView speedUnit;
private TextView elevationValue; private TextView elevationValue;
private TextView elevationUnit; private TextView elevationUnit;
private View coordinateSeparator; private Group coordinateGroup;
private View coordinateContainer;
private TextView latitudeValue; private TextView latitudeValue;
private TextView longitudeValue; private TextView longitudeValue;
@@ -150,11 +149,13 @@ public class StatisticsRecordingFragment extends Fragment implements TrackDataLi
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState); super.onViewCreated(view, savedInstanceState);
heartRateContainer = view.findViewById(R.id.stats_sensor_heart_rate_container); sensorHorizontalLine = view.findViewById(R.id.stats_sensor_horizontal_line);
heartRateGroup = view.findViewById(R.id.stats_sensor_heart_rate_group);
heartRateValueView = view.findViewById(R.id.stats_sensor_heart_rate_value); heartRateValueView = view.findViewById(R.id.stats_sensor_heart_rate_value);
heartRateSensorView = view.findViewById(R.id.stats_sensor_heart_rate_sensor_value); heartRateSensorView = view.findViewById(R.id.stats_sensor_heart_rate_sensor_value);
cadenceContainer = view.findViewById(R.id.stats_sensor_cadence_container); cadenceGroup = view.findViewById(R.id.stats_sensor_cadence_group);
cadenceValueView = view.findViewById(R.id.stats_sensor_cadence_value); cadenceValueView = view.findViewById(R.id.stats_sensor_cadence_value);
cadenceSensorView = view.findViewById(R.id.stats_sensor_cadence_sensor_value); cadenceSensorView = view.findViewById(R.id.stats_sensor_cadence_sensor_value);
@@ -180,10 +181,8 @@ public class StatisticsRecordingFragment extends Fragment implements TrackDataLi
speedMovingValue = view.findViewById(R.id.stats_moving_speed_value); speedMovingValue = view.findViewById(R.id.stats_moving_speed_value);
speedMovingUnit = view.findViewById(R.id.stats_moving_speed_unit); speedMovingUnit = view.findViewById(R.id.stats_moving_speed_unit);
elevationSeparator = view.findViewById(R.id.stats_elevation_separator); elevationGroup = view.findViewById(R.id.stats_elevation_current_group);
elevationContainer = view.findViewById(R.id.stats_elevation_container);
speedContainer = view.findViewById(R.id.stats_speed);
speedLabel = view.findViewById(R.id.stats_speed_label); speedLabel = view.findViewById(R.id.stats_speed_label);
speedValue = view.findViewById(R.id.stats_speed_value); speedValue = view.findViewById(R.id.stats_speed_value);
speedUnit = view.findViewById(R.id.stats_speed_unit); speedUnit = view.findViewById(R.id.stats_speed_unit);
@@ -191,8 +190,7 @@ public class StatisticsRecordingFragment extends Fragment implements TrackDataLi
elevationValue = view.findViewById(R.id.stats_elevation_current_value); elevationValue = view.findViewById(R.id.stats_elevation_current_value);
elevationUnit = view.findViewById(R.id.stats_elevation_current_unit); elevationUnit = view.findViewById(R.id.stats_elevation_current_unit);
coordinateSeparator = view.findViewById(R.id.stats_coordinate_separator); coordinateGroup = view.findViewById(R.id.stats_coordinate_group);
coordinateContainer = view.findViewById(R.id.stats_coordinate_container);
latitudeValue = view.findViewById(R.id.stats_latitude_value); latitudeValue = view.findViewById(R.id.stats_latitude_value);
longitudeValue = view.findViewById(R.id.stats_longitude_value); longitudeValue = view.findViewById(R.id.stats_longitude_value);
@@ -261,10 +259,12 @@ public class StatisticsRecordingFragment extends Fragment implements TrackDataLi
@Override @Override
public void onDestroyView() { public void onDestroyView() {
super.onDestroyView(); super.onDestroyView();
heartRateContainer = null; sensorHorizontalLine = null;
heartRateGroup = null;
heartRateValueView = null; heartRateValueView = null;
heartRateSensorView = null; heartRateSensorView = null;
cadenceContainer = null; cadenceGroup = null;
cadenceValueView = null; cadenceValueView = null;
cadenceSensorView = null; cadenceSensorView = null;
@@ -290,10 +290,8 @@ public class StatisticsRecordingFragment extends Fragment implements TrackDataLi
speedMovingValue = null; speedMovingValue = null;
speedMovingUnit = null; speedMovingUnit = null;
elevationSeparator = null; elevationGroup = null;
elevationContainer = null;
speedContainer = null;
speedLabel = null; speedLabel = null;
speedValue = null; speedValue = null;
speedUnit = null; speedUnit = null;
@@ -301,8 +299,7 @@ public class StatisticsRecordingFragment extends Fragment implements TrackDataLi
elevationValue = null; elevationValue = null;
elevationUnit = null; elevationUnit = null;
coordinateSeparator = null; coordinateGroup = null;
coordinateContainer = null;
latitudeValue = null; latitudeValue = null;
longitudeValue = null; longitudeValue = null;
@@ -433,19 +430,19 @@ public class StatisticsRecordingFragment extends Fragment implements TrackDataLi
sensorDataSet = trackRecordingService.getSensorData(); sensorDataSet = trackRecordingService.getSensorData();
} }
setHeartRateSensorData(sensorDataSet, isSelectedTrackRecording()); setHeartRateSensorData(sensorDataSet);
setCadenceSensorData(sensorDataSet, isSelectedTrackRecording()); setCadenceSensorData(sensorDataSet);
setSpeedSensorData(sensorDataSet, isSelectedTrackRecording()); setSpeedSensorData(sensorDataSet, isSelectedTrackRecording());
} }
private void setHeartRateSensorData(SensorDataSet sensorDataSet, boolean isRecording) { private void setHeartRateSensorData(SensorDataSet sensorDataSet) {
int isVisible = View.VISIBLE; int isVisible = View.VISIBLE;
if (!isRecording || PreferencesUtils.isBluetoothHeartRateSensorAddressNone(getContext())) { if (PreferencesUtils.isBluetoothHeartRateSensorAddressNone(getContext())) {
isVisible = View.INVISIBLE; isVisible = View.GONE;
} }
heartRateContainer.setVisibility(isVisible); heartRateGroup.setVisibility(isVisible);
setVisibilitySensorHorizontalLine();
if (isRecording) {
String sensorValue = getContext().getString(R.string.value_unknown); String sensorValue = getContext().getString(R.string.value_unknown);
String sensorName = getContext().getString(R.string.value_unknown); String sensorName = getContext().getString(R.string.value_unknown);
if (sensorDataSet != null && sensorDataSet.getHeartRate() != null) { if (sensorDataSet != null && sensorDataSet.getHeartRate() != null) {
@@ -460,16 +457,15 @@ public class StatisticsRecordingFragment extends Fragment implements TrackDataLi
heartRateSensorView.setText(sensorName); heartRateSensorView.setText(sensorName);
heartRateValueView.setText(sensorValue); heartRateValueView.setText(sensorValue);
} }
}
private void setCadenceSensorData(SensorDataSet sensorDataSet, boolean isRecording) { private void setCadenceSensorData(SensorDataSet sensorDataSet) {
int isVisible = View.VISIBLE; int isVisible = View.VISIBLE;
if (!isRecording || PreferencesUtils.isBluetoothCyclingCadenceSensorAddressNone(getContext())) { if (PreferencesUtils.isBluetoothCyclingCadenceSensorAddressNone(getContext())) {
isVisible = View.INVISIBLE; isVisible = View.GONE;
} }
cadenceContainer.setVisibility(isVisible); cadenceGroup.setVisibility(isVisible);
setVisibilitySensorHorizontalLine();
if (isRecording) {
String sensorValue = getContext().getString(R.string.value_unknown); String sensorValue = getContext().getString(R.string.value_unknown);
String sensorName = getContext().getString(R.string.value_unknown); String sensorName = getContext().getString(R.string.value_unknown);
if (sensorDataSet != null && sensorDataSet.getCyclingCadence() != null) { if (sensorDataSet != null && sensorDataSet.getCyclingCadence() != null) {
@@ -484,6 +480,15 @@ public class StatisticsRecordingFragment extends Fragment implements TrackDataLi
cadenceSensorView.setText(sensorName); cadenceSensorView.setText(sensorName);
cadenceValueView.setText(sensorValue); cadenceValueView.setText(sensorValue);
} }
/**
* If cadence and hear rate groups are invisible then sensor horizontal line hast to be invisible too.
*/
private void setVisibilitySensorHorizontalLine() {
if (cadenceGroup.getVisibility() != View.VISIBLE && heartRateGroup.getVisibility() != View.VISIBLE) {
sensorHorizontalLine.setVisibility(View.GONE);
}
} }
private void setSpeedSensorData(SensorDataSet sensorDataSet, boolean isRecording) { private void setSpeedSensorData(SensorDataSet sensorDataSet, boolean isRecording) {
@@ -566,7 +571,7 @@ public class StatisticsRecordingFragment extends Fragment implements TrackDataLi
// Make elevation visible? // Make elevation visible?
{ {
boolean showElevation = PreferencesUtils.isShowStatsElevation(getContext()); boolean showElevation = PreferencesUtils.isShowStatsElevation(getContext());
elevationSeparator.setVisibility(showElevation ? View.VISIBLE : View.GONE); elevationGroup.setVisibility(showElevation ? View.VISIBLE : View.GONE);
} }
} }
@@ -595,18 +600,14 @@ public class StatisticsRecordingFragment extends Fragment implements TrackDataLi
private void setLocationValues() { private void setLocationValues() {
boolean metricUnits = PreferencesUtils.isMetricUnits(getContext()); boolean metricUnits = PreferencesUtils.isMetricUnits(getContext());
boolean isRecording = isSelectedTrackRecording();
// Set speed/pace // Set speed/pace
speedContainer.setVisibility(isRecording ? View.VISIBLE : View.INVISIBLE);
if (isRecording) {
double speed = lastTrackPoint != null && lastTrackPoint.hasSpeed() ? lastTrackPoint.getSpeed() : Double.NaN; double speed = lastTrackPoint != null && lastTrackPoint.hasSpeed() ? lastTrackPoint.getSpeed() : Double.NaN;
setSpeed(speed); setSpeed(speed);
}
// Set elevation // Set elevation
boolean showElevation = isRecording && PreferencesUtils.isShowStatsElevation(getContext()); boolean showElevation = PreferencesUtils.isShowStatsElevation(getContext());
elevationContainer.setVisibility(showElevation ? View.VISIBLE : View.GONE); elevationGroup.setVisibility(showElevation ? View.VISIBLE : View.GONE);
if (showElevation) { if (showElevation) {
double altitude = lastTrackPoint != null && lastTrackPoint.hasAltitude() ? lastTrackPoint.getAltitude() : Double.NaN; double altitude = lastTrackPoint != null && lastTrackPoint.hasAltitude() ? lastTrackPoint.getAltitude() : Double.NaN;
@@ -617,10 +618,9 @@ public class StatisticsRecordingFragment extends Fragment implements TrackDataLi
} }
// Set coordinate // Set coordinate
boolean showCoordinate = isRecording && PreferencesUtils.isStatsShowCoordinate(getContext()); boolean showCoordinate = PreferencesUtils.isStatsShowCoordinate(getContext());
coordinateSeparator.setVisibility(showCoordinate ? View.VISIBLE : View.GONE); coordinateGroup.setVisibility(showCoordinate ? View.VISIBLE : View.GONE);
coordinateContainer.setVisibility(showCoordinate ? View.VISIBLE : View.GONE);
if (showCoordinate) { if (showCoordinate) {
double latitude = lastTrackPoint != null ? lastTrackPoint.getLatitude() : Double.NaN; double latitude = lastTrackPoint != null ? lastTrackPoint.getLatitude() : Double.NaN;
String latitudeText = Double.isNaN(latitude) || Double.isInfinite(latitude) ? getContext().getString(R.string.value_unknown) : StringUtils.formatCoordinate(latitude); String latitudeText = Double.isNaN(latitude) || Double.isInfinite(latitude) ? getContext().getString(R.string.value_unknown) : StringUtils.formatCoordinate(latitude);
@@ -42,7 +42,7 @@ import java.util.concurrent.Executors;
import de.dennisguse.opentracks.R; import de.dennisguse.opentracks.R;
import de.dennisguse.opentracks.TrackListActivity; import de.dennisguse.opentracks.TrackListActivity;
import de.dennisguse.opentracks.TrackRecordedActivity; import de.dennisguse.opentracks.TrackRecordingActivity;
import de.dennisguse.opentracks.content.data.Track; import de.dennisguse.opentracks.content.data.Track;
import de.dennisguse.opentracks.content.data.TrackPoint; import de.dennisguse.opentracks.content.data.TrackPoint;
import de.dennisguse.opentracks.content.data.Waypoint; import de.dennisguse.opentracks.content.data.Waypoint;
@@ -743,10 +743,10 @@ public class TrackRecordingService extends Service {
private void showNotification(boolean isGpsStarted) { private void showNotification(boolean isGpsStarted) {
if (isRecording()) { if (isRecording()) {
Intent intent = IntentUtils.newIntent(this, TrackRecordedActivity.class) Intent intent = IntentUtils.newIntent(this, TrackRecordingActivity.class)
.putExtra(TrackRecordedActivity.EXTRA_TRACK_ID, recordingTrackId); .putExtra(TrackRecordingActivity.EXTRA_TRACK_ID, recordingTrackId);
PendingIntent pendingIntent = TaskStackBuilder.create(this) PendingIntent pendingIntent = TaskStackBuilder.create(this)
.addParentStack(TrackRecordedActivity.class) .addParentStack(TrackRecordingActivity.class)
.addNextIntent(intent) .addNextIntent(intent)
.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT); .getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
+145 -109
View File
@@ -1,177 +1,213 @@
<?xml version="1.0" encoding="utf-8"?><!-- <?xml version="1.0" encoding="utf-8"?>
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
style="@style/StatsScrollView"> style="@style/StatsScrollView">
<LinearLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- Horizontal line -->
<View style="@style/StatsHorizontalLine" />
<!-- Distance and activity type -->
<LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<!-- Guidelines -->
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline"
android:layout_width="0dp"
android:layout_height="0dp"
android:orientation="vertical"
app:layout_constraintGuide_begin="8dp" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline2"
android:layout_width="0dp"
android:layout_height="0dp"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline3"
android:layout_width="0dp"
android:layout_height="0dp"
android:orientation="vertical"
app:layout_constraintGuide_end="8dp" />
<!-- Distance --> <!-- Distance -->
<LinearLayout style="@style/StatsLargeItemContainer">
<TextView <TextView
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"
<LinearLayout style="@style/StatsLargeValueContainer"> app:layout_constraintLeft_toRightOf="@+id/guideline"
app:layout_constraintRight_toLeftOf="@+id/guideline2"
app:layout_constraintTop_toTopOf="parent" />
<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_constraintLeft_toRightOf="@+id/guideline"
app:layout_constraintRight_toLeftOf="@+id/stats_distance_unit"
app:layout_constraintTop_toBottomOf="@+id/stats_distance_label"
tools:text="100" />
<TextView <TextView
android:id="@+id/stats_distance_unit" android:id="@+id/stats_distance_unit"
style="@style/StatsUnit" /> style="@style/StatsUnit"
</LinearLayout> app:layout_constraintBottom_toBottomOf="@+id/stats_distance_value"
</LinearLayout> app:layout_constraintLeft_toRightOf="@+id/stats_distance_value"
app:layout_constraintRight_toLeftOf="@+id/guideline2"
tools:text="km" />
<!-- Activity type --> <!-- Activity Type -->
<include <TextView
android:id="@+id/stats_activity_type" android:id="@+id/stats_activity_type_label"
layout="@layout/stats_activity_type" /> style="@style/StatsLargeLabel"
</LinearLayout> android:text="@string/track_edit_activity_type_hint"
app:layout_constrainedWidth="true"
app:layout_constraintLeft_toRightOf="@+id/guideline2"
app:layout_constraintRight_toLeftOf="@+id/guideline3"
app:layout_constraintTop_toTopOf="parent" />
<!-- Total time and moving time --> <Spinner
<LinearLayout android:id="@+id/stats_activity_type_icon"
android:layout_width="match_parent" style="@style/StatsLargeValue"
android:layout_height="wrap_content"> android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toRightOf="@+id/guideline2"
app:layout_constraintRight_toLeftOf="@+id/guideline3"
app:layout_constraintBottom_toBottomOf="@+id/stats_distance_value"
app:layout_constraintTop_toTopOf="@+id/stats_distance_value" />
<!-- Total time --> <!-- Total time -->
<LinearLayout style="@style/StatsLargeItemContainer">
<TextView <TextView
android:id="@+id/stats_total_time_label"
style="@style/StatsLargeLabel" style="@style/StatsLargeLabel"
android:text="@string/stats_total_time" /> android:text="@string/stats_total_time"
app:layout_constrainedWidth="true"
app:layout_constraintLeft_toRightOf="@+id/guideline"
app:layout_constraintRight_toLeftOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/stats_distance_value" />
<TextView <TextView
android:id="@+id/stats_total_time_value" android:id="@+id/stats_total_time_value"
style="@style/StatsLargeValue" /> style="@style/StatsLargeValue"
app:layout_constraintLeft_toRightOf="@+id/guideline"
</LinearLayout> app:layout_constraintRight_toLeftOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/stats_total_time_label"
tools:text="00:00:00" />
<!-- Moving time --> <!-- Moving time -->
<LinearLayout style="@style/StatsLargeItemContainer">
<TextView <TextView
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_constraintLeft_toRightOf="@+id/guideline2"
app:layout_constraintRight_toLeftOf="@+id/guideline3"
app:layout_constraintTop_toTopOf="@+id/stats_total_time_label"
app:layout_constraintBottom_toBottomOf="@+id/stats_total_time_label" />
<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_constraintLeft_toRightOf="@+id/guideline2"
</LinearLayout> app:layout_constraintRight_toLeftOf="@+id/guideline3"
</LinearLayout> app:layout_constraintTop_toBottomOf="@+id/stats_moving_time_label"
tools:text="00:00:00" />
<!-- Horizontal line --> <!-- Horizontal line -->
<View style="@style/StatsHorizontalLine" />
<!-- Speed/pace and average -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- Left empty -->
<View <View
android:layout_width="0dp" android:id="@+id/stats_speed_horizontal_line"
android:layout_height="0dp" style="@style/StatsHorizontalLine"
android:layout_weight="1" /> android:layout_marginBottom="8dp"
app:layout_constraintLeft_toRightOf="@+id/guideline"
<!-- Average --> app:layout_constraintRight_toLeftOf="@+id/guideline3"
<LinearLayout style="@style/StatsSmallItemContainer"> app:layout_constraintTop_toBottomOf="@+id/stats_moving_time_value" />
<!-- 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"
<LinearLayout style="@style/StatsSmallValueContainer"> app:layout_constraintLeft_toRightOf="@+id/guideline2"
app:layout_constraintRight_toLeftOf="@+id/guideline3"
app:layout_constraintTop_toBottomOf="@id/stats_speed_horizontal_line"
tools:text="Avg. Speed" />
<TextView <TextView
android:id="@+id/stats_average_speed_value" android:id="@+id/stats_average_speed_value"
style="@style/StatsSmallValue" style="@style/StatsSmallValue"
android:value="@string/value_unknown" /> android:value="@string/value_unknown"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintLeft_toRightOf="@+id/guideline2"
app:layout_constraintRight_toLeftOf="@+id/stats_average_speed_unit"
app:layout_constraintTop_toBottomOf="@+id/stats_average_speed_label"
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"
</LinearLayout> app:layout_constraintLeft_toRightOf="@+id/stats_average_speed_value"
</LinearLayout> app:layout_constraintRight_toLeftOf="@+id/guideline3"
</LinearLayout> tools:text="km/h" />
<!-- Speed max and moving -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- Speed max --> <!-- Speed max -->
<LinearLayout style="@style/StatsSmallItemContainer">
<TextView <TextView
android:id="@+id/stats_max_speed_label" android:id="@+id/stats_max_speed_label"
style="@style/StatsSmallLabel" /> style="@style/StatsSmallLabel"
app:layout_constrainedWidth="true"
<LinearLayout style="@style/StatsSmallValueContainer"> app:layout_constraintLeft_toRightOf="@+id/guideline"
app:layout_constraintRight_toLeftOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@id/stats_average_speed_value"
tools:text="Max. Speed" />
<TextView <TextView
android:id="@+id/stats_max_speed_value" android:id="@+id/stats_max_speed_value"
style="@style/StatsSmallValue" style="@style/StatsSmallValue"
android:value="@string/value_unknown" /> android:value="@string/value_unknown"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintLeft_toRightOf="@+id/guideline"
app:layout_constraintRight_toLeftOf="@+id/stats_max_speed_unit"
app:layout_constraintTop_toBottomOf="@+id/stats_max_speed_label"
tools:text="30.00" />
<TextView <TextView
android:id="@+id/stats_max_speed_unit" android:id="@+id/stats_max_speed_unit"
style="@style/StatsUnit" /> style="@style/StatsUnit"
</LinearLayout> app:layout_constraintBottom_toBottomOf="@+id/stats_max_speed_value"
app:layout_constraintLeft_toRightOf="@+id/stats_max_speed_value"
</LinearLayout> app:layout_constraintRight_toLeftOf="@+id/guideline2"
tools:text="km/h" />
<!-- Speed moving -->
<LinearLayout style="@style/StatsSmallItemContainer">
<!-- Moving speed max -->
<TextView <TextView
android:id="@+id/stats_moving_speed_label" android:id="@+id/stats_moving_speed_label"
style="@style/StatsSmallLabel" /> style="@style/StatsSmallLabel"
app:layout_constrainedWidth="true"
<LinearLayout style="@style/StatsSmallValueContainer"> app:layout_constraintLeft_toRightOf="@+id/guideline2"
app:layout_constraintRight_toLeftOf="@+id/guideline3"
app:layout_constraintTop_toBottomOf="@id/stats_average_speed_value"
tools:text="Max. Moving Speed" />
<TextView <TextView
android:id="@+id/stats_moving_speed_value" android:id="@+id/stats_moving_speed_value"
style="@style/StatsSmallValue" style="@style/StatsSmallValue"
android:value="@string/value_unknown" /> android:value="@string/value_unknown"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintLeft_toRightOf="@+id/guideline2"
app:layout_constraintRight_toLeftOf="@+id/stats_moving_speed_unit"
app:layout_constraintTop_toBottomOf="@+id/stats_moving_speed_label"
tools:text="30.00" />
<TextView <TextView
android:id="@+id/stats_moving_speed_unit" android:id="@+id/stats_moving_speed_unit"
style="@style/StatsUnit" /> style="@style/StatsUnit"
</LinearLayout> app:layout_constraintBottom_toBottomOf="@+id/stats_moving_speed_value"
</LinearLayout> app:layout_constraintLeft_toRightOf="@+id/stats_moving_speed_value"
</LinearLayout> app:layout_constraintRight_toLeftOf="@+id/guideline3"
tools:text="km/h" />
<View </androidx.constraintlayout.widget.ConstraintLayout>
android:id="@+id/stats_sensor_separator"
style="@style/StatsHorizontalLine" />
</LinearLayout>
</ScrollView> </ScrollView>
+292 -180
View File
@@ -1,318 +1,430 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
style="@style/StatsScrollView"> style="@style/StatsScrollView">
<LinearLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- Distance and activity type -->
<LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<!-- Guidelines -->
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline"
android:layout_width="0dp"
android:layout_height="0dp"
android:orientation="vertical"
app:layout_constraintGuide_begin="8dp" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline2"
android:layout_width="0dp"
android:layout_height="0dp"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline3"
android:layout_width="0dp"
android:layout_height="0dp"
android:orientation="vertical"
app:layout_constraintGuide_end="8dp" />
<!-- Distance --> <!-- Distance -->
<LinearLayout style="@style/StatsLargeItemContainer">
<TextView <TextView
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"
<LinearLayout style="@style/StatsLargeValueContainer"> app:layout_constraintLeft_toRightOf="@+id/guideline"
app:layout_constraintRight_toLeftOf="@+id/guideline2"
app:layout_constraintTop_toTopOf="parent" />
<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_constraintLeft_toRightOf="@+id/guideline"
app:layout_constraintRight_toLeftOf="@+id/stats_distance_unit"
app:layout_constraintTop_toBottomOf="@+id/stats_distance_label"
tools:text="100" />
<TextView <TextView
android:id="@+id/stats_distance_unit" android:id="@+id/stats_distance_unit"
style="@style/StatsUnit" /> style="@style/StatsUnit"
</LinearLayout> app:layout_constraintBottom_toBottomOf="@+id/stats_distance_value"
</LinearLayout> app:layout_constraintLeft_toRightOf="@+id/stats_distance_value"
app:layout_constraintRight_toLeftOf="@+id/guideline2"
tools:text="km" />
<!-- Activity type --> <!-- Activity Type -->
<include <TextView
android:id="@+id/stats_activity_type" android:id="@+id/stats_activity_type_label"
layout="@layout/stats_activity_type" /> style="@style/StatsLargeLabel"
</LinearLayout> android:text="@string/track_edit_activity_type_hint"
app:layout_constrainedWidth="true"
app:layout_constraintLeft_toRightOf="@+id/guideline2"
app:layout_constraintRight_toLeftOf="@+id/guideline3"
app:layout_constraintTop_toTopOf="parent" />
<!-- Total time and moving time --> <Spinner
<LinearLayout android:id="@+id/stats_activity_type_icon"
android:layout_width="match_parent" style="@style/StatsLargeValue"
android:layout_height="wrap_content"> android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toRightOf="@+id/guideline2"
app:layout_constraintRight_toLeftOf="@+id/guideline3"
app:layout_constraintBottom_toBottomOf="@+id/stats_distance_value"
app:layout_constraintTop_toTopOf="@+id/stats_distance_value" />
<!-- Total time --> <!-- Total time -->
<LinearLayout style="@style/StatsLargeItemContainer">
<TextView <TextView
android:id="@+id/stats_total_time_label"
style="@style/StatsLargeLabel" style="@style/StatsLargeLabel"
android:text="@string/stats_total_time" /> android:text="@string/stats_total_time"
app:layout_constrainedWidth="true"
app:layout_constraintLeft_toRightOf="@+id/guideline"
app:layout_constraintRight_toLeftOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/stats_distance_value" />
<TextView <TextView
android:id="@+id/stats_total_time_value" android:id="@+id/stats_total_time_value"
style="@style/StatsLargeValue" /> style="@style/StatsLargeValue"
app:layout_constraintLeft_toRightOf="@+id/guideline"
</LinearLayout> app:layout_constraintRight_toLeftOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/stats_total_time_label"
tools:text="00:00:00" />
<!-- Moving time --> <!-- Moving time -->
<LinearLayout style="@style/StatsLargeItemContainer">
<TextView <TextView
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_constraintLeft_toRightOf="@+id/guideline2"
app:layout_constraintRight_toLeftOf="@+id/guideline3"
app:layout_constraintTop_toTopOf="@+id/stats_total_time_label"
app:layout_constraintBottom_toBottomOf="@+id/stats_total_time_label" />
<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_constraintLeft_toRightOf="@+id/guideline2"
</LinearLayout> app:layout_constraintRight_toLeftOf="@+id/guideline3"
</LinearLayout> app:layout_constraintTop_toBottomOf="@+id/stats_moving_time_label"
tools:text="00:00:00" />
<!-- Horizontal line --> <!-- Horizontal line -->
<View style="@style/StatsHorizontalLine" /> <View
android:id="@+id/stats_speed_horizontal_line"
<!-- Speed/pace and average --> style="@style/StatsHorizontalLine"
<LinearLayout android:layout_marginBottom="8dp"
android:layout_width="match_parent" app:layout_constraintLeft_toRightOf="@+id/guideline"
android:layout_height="wrap_content"> app:layout_constraintRight_toLeftOf="@+id/guideline3"
app:layout_constraintTop_toBottomOf="@+id/stats_moving_time_value" />
<!-- Speed/pace --> <!-- Speed/pace -->
<LinearLayout
android:id="@+id/stats_speed"
style="@style/StatsSmallItemContainer">
<TextView <TextView
android:id="@+id/stats_speed_label" android:id="@+id/stats_speed_label"
style="@style/StatsSmallLabel" /> style="@style/StatsSmallLabel"
app:layout_constrainedWidth="true"
<LinearLayout style="@style/StatsSmallValueContainer"> app:layout_constraintLeft_toRightOf="@+id/guideline"
app:layout_constraintRight_toLeftOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@id/stats_speed_horizontal_line"
tools:text="Speed" />
<TextView <TextView
android:id="@+id/stats_speed_value" android:id="@+id/stats_speed_value"
style="@style/StatsSmallValue" style="@style/StatsSmallValue"
android:value="@string/value_unknown" /> android:value="@string/value_unknown"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintLeft_toRightOf="@+id/guideline"
app:layout_constraintRight_toLeftOf="@+id/stats_speed_unit"
app:layout_constraintTop_toBottomOf="@+id/stats_speed_label"
tools:text="30.00" />
<TextView <TextView
android:id="@+id/stats_speed_unit" android:id="@+id/stats_speed_unit"
style="@style/StatsUnit" /> style="@style/StatsUnit"
</LinearLayout> app:layout_constraintBottom_toBottomOf="@+id/stats_speed_value"
</LinearLayout> app:layout_constraintLeft_toRightOf="@+id/stats_speed_value"
app:layout_constraintRight_toLeftOf="@+id/guideline2"
<!-- Average --> tools:text="km/h" />
<LinearLayout style="@style/StatsSmallItemContainer">
<!-- 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"
<LinearLayout style="@style/StatsSmallValueContainer"> app:layout_constraintLeft_toRightOf="@+id/guideline2"
app:layout_constraintRight_toLeftOf="@+id/guideline3"
app:layout_constraintTop_toBottomOf="@id/stats_speed_horizontal_line"
tools:text="Avg. Speed" />
<TextView <TextView
android:id="@+id/stats_average_speed_value" android:id="@+id/stats_average_speed_value"
style="@style/StatsSmallValue" style="@style/StatsSmallValue"
android:value="@string/value_unknown" /> android:value="@string/value_unknown"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintLeft_toRightOf="@+id/guideline2"
app:layout_constraintRight_toLeftOf="@+id/stats_average_speed_unit"
app:layout_constraintTop_toBottomOf="@+id/stats_average_speed_label"
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"
</LinearLayout> app:layout_constraintLeft_toRightOf="@+id/stats_average_speed_value"
</LinearLayout> app:layout_constraintRight_toLeftOf="@+id/guideline3"
</LinearLayout> tools:text="km/h" />
<!-- Speed max and moving -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- Speed max --> <!-- Speed max -->
<LinearLayout style="@style/StatsSmallItemContainer">
<TextView <TextView
android:id="@+id/stats_max_speed_label" android:id="@+id/stats_max_speed_label"
style="@style/StatsSmallLabel" /> style="@style/StatsSmallLabel"
app:layout_constrainedWidth="true"
<LinearLayout style="@style/StatsSmallValueContainer"> app:layout_constraintLeft_toRightOf="@+id/guideline"
app:layout_constraintRight_toLeftOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@id/stats_average_speed_value"
tools:text="Max. Speed" />
<TextView <TextView
android:id="@+id/stats_max_speed_value" android:id="@+id/stats_max_speed_value"
style="@style/StatsSmallValue" style="@style/StatsSmallValue"
android:value="@string/value_unknown" /> android:value="@string/value_unknown"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintLeft_toRightOf="@+id/guideline"
app:layout_constraintRight_toLeftOf="@+id/stats_max_speed_unit"
app:layout_constraintTop_toBottomOf="@+id/stats_max_speed_label"
tools:text="30.00" />
<TextView <TextView
android:id="@+id/stats_max_speed_unit" android:id="@+id/stats_max_speed_unit"
style="@style/StatsUnit" /> style="@style/StatsUnit"
</LinearLayout> app:layout_constraintBottom_toBottomOf="@+id/stats_max_speed_value"
app:layout_constraintLeft_toRightOf="@+id/stats_max_speed_value"
</LinearLayout> app:layout_constraintRight_toLeftOf="@+id/guideline2"
tools:text="km/h" />
<!-- Speed moving -->
<LinearLayout style="@style/StatsSmallItemContainer">
<!-- Moving speed max -->
<TextView <TextView
android:id="@+id/stats_moving_speed_label" android:id="@+id/stats_moving_speed_label"
style="@style/StatsSmallLabel" /> style="@style/StatsSmallLabel"
app:layout_constrainedWidth="true"
<LinearLayout style="@style/StatsSmallValueContainer"> app:layout_constraintLeft_toRightOf="@+id/guideline2"
app:layout_constraintRight_toLeftOf="@+id/guideline3"
app:layout_constraintTop_toBottomOf="@id/stats_average_speed_value"
tools:text="Max. Moving Speed" />
<TextView <TextView
android:id="@+id/stats_moving_speed_value" android:id="@+id/stats_moving_speed_value"
style="@style/StatsSmallValue" style="@style/StatsSmallValue"
android:value="@string/value_unknown" /> android:value="@string/value_unknown"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintLeft_toRightOf="@+id/guideline2"
app:layout_constraintRight_toLeftOf="@+id/stats_moving_speed_unit"
app:layout_constraintTop_toBottomOf="@+id/stats_moving_speed_label"
tools:text="30.00" />
<TextView <TextView
android:id="@+id/stats_moving_speed_unit" android:id="@+id/stats_moving_speed_unit"
style="@style/StatsUnit" /> style="@style/StatsUnit"
</LinearLayout> app:layout_constraintBottom_toBottomOf="@+id/stats_moving_speed_value"
</LinearLayout> app:layout_constraintLeft_toRightOf="@+id/stats_moving_speed_value"
</LinearLayout> app:layout_constraintRight_toLeftOf="@+id/guideline3"
tools:text="km/h" />
<!-- Horizontal line -->
<View <View
android:id="@+id/stats_elevation_separator" android:id="@+id/stats_elevation_horizontal_line"
style="@style/StatsHorizontalLine" /> style="@style/StatsHorizontalLine"
android:layout_marginBottom="8dp"
<LinearLayout app:layout_constraintLeft_toRightOf="@+id/guideline"
android:id="@+id/stats_elevation_container" app:layout_constraintRight_toLeftOf="@+id/guideline3"
android:layout_width="match_parent" app:layout_constraintTop_toBottomOf="@+id/stats_moving_speed_value" />
android:layout_height="wrap_content">
<LinearLayout style="@style/StatsSmallGroupContainer">
<!-- This is a placeholder -->
</LinearLayout>
<!-- Elevation -->
<LinearLayout style="@style/StatsSmallGroupContainer">
<TextView
style="@style/StatsSmallLabel"
android:text="@string/stats_elevation" />
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center">
<!-- Current elevation --> <!-- Current elevation -->
<LinearLayout <androidx.constraintlayout.widget.Group
style="@style/StatsSmallValueContainer" android:id="@+id/stats_elevation_current_group"
android:layout_gravity="start|bottom"> android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:constraint_referenced_ids="stats_elevation_current_label,stats_elevation_current_value,stats_elevation_current_unit,stats_elevation_horizontal_line" />
<TextView
android:id="@+id/stats_elevation_current_label"
style="@style/StatsSmallLabel"
android:text="@string/stats_elevation"
app:layout_constrainedWidth="true"
app:layout_constraintLeft_toRightOf="@+id/guideline2"
app:layout_constraintRight_toLeftOf="@+id/guideline3"
app:layout_constraintTop_toBottomOf="@id/stats_elevation_horizontal_line" />
<TextView <TextView
android:id="@+id/stats_elevation_current_value" android:id="@+id/stats_elevation_current_value"
style="@style/StatsSmallValue" style="@style/StatsSmallValue"
android:value="@string/value_unknown" /> android:value="@string/value_unknown"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintLeft_toRightOf="@+id/guideline2"
app:layout_constraintRight_toLeftOf="@+id/stats_elevation_current_unit"
app:layout_constraintTop_toBottomOf="@+id/stats_elevation_current_label"
tools:text="100" />
<TextView <TextView
android:id="@+id/stats_elevation_current_unit" android:id="@+id/stats_elevation_current_unit"
style="@style/StatsUnit" /> style="@style/StatsUnit"
</LinearLayout> app:layout_constraintBottom_toBottomOf="@+id/stats_elevation_current_value"
</TableLayout> app:layout_constraintLeft_toRightOf="@+id/stats_elevation_current_value"
</LinearLayout> app:layout_constraintRight_toLeftOf="@+id/guideline3"
</LinearLayout> tools:text="m" />
<!-- Coordinate group -->
<androidx.constraintlayout.widget.Group
android:id="@+id/stats_coordinate_group"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:constraint_referenced_ids="stats_latitude_label,stats_latitude_value,stats_longitude_label,stats_longitude_value,stats_coordinate_horizontal_line" />
<!-- Horizontal line --> <!-- Horizontal line -->
<View <View
android:id="@+id/stats_coordinate_separator" android:id="@+id/stats_coordinate_horizontal_line"
style="@style/StatsHorizontalLine" /> style="@style/StatsHorizontalLine"
android:layout_marginBottom="8dp"
<!-- Latitude and longitude --> app:layout_constraintLeft_toRightOf="@+id/guideline"
<LinearLayout app:layout_constraintRight_toLeftOf="@+id/guideline3"
android:id="@+id/stats_coordinate_container" app:layout_constraintTop_toBottomOf="@+id/stats_elevation_current_value" />
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout style="@style/StatsSmallItemContainer">
<!-- Latitude -->
<TextView <TextView
android:id="@+id/stats_latitude_label"
style="@style/StatsSmallLabel" style="@style/StatsSmallLabel"
android:text="@string/stats_latitude" /> android:text="@string/stats_latitude"
app:layout_constrainedWidth="true"
app:layout_constraintLeft_toRightOf="@+id/guideline"
app:layout_constraintRight_toLeftOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@id/stats_coordinate_horizontal_line" />
<TextView <TextView
android:id="@+id/stats_latitude_value" android:id="@+id/stats_latitude_value"
style="@style/StatsSmallValue" /> style="@style/StatsSmallValue"
app:layout_constraintLeft_toRightOf="@+id/guideline"
</LinearLayout> app:layout_constraintRight_toLeftOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/stats_latitude_label"
<LinearLayout style="@style/StatsSmallItemContainer"> tools:text="0.834937848" />
<!-- Longitude -->
<TextView <TextView
android:id="@+id/stats_longitude_label"
style="@style/StatsSmallLabel" style="@style/StatsSmallLabel"
android:text="@string/stats_longitude" /> android:text="@string/stats_longitude"
app:layout_constrainedWidth="true"
app:layout_constraintLeft_toRightOf="@+id/guideline2"
app:layout_constraintRight_toLeftOf="@+id/guideline3"
app:layout_constraintTop_toBottomOf="@id/stats_coordinate_horizontal_line" />
<TextView <TextView
android:id="@+id/stats_longitude_value" android:id="@+id/stats_longitude_value"
style="@style/StatsSmallValue" style="@style/StatsSmallValue"
android:value="@string/value_unknown" /> android:value="@string/value_unknown"
app:layout_constraintLeft_toRightOf="@+id/guideline2"
</LinearLayout> app:layout_constraintRight_toLeftOf="@+id/guideline3"
</LinearLayout> app:layout_constraintTop_toBottomOf="@+id/stats_longitude_label"
tools:text="0.834937848" />
<!-- Horizontal line -->
<View <View
android:id="@+id/stats_sensor_separator" android:id="@+id/stats_sensor_horizontal_line"
style="@style/StatsHorizontalLine" /> style="@style/StatsHorizontalLine"
android:layout_marginBottom="8dp"
app:layout_constraintLeft_toRightOf="@+id/guideline"
app:layout_constraintRight_toLeftOf="@+id/guideline3"
app:layout_constraintTop_toBottomOf="@+id/stats_latitude_value" />
<!-- Sensor data --> <!-- Heart rate -->
<LinearLayout <androidx.constraintlayout.widget.Group
android:layout_width="match_parent" android:id="@+id/stats_sensor_heart_rate_group"
android:layout_height="wrap_content"> android:layout_width="wrap_content"
android:layout_height="wrap_content"
<LinearLayout app:constraint_referenced_ids="stats_sensor_heart_rate_label,stats_sensor_heart_rate_sensor_value,stats_sensor_heart_rate_value,stats_sensor_heart_rate_unit" />
android:id="@+id/stats_sensor_heart_rate_container"
style="@style/StatsLargeItemContainer">
<TextView <TextView
android:id="@+id/stats_sensor_heart_rate_label"
style="@style/StatsLargeLabel" style="@style/StatsLargeLabel"
android:text="@string/sensor_state_heart_rate" /> android:text="@string/sensor_state_heart_rate"
app:layout_constrainedWidth="true"
app:layout_constraintLeft_toRightOf="@+id/guideline"
app:layout_constraintRight_toLeftOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@id/stats_sensor_horizontal_line" />
<TextView <TextView
android:id="@+id/stats_sensor_heart_rate_sensor_value" android:id="@+id/stats_sensor_heart_rate_sensor_value"
style="@style/StatsTinyValue" style="@style/StatsTinyValue"
android:text="@string/value_unknown" /> android:text="@string/value_unknown"
app:layout_constraintLeft_toRightOf="@+id/guideline"
<LinearLayout style="@style/StatsLargeValueContainer"> app:layout_constraintRight_toLeftOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/stats_sensor_heart_rate_label"
tools:text="90" />
<TextView <TextView
android:id="@+id/stats_sensor_heart_rate_value" android:id="@+id/stats_sensor_heart_rate_value"
style="@style/StatsLargeValue" style="@style/StatsLargeValue"
android:value="@string/value_unknown" /> android:value="@string/value_unknown"
app:layout_constraintLeft_toRightOf="@+id/guideline"
app:layout_constraintRight_toLeftOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/stats_sensor_heart_rate_sensor_value"
tools:text="90" />
<TextView <TextView
android:id="@+id/stats_sensor_heart_rate_unit"
style="@style/StatsUnit" style="@style/StatsUnit"
android:text="@string/sensor_unit_beats_per_minute" /> android:text="@string/sensor_unit_beats_per_minute"
app:layout_constraintLeft_toRightOf="@+id/guideline"
app:layout_constraintRight_toLeftOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/stats_sensor_heart_rate_value" />
</LinearLayout> <!-- Cadence -->
<androidx.constraintlayout.widget.Group
</LinearLayout> android:id="@+id/stats_sensor_cadence_group"
android:layout_width="wrap_content"
<LinearLayout android:layout_height="wrap_content"
android:id="@+id/stats_sensor_cadence_container" app:constraint_referenced_ids="stats_sensor_cadence_label,stats_sensor_cadence_sensor_value,stats_sensor_cadence_value,stats_sensor_cadence_unit" />
style="@style/StatsLargeItemContainer">
<TextView <TextView
android:id="@+id/stats_sensor_cadence_label"
style="@style/StatsLargeLabel" style="@style/StatsLargeLabel"
android:text="@string/sensor_state_cadence" /> android:text="@string/sensor_state_cadence"
app:layout_constrainedWidth="true"
app:layout_constraintLeft_toRightOf="@+id/guideline2"
app:layout_constraintRight_toLeftOf="@+id/guideline3"
app:layout_constraintTop_toBottomOf="@id/stats_sensor_horizontal_line" />
<TextView <TextView
android:id="@+id/stats_sensor_cadence_sensor_value" android:id="@+id/stats_sensor_cadence_sensor_value"
style="@style/StatsTinyValue" style="@style/StatsTinyValue"
android:text="@string/value_unknown" /> android:text="@string/value_unknown"
app:layout_constraintLeft_toRightOf="@+id/guideline2"
<LinearLayout style="@style/StatsLargeValueContainer"> app:layout_constraintRight_toLeftOf="@+id/guideline3"
app:layout_constraintTop_toBottomOf="@+id/stats_sensor_cadence_label"
tools:text="90" />
<TextView <TextView
android:id="@+id/stats_sensor_cadence_value" android:id="@+id/stats_sensor_cadence_value"
style="@style/StatsLargeValue" style="@style/StatsLargeValue"
android:value="@string/value_unknown" /> android:value="@string/value_unknown"
app:layout_constraintLeft_toRightOf="@+id/guideline2"
app:layout_constraintRight_toLeftOf="@+id/guideline3"
app:layout_constraintTop_toBottomOf="@+id/stats_sensor_cadence_sensor_value"
tools:text="90" />
<TextView <TextView
android:id="@+id/stats_sensor_cadence_unit"
style="@style/StatsUnit" style="@style/StatsUnit"
android:text="@string/sensor_unit_rounds_per_minute" /> android:text="@string/sensor_unit_rounds_per_minute"
app:layout_constraintLeft_toRightOf="@+id/guideline2"
app:layout_constraintRight_toLeftOf="@+id/guideline3"
app:layout_constraintTop_toBottomOf="@+id/stats_sensor_cadence_value" />
</LinearLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView> </ScrollView>
+5 -2
View File
@@ -117,8 +117,7 @@ limitations under the License.
<style name="StatsHorizontalLine"> <style name="StatsHorizontalLine">
<item name="android:background">@color/stats_separator</item> <item name="android:background">@color/stats_separator</item>
<item name="android:layout_height">1dp</item> <item name="android:layout_height">1dp</item>
<item name="android:layout_marginLeft">8dp</item> <item name="android:layout_margin">8dp</item>
<item name="android:layout_marginRight">8dp</item>
<item name="android:layout_width">match_parent</item> <item name="android:layout_width">match_parent</item>
</style> </style>
<!-- stats large item container --> <!-- stats large item container -->
@@ -140,6 +139,9 @@ limitations under the License.
<item name="android:textAllCaps">true</item> <item name="android:textAllCaps">true</item>
<item name="android:textColor">@color/stats_large_label</item> <item name="android:textColor">@color/stats_large_label</item>
<item name="android:textStyle">bold</item> <item name="android:textStyle">bold</item>
<item name="android:paddingLeft">4dp</item>
<item name="android:paddingRight">4dp</item>
<item name="android:layout_marginTop">16dp</item>
</style> </style>
<style name="StatsLargeValue"> <style name="StatsLargeValue">
@@ -179,6 +181,7 @@ limitations under the License.
<item name="android:singleLine">false</item> <item name="android:singleLine">false</item>
<item name="android:textAllCaps">true</item> <item name="android:textAllCaps">true</item>
<item name="android:textStyle">bold</item> <item name="android:textStyle">bold</item>
<item name="android:layout_marginTop">16dp</item>
</style> </style>
<!-- stats small value --> <!-- stats small value -->
<style name="StatsSmallValue" parent="@style/TextLarge"> <style name="StatsSmallValue" parent="@style/TextLarge">