forked from upstream-mirrors/OpenTracks
Cleanup.
This commit is contained in:
+2
-5
@@ -32,7 +32,6 @@ import org.mockito.junit.MockitoJUnitRunner;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import de.dennisguse.opentracks.content.ContentProviderUtils.LocationFactory;
|
||||
@@ -455,8 +454,7 @@ public class CustomContentProviderUtilsImplTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generateTrackDescription(Track aTrack, Vector<Double> distances,
|
||||
Vector<Double> elevations, boolean html) {
|
||||
public String generateTrackDescription(Track aTrack, boolean html) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@@ -511,8 +509,7 @@ public class CustomContentProviderUtilsImplTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generateTrackDescription(Track aTrack, Vector<Double> distances,
|
||||
Vector<Double> elevations, boolean html) {
|
||||
public String generateTrackDescription(Track aTrack, boolean html) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@ public class DescriptionGeneratorImplTest {
|
||||
+ "Min grade: 11 %<br>"
|
||||
+ "Recorded: " + StringUtils.formatDateTime(context, START_TIME) + "<br>";
|
||||
|
||||
Assert.assertEquals(expected, descriptionGenerator.generateTrackDescription(track, null, null, true));
|
||||
Assert.assertEquals(expected, descriptionGenerator.generateTrackDescription(track, true));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,8 +17,6 @@ package de.dennisguse.opentracks.content;
|
||||
|
||||
import de.dennisguse.opentracks.stats.TripStatistics;
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
/**
|
||||
* An interface for an object that can generate descriptions of track and
|
||||
* waypoint.
|
||||
@@ -31,12 +29,9 @@ public interface DescriptionGenerator {
|
||||
* Generates a track description.
|
||||
*
|
||||
* @param track the track
|
||||
* @param distances a vector of distances to generate the elevation chart
|
||||
* @param elevations a vector of elevations to generate the elevation chart
|
||||
* @param html true to output html, false to output plain text
|
||||
*/
|
||||
String generateTrackDescription(
|
||||
Track track, Vector<Double> distances, Vector<Double> elevations, boolean html);
|
||||
String generateTrackDescription(Track track, boolean html);
|
||||
|
||||
/**
|
||||
* Generate a waypoint description from a trip statistics.
|
||||
|
||||
@@ -20,8 +20,6 @@ import android.content.Context;
|
||||
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
import de.dennisguse.opentracks.R;
|
||||
import de.dennisguse.opentracks.stats.TripStatistics;
|
||||
import de.dennisguse.opentracks.util.StringUtils;
|
||||
@@ -44,7 +42,7 @@ public class DescriptionGeneratorImpl implements DescriptionGenerator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generateTrackDescription(Track track, Vector<Double> distances, Vector<Double> elevations, boolean html) {
|
||||
public String generateTrackDescription(Track track, boolean html) {
|
||||
String paragraphSeparator = html ? HTML_PARAGRAPH_SEPARATOR : TEXT_PARAGRAPH_SEPARATOR;
|
||||
String lineBreak = html ? HTML_LINE_BREAK : TEXT_LINE_BREAK;
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
@@ -208,7 +208,7 @@ public class KmlTrackWriter implements TrackWriter {
|
||||
printWriter.println("</gx:MultiTrack>");
|
||||
printWriter.println("</Placemark>");
|
||||
String name = context.getString(R.string.marker_label_end, track.getName());
|
||||
String description = descriptionGenerator.generateTrackDescription(track, null, null, false);
|
||||
String description = descriptionGenerator.generateTrackDescription(track, false);
|
||||
writePlacemark(name, "", description, END_STYLE, endLocation);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,14 +20,14 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import de.dennisguse.opentracks.R;
|
||||
import de.dennisguse.opentracks.content.ContentProviderUtils;
|
||||
import de.dennisguse.opentracks.content.DescriptionGeneratorImpl;
|
||||
import de.dennisguse.opentracks.content.Track;
|
||||
import de.dennisguse.opentracks.content.Waypoint;
|
||||
import de.dennisguse.opentracks.io.file.TrackFileFormat;
|
||||
import de.dennisguse.opentracks.R;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* Utilities for creating intents.
|
||||
@@ -60,7 +60,7 @@ public class IntentUtils {
|
||||
*/
|
||||
public static Intent newShareFileIntent(Context context, long trackId, String filePath, TrackFileFormat trackFileFormat) {
|
||||
Track track = ContentProviderUtils.Factory.get(context).getTrack(trackId);
|
||||
String trackDescription = track == null ? "" : new DescriptionGeneratorImpl(context).generateTrackDescription(track, null, null, false);
|
||||
String trackDescription = track == null ? "" : new DescriptionGeneratorImpl(context).generateTrackDescription(track, false);
|
||||
|
||||
return new Intent(Intent.ACTION_SEND)
|
||||
.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(filePath)))
|
||||
|
||||
Reference in New Issue
Block a user