mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-03 01:53:05 +02:00
On ChartView, show either the speed or the pace label depending on the
user preference. On StatsActivity, draw the unit label.
This commit is contained in:
@@ -118,7 +118,8 @@ public class StatsActivity extends Activity implements TrackDataListener {
|
||||
sv.setScrollBarStyle(ScrollView.SCROLLBARS_OUTSIDE_INSET);
|
||||
|
||||
showUnknownLocation();
|
||||
|
||||
updateLabels();
|
||||
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
||||
if (metrics.heightPixels > 600) {
|
||||
@@ -153,24 +154,22 @@ public class StatsActivity extends Activity implements TrackDataListener {
|
||||
|
||||
@Override
|
||||
public boolean onUnitsChanged(boolean metric) {
|
||||
// Ignore if unchanged.
|
||||
if (metric == utils.isMetricUnits()) return false;
|
||||
|
||||
if (utils.isMetricUnits() == metric) {
|
||||
return false;
|
||||
}
|
||||
utils.setMetricUnits(metric);
|
||||
updateLabels();
|
||||
|
||||
return true; // Reload data
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onReportSpeedChanged(boolean displaySpeed) {
|
||||
// Ignore if unchanged.
|
||||
if (displaySpeed == utils.isReportSpeed()) return false;
|
||||
|
||||
utils.setReportSpeed(displaySpeed);
|
||||
public boolean onReportSpeedChanged(boolean speed) {
|
||||
if (utils.isReportSpeed() == speed) {
|
||||
return false;
|
||||
}
|
||||
utils.setReportSpeed(speed);
|
||||
updateLabels();
|
||||
|
||||
return true; // Reload data
|
||||
return true;
|
||||
}
|
||||
|
||||
private void updateLabels() {
|
||||
|
||||
Reference in New Issue
Block a user