mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-09-30 16:52:21 +02:00
Disabled presentation of elevation gain as it used currently derived from the GPS signal alone and therefore very imprecise.
This commit is contained in:
Generated
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
||||
@@ -79,7 +79,7 @@ public class PreferencesUtils {
|
||||
// Stats
|
||||
public static final String STATS_RATE_DEFAULT = "SPEED";
|
||||
public static final boolean STATS_SHOW_COORDINATE_DEFAULT = false;
|
||||
public static final boolean STATS_SHOW_GRADE_ELEVATION_DEFAULT = false;
|
||||
public static final boolean STATS_SHOW_ELEVATION_DEFAULT = false;
|
||||
public static final String STATS_UNITS_DEFAULT = "METRIC";
|
||||
|
||||
public static final String TRACK_NAME_DEFAULT = "DATE_ISO_8601";
|
||||
|
||||
@@ -68,7 +68,7 @@ public class StatsUtils {
|
||||
}
|
||||
|
||||
// Set elevation
|
||||
boolean showGradeElevation = PreferencesUtils.getBoolean(context, R.string.stats_show_grade_elevation_key, PreferencesUtils.STATS_SHOW_GRADE_ELEVATION_DEFAULT) && isRecording;
|
||||
boolean showGradeElevation = PreferencesUtils.getBoolean(context, R.string.stats_show_grade_elevation_key, PreferencesUtils.STATS_SHOW_ELEVATION_DEFAULT) && isRecording;
|
||||
View elevation = getView(activity, view, R.id.stats_elevation);
|
||||
elevation.setVisibility(showGradeElevation ? View.VISIBLE : View.GONE);
|
||||
|
||||
@@ -168,26 +168,18 @@ public class StatsUtils {
|
||||
setSpeed(context, getView(activity, view, R.id.stats_average_moving_speed), R.string.stats_average_moving_speed, R.string.stats_average_moving_pace, averageMovingSpeed, metricUnits, reportSpeed);
|
||||
|
||||
// Set grade/elevation
|
||||
boolean showGradeElevation = PreferencesUtils.getBoolean(context, R.string.stats_show_grade_elevation_key, PreferencesUtils.STATS_SHOW_GRADE_ELEVATION_DEFAULT);
|
||||
View gradeElevationSeparator = getView(activity, view, R.id.stats_grade_elevation_separator);
|
||||
gradeElevationSeparator.setVisibility(showGradeElevation ? View.VISIBLE : View.GONE);
|
||||
boolean showElevation = PreferencesUtils.getBoolean(context, R.string.stats_show_grade_elevation_key, PreferencesUtils.STATS_SHOW_ELEVATION_DEFAULT);
|
||||
View gradeElevationSeparator = getView(activity, view, R.id.stats_elevation_separator);
|
||||
gradeElevationSeparator.setVisibility(showElevation ? View.VISIBLE : View.GONE);
|
||||
|
||||
View gradeElevationContainer = getView(activity, view, R.id.stats_grade_elevation_container);
|
||||
gradeElevationContainer.setVisibility(showGradeElevation ? View.VISIBLE : View.GONE);
|
||||
|
||||
if (showGradeElevation) {
|
||||
// Set grade
|
||||
double minGrade = tripStatistics == null ? Double.NaN : tripStatistics.getMinGrade();
|
||||
double maxGrade = tripStatistics == null ? Double.NaN : tripStatistics.getMaxGrade();
|
||||
setGradeValue(context, getView(activity, view, R.id.stats_grade_min), R.string.stats_min, minGrade);
|
||||
setGradeValue(context, getView(activity, view, R.id.stats_grade_max), R.string.stats_max, maxGrade);
|
||||
View gradeElevationContainer = getView(activity, view, R.id.stats_elevation_container);
|
||||
gradeElevationContainer.setVisibility(showElevation ? View.VISIBLE : View.GONE);
|
||||
|
||||
if (showElevation) {
|
||||
// Set elevation
|
||||
double elevationGain = tripStatistics == null ? Double.NaN : tripStatistics.getTotalElevationGain();
|
||||
double minElevation = tripStatistics == null ? Double.NaN : tripStatistics.getMinElevation();
|
||||
double maxElevation = tripStatistics == null ? Double.NaN : tripStatistics.getMaxElevation();
|
||||
setElevationValue(context, getView(activity, view, R.id.stats_elevation_gain), R.string.stats_gain, elevationGain, metricUnits);
|
||||
setElevationValue(context, getView(activity, view, R.id.stats_elevation_min), R.string.stats_min, minElevation, metricUnits);
|
||||
double maxElevation = tripStatistics == null ? Double.NaN : tripStatistics.getMaxElevation();
|
||||
setElevationValue(context, getView(activity, view, R.id.stats_elevation_max), R.string.stats_max, maxElevation, metricUnits);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,36 +94,18 @@ limitations under the License.
|
||||
</TableLayout>
|
||||
<!-- Vertical line -->
|
||||
<View
|
||||
android:id="@+id/stats_grade_elevation_separator"
|
||||
android:id="@+id/stats_elevation_separator"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/stats_separator" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/stats_grade_elevation_container"
|
||||
android:id="@+id/stats_elevation_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
<!-- Grade -->
|
||||
<LinearLayout style="@style/StatsSmallGroupContainer">
|
||||
<!-- Grade label -->
|
||||
<TextView
|
||||
style="@style/StatsSmallLabel"
|
||||
android:text="@string/stats_grade" />
|
||||
|
||||
<TableLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center">
|
||||
<!-- Grade min -->
|
||||
<include
|
||||
android:id="@+id/stats_grade_min"
|
||||
layout="@layout/stats_small_group_item" />
|
||||
<!-- Grade max -->
|
||||
<include
|
||||
android:id="@+id/stats_grade_max"
|
||||
layout="@layout/stats_small_group_item" />
|
||||
</TableLayout>
|
||||
<!-- This is a placeholder -->
|
||||
</LinearLayout>
|
||||
<!-- Elevation -->
|
||||
<LinearLayout style="@style/StatsSmallGroupContainer">
|
||||
@@ -140,10 +122,11 @@ limitations under the License.
|
||||
<include
|
||||
android:id="@+id/stats_elevation"
|
||||
layout="@layout/stats_small_group_item" />
|
||||
<!-- TODO DISABLED AS computation from GPS is not precise enough, go for getAltitude(SensorManager.PRESSURE_STANDARD_ATMOSPHERE, pressure) -->
|
||||
<!-- Elevation gain -->
|
||||
<include
|
||||
android:id="@+id/stats_elevation_gain"
|
||||
layout="@layout/stats_small_group_item" />
|
||||
<!--<include-->
|
||||
<!--android:id="@+id/stats_elevation_gain"-->
|
||||
<!--layout="@layout/stats_small_group_item" />-->
|
||||
<!-- Elevation min -->
|
||||
<include
|
||||
android:id="@+id/stats_elevation_min"
|
||||
|
||||
@@ -70,33 +70,15 @@ limitations under the License.
|
||||
</LinearLayout>
|
||||
<!-- Horizontal line -->
|
||||
<View
|
||||
android:id="@+id/stats_grade_elevation_separator"
|
||||
android:id="@+id/stats_elevation_separator"
|
||||
style="@style/StatsHorizontalLine" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/stats_grade_elevation_container"
|
||||
android:id="@+id/stats_elevation_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<!-- Grade -->
|
||||
<LinearLayout style="@style/StatsSmallGroupContainer">
|
||||
<!-- Grade label -->
|
||||
<TextView
|
||||
style="@style/StatsSmallLabel"
|
||||
android:text="@string/stats_grade" />
|
||||
|
||||
<TableLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center">
|
||||
<!-- Grade min -->
|
||||
<include
|
||||
android:id="@+id/stats_grade_min"
|
||||
layout="@layout/stats_small_group_item" />
|
||||
<!-- Grade max -->
|
||||
<include
|
||||
android:id="@+id/stats_grade_max"
|
||||
layout="@layout/stats_small_group_item" />
|
||||
</TableLayout>
|
||||
<!-- This is a placeholder -->
|
||||
</LinearLayout>
|
||||
<!-- Elevation -->
|
||||
<LinearLayout style="@style/StatsSmallGroupContainer">
|
||||
@@ -114,14 +96,13 @@ limitations under the License.
|
||||
android:id="@+id/stats_elevation"
|
||||
layout="@layout/stats_small_group_item" />
|
||||
<!-- Elevation gain -->
|
||||
<include
|
||||
android:id="@+id/stats_elevation_gain"
|
||||
layout="@layout/stats_small_group_item" />
|
||||
<!-- Elevation min -->
|
||||
<!-- TODO DISABLED AS computation from GPS is not precise enough, go for getAltitude(SensorManager.PRESSURE_STANDARD_ATMOSPHERE, pressure) -->
|
||||
<!--<include-->
|
||||
<!--android:id="@+id/stats_elevation_gain"-->
|
||||
<!--layout="@layout/stats_small_group_item" />-->
|
||||
<include
|
||||
android:id="@+id/stats_elevation_min"
|
||||
layout="@layout/stats_small_group_item" />
|
||||
<!-- Elevation max -->
|
||||
<include
|
||||
android:id="@+id/stats_elevation_max"
|
||||
layout="@layout/stats_small_group_item" />
|
||||
|
||||
Reference in New Issue
Block a user