forked from upstream-mirrors/OpenTracks
Code cleanup using AndroidStudio.
This commit is contained in:
@@ -203,7 +203,6 @@ public class ContentProviderUtils {
|
||||
contentResolver.delete(MarkerColumns.CONTENT_URI, MarkerColumns.TRACKID + "=?", selectionArgs);
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
public List<Track> getTracks() {
|
||||
ArrayList<Track> tracks = new ArrayList<>();
|
||||
try (Cursor cursor = getTrackCursor(null, null, TracksColumns._ID)) {
|
||||
@@ -217,19 +216,6 @@ public class ContentProviderUtils {
|
||||
return tracks;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
//TODO Do not use; rather get the proper TrackId (e.g., resume a track might give you some weird effects).
|
||||
@VisibleForTesting
|
||||
public Track getLastTrack() {
|
||||
try (Cursor cursor = getTrackCursor(null, null, TracksColumns.STARTTIME + " DESC")) {
|
||||
// Using the same order as shown in the track list
|
||||
if (cursor != null && cursor.moveToNext()) {
|
||||
return createTrack(cursor);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param trackId the track id.
|
||||
*/
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ public class ChooseActivityTypeDialogFragment extends DialogFragment implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
viewBinding = ChooseActivityTypeBinding.inflate(inflater, container, false);
|
||||
|
||||
List<Integer> imageIds = new ArrayList<>();
|
||||
|
||||
@@ -54,14 +54,14 @@ public class ErrorListDialog extends DialogFragment {
|
||||
outState.putStringArrayList(EXTRA_ERROR_LIST, errorList);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
final String[] tracks = errorList.stream().toArray(String[]::new);
|
||||
final String[] tracks = errorList.toArray(new String[0]);
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getActivity())
|
||||
.setTitle(title)
|
||||
.setItems(tracks, null)
|
||||
.setPositiveButton(R.string.generic_ok, (dialog, which) -> dismiss());
|
||||
AlertDialog dialog = alertDialogBuilder.create();
|
||||
return dialog;
|
||||
return alertDialogBuilder.create();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user