This commit is contained in:
Dennis Guse
2021-07-01 22:37:18 +02:00
parent 5899235b2b
commit c289fd174d
10 changed files with 9 additions and 27 deletions
@@ -22,7 +22,6 @@ import androidx.annotation.Nullable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.stream.Collectors;
import de.dennisguse.opentracks.content.data.Track;
@@ -42,7 +42,7 @@ public abstract class ShowOnMapProxyActivity extends AppCompatActivity {
* @param trackIds the track ids
*/
private static void showTrackfileFormat(Context context, TrackFileFormat trackFileFormat, Set<Track.Id> trackIds) {
if (trackIds.size() == 0) {
if (trackIds.isEmpty()) {
return;
}
@@ -416,21 +416,6 @@ public class ContentProviderUtils {
return markers;
}
//TODO Move to testing package
@Deprecated
public int getMarkerCount(Track.Id trackId) {
String[] projection = new String[]{"count(*) AS count"};
String selection = MarkerColumns.TRACKID + "=?";
String[] selectionArgs = new String[]{Long.toString(trackId.getId())};
try (Cursor cursor = contentResolver.query(MarkerColumns.CONTENT_URI, projection, selection, selectionArgs, MarkerColumns._ID)) {
if (cursor == null) {
return 0;
}
cursor.moveToFirst();
return cursor.getInt(0);
}
}
/**
* @return the content provider URI of the inserted marker.
*/
@@ -77,7 +77,7 @@ public class ShareContentProvider extends CustomContentProvider {
}
public static Pair<Uri, String> createURI(Set<Track.Id> trackIds, String trackName, @NonNull TrackFileFormat trackFileFormat) {
if (trackIds.size() == 0) {
if (trackIds.isEmpty()) {
throw new UnsupportedOperationException();
}
@@ -64,7 +64,6 @@ public class IntervalsFragment extends Fragment {
/**
* Creates an instance of this class.
*
* @param trackId
* @param fromTopToBottom If true then the intervals are shown from top to bottom (the first interval on top). Otherwise the intervals are shown from bottom to top.
* @return IntervalsFragment instance.
*/
@@ -136,7 +136,7 @@ public class IntentUtils {
uris.add(marker.getPhotoURI());
}
if (uris.size() == 0) {
if (uris.isEmpty()) {
return null;
}
@@ -37,7 +37,6 @@ public class IntervalStatistics {
/**
* Complete intervals with the tracks points from the iterator.
*
* @param trackPointIterator
* @return the last track point's id used to compute the intervals.
*/
public TrackPoint.Id addTrackPoints(TrackPointIterator trackPointIterator) {