mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-07 11:53:07 +02:00
Merge heads
This commit is contained in:
+8
@@ -129,6 +129,14 @@ public class DynamicSpeedTrackPathDescriptor implements TrackPathDescriptor {
|
||||
int getSpeedMargin() {
|
||||
return speedMargin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the speed margin.
|
||||
*/
|
||||
@VisibleForTesting
|
||||
void setSpeedMargin(int value) {
|
||||
speedMargin = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the average moving speed.
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.google.android.gms.maps.GoogleMap;
|
||||
import com.google.android.gms.maps.model.LatLng;
|
||||
import com.google.android.gms.maps.model.Polyline;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
@@ -102,7 +103,8 @@ public class MultiColorTrackPath implements TrackPath {
|
||||
TrackPathUtils.addPath(googleMap, paths, lastSegmentPoints, lastSegmentColor, useLastPolyline);
|
||||
}
|
||||
|
||||
private int getColor(int speed) {
|
||||
@VisibleForTesting
|
||||
protected int getColor(int speed) {
|
||||
if (speed <= trackPathDescriptor.getSlowSpeed()) {
|
||||
return slowColor;
|
||||
} else if (speed <= trackPathDescriptor.getNormalSpeed()) {
|
||||
@@ -111,4 +113,16 @@ public class MultiColorTrackPath implements TrackPath {
|
||||
return fastColor;
|
||||
}
|
||||
}
|
||||
|
||||
public int getSlowColor() {
|
||||
return slowColor;
|
||||
}
|
||||
|
||||
public int getNormalColor() {
|
||||
return normalColor;
|
||||
}
|
||||
|
||||
public int getFastColor() {
|
||||
return fastColor;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user