Merge branch 'master' of ssh://github.com/osmandapp/Osmand into PaulsBranch

This commit is contained in:
PaulStets 2018-05-31 13:56:23 +03:00
commit 33e973d684

View file

@ -607,27 +607,29 @@ public class TrackActivityFragmentAdapter implements TrackBitmapDrawerListener {
} }
} }
private void addOptionSplit(int value, boolean distance, List<GpxDisplayGroup> model) { private void addOptionSplit(int value, boolean distance, @NonNull List<GpxDisplayGroup> model) {
if (distance) { if (model.size() > 0) {
double dvalue = OsmAndFormatter.calculateRoundedDist(value, app); if (distance) {
options.add(OsmAndFormatter.getFormattedDistance((float) dvalue, app)); double dvalue = OsmAndFormatter.calculateRoundedDist(value, app);
distanceSplit.add(dvalue); options.add(OsmAndFormatter.getFormattedDistance((float) dvalue, app));
timeSplit.add(-1); distanceSplit.add(dvalue);
if (Math.abs(model.get(0).getSplitDistance() - dvalue) < 1) { timeSplit.add(-1);
selectedSplitInterval = distanceSplit.size() - 1; if (Math.abs(model.get(0).getSplitDistance() - dvalue) < 1) {
} selectedSplitInterval = distanceSplit.size() - 1;
} else { }
if (value < 60) {
options.add(value + " " + app.getString(R.string.int_seconds));
} else if (value % 60 == 0) {
options.add((value / 60) + " " + app.getString(R.string.int_min));
} else { } else {
options.add((value / 60f) + " " + app.getString(R.string.int_min)); if (value < 60) {
} options.add(value + " " + app.getString(R.string.int_seconds));
distanceSplit.add(-1d); } else if (value % 60 == 0) {
timeSplit.add(value); options.add((value / 60) + " " + app.getString(R.string.int_min));
if (model.get(0).getSplitTime() == value) { } else {
selectedSplitInterval = distanceSplit.size() - 1; options.add((value / 60f) + " " + app.getString(R.string.int_min));
}
distanceSplit.add(-1d);
timeSplit.add(value);
if (model.get(0).getSplitTime() == value) {
selectedSplitInterval = distanceSplit.size() - 1;
}
} }
} }
} }