forked from upstream-mirrors/OpenTracks
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"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<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" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ public class PreferencesUtils {
|
|||||||
// Stats
|
// Stats
|
||||||
public static final String STATS_RATE_DEFAULT = "SPEED";
|
public static final String STATS_RATE_DEFAULT = "SPEED";
|
||||||
public static final boolean STATS_SHOW_COORDINATE_DEFAULT = false;
|
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 STATS_UNITS_DEFAULT = "METRIC";
|
||||||
|
|
||||||
public static final String TRACK_NAME_DEFAULT = "DATE_ISO_8601";
|
public static final String TRACK_NAME_DEFAULT = "DATE_ISO_8601";
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public class StatsUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set elevation
|
// 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);
|
View elevation = getView(activity, view, R.id.stats_elevation);
|
||||||
elevation.setVisibility(showGradeElevation ? View.VISIBLE : View.GONE);
|
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);
|
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
|
// Set grade/elevation
|
||||||
boolean showGradeElevation = PreferencesUtils.getBoolean(context, R.string.stats_show_grade_elevation_key, PreferencesUtils.STATS_SHOW_GRADE_ELEVATION_DEFAULT);
|
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_grade_elevation_separator);
|
View gradeElevationSeparator = getView(activity, view, R.id.stats_elevation_separator);
|
||||||
gradeElevationSeparator.setVisibility(showGradeElevation ? View.VISIBLE : View.GONE);
|
gradeElevationSeparator.setVisibility(showElevation ? View.VISIBLE : View.GONE);
|
||||||
|
|
||||||
View gradeElevationContainer = getView(activity, view, R.id.stats_grade_elevation_container);
|
View gradeElevationContainer = getView(activity, view, R.id.stats_elevation_container);
|
||||||
gradeElevationContainer.setVisibility(showGradeElevation ? View.VISIBLE : View.GONE);
|
gradeElevationContainer.setVisibility(showElevation ? 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);
|
|
||||||
|
|
||||||
|
if (showElevation) {
|
||||||
// Set elevation
|
// Set elevation
|
||||||
double elevationGain = tripStatistics == null ? Double.NaN : tripStatistics.getTotalElevationGain();
|
|
||||||
double minElevation = tripStatistics == null ? Double.NaN : tripStatistics.getMinElevation();
|
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);
|
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);
|
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>
|
</TableLayout>
|
||||||
<!-- Vertical line -->
|
<!-- Vertical line -->
|
||||||
<View
|
<View
|
||||||
android:id="@+id/stats_grade_elevation_separator"
|
android:id="@+id/stats_elevation_separator"
|
||||||
android:layout_width="1dp"
|
android:layout_width="1dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/stats_separator" />
|
android:background="@color/stats_separator" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/stats_grade_elevation_container"
|
android:id="@+id/stats_elevation_container"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1">
|
android:layout_weight="1">
|
||||||
<!-- Grade -->
|
|
||||||
<LinearLayout style="@style/StatsSmallGroupContainer">
|
<LinearLayout style="@style/StatsSmallGroupContainer">
|
||||||
<!-- Grade label -->
|
<!-- This is a placeholder -->
|
||||||
<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>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<!-- Elevation -->
|
<!-- Elevation -->
|
||||||
<LinearLayout style="@style/StatsSmallGroupContainer">
|
<LinearLayout style="@style/StatsSmallGroupContainer">
|
||||||
@@ -140,10 +122,11 @@ limitations under the License.
|
|||||||
<include
|
<include
|
||||||
android:id="@+id/stats_elevation"
|
android:id="@+id/stats_elevation"
|
||||||
layout="@layout/stats_small_group_item" />
|
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 -->
|
<!-- Elevation gain -->
|
||||||
<include
|
<!--<include-->
|
||||||
android:id="@+id/stats_elevation_gain"
|
<!--android:id="@+id/stats_elevation_gain"-->
|
||||||
layout="@layout/stats_small_group_item" />
|
<!--layout="@layout/stats_small_group_item" />-->
|
||||||
<!-- Elevation min -->
|
<!-- Elevation min -->
|
||||||
<include
|
<include
|
||||||
android:id="@+id/stats_elevation_min"
|
android:id="@+id/stats_elevation_min"
|
||||||
|
|||||||
@@ -70,33 +70,15 @@ limitations under the License.
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<!-- Horizontal line -->
|
<!-- Horizontal line -->
|
||||||
<View
|
<View
|
||||||
android:id="@+id/stats_grade_elevation_separator"
|
android:id="@+id/stats_elevation_separator"
|
||||||
style="@style/StatsHorizontalLine" />
|
style="@style/StatsHorizontalLine" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/stats_grade_elevation_container"
|
android:id="@+id/stats_elevation_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
<!-- Grade -->
|
|
||||||
<LinearLayout style="@style/StatsSmallGroupContainer">
|
<LinearLayout style="@style/StatsSmallGroupContainer">
|
||||||
<!-- Grade label -->
|
<!-- This is a placeholder -->
|
||||||
<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>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<!-- Elevation -->
|
<!-- Elevation -->
|
||||||
<LinearLayout style="@style/StatsSmallGroupContainer">
|
<LinearLayout style="@style/StatsSmallGroupContainer">
|
||||||
@@ -114,14 +96,13 @@ limitations under the License.
|
|||||||
android:id="@+id/stats_elevation"
|
android:id="@+id/stats_elevation"
|
||||||
layout="@layout/stats_small_group_item" />
|
layout="@layout/stats_small_group_item" />
|
||||||
<!-- Elevation gain -->
|
<!-- Elevation gain -->
|
||||||
<include
|
<!-- TODO DISABLED AS computation from GPS is not precise enough, go for getAltitude(SensorManager.PRESSURE_STANDARD_ATMOSPHERE, pressure) -->
|
||||||
android:id="@+id/stats_elevation_gain"
|
<!--<include-->
|
||||||
layout="@layout/stats_small_group_item" />
|
<!--android:id="@+id/stats_elevation_gain"-->
|
||||||
<!-- Elevation min -->
|
<!--layout="@layout/stats_small_group_item" />-->
|
||||||
<include
|
<include
|
||||||
android:id="@+id/stats_elevation_min"
|
android:id="@+id/stats_elevation_min"
|
||||||
layout="@layout/stats_small_group_item" />
|
layout="@layout/stats_small_group_item" />
|
||||||
<!-- Elevation max -->
|
|
||||||
<include
|
<include
|
||||||
android:id="@+id/stats_elevation_max"
|
android:id="@+id/stats_elevation_max"
|
||||||
layout="@layout/stats_small_group_item" />
|
layout="@layout/stats_small_group_item" />
|
||||||
|
|||||||
Reference in New Issue
Block a user