forked from upstream-mirrors/OpenTracks
Cleanup.
This commit is contained in:
@@ -112,8 +112,7 @@ The API is disabled by default to protect the user's privacy, but it can easily
|
||||
`Classes`:
|
||||
* **Start a recording:** `de.dennisguse.opentracks.publicapi.StartRecording`
|
||||
* Set track data: `TRACK_NAME`, `TRACK_DESCRIPTION`, `TRACK_CATEGORY`, and `TRACK_ICON` (
|
||||
non-localized identifier
|
||||
see [/src/main/java/de/dennisguse/opentracks/util/TrackIconUtils.java#L38](/src/main/java/de/dennisguse/opentracks/util/TrackIconUtils.java#L38)).
|
||||
see `ActivityType.id` defined in [/src/main/java/de/dennisguse/opentracks/util/TrackIconUtils.java#L38](/src/main/java/de/dennisguse/opentracks/data/model/ActivityType.java)).
|
||||
NOTE: if `TRACK_ICON` is not present, `TRACK_CATEGORY` will be used to determine the icon (
|
||||
localized).
|
||||
* Send recorded data to another application via _Dashboard API_: `STATS_TARGET_PACKAGE` and
|
||||
|
||||
+2
@@ -9,6 +9,7 @@ import android.location.Location;
|
||||
import android.location.LocationManager;
|
||||
import android.os.Looper;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.location.LocationManagerCompat;
|
||||
import androidx.test.core.app.ApplicationProvider;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
@@ -738,6 +739,7 @@ public class TrackRecordingServiceRecordingTest {
|
||||
return true;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public AltitudeGainLoss getAggregatedValue(Instant now) {
|
||||
return new AltitudeGainLoss(altitudeGain, altitudeGain);
|
||||
|
||||
@@ -118,7 +118,7 @@ public class ChartView extends View {
|
||||
private final GestureDetectorCompat detectorScrollFlingTab = new GestureDetectorCompat(getContext(), new GestureDetector.SimpleOnGestureListener() {
|
||||
|
||||
@Override
|
||||
public boolean onDown(MotionEvent e) {
|
||||
public boolean onDown(@NonNull MotionEvent e) {
|
||||
if (!scroller.isFinished()) {
|
||||
scroller.abortAnimation();
|
||||
}
|
||||
@@ -126,7 +126,7 @@ public class ChartView extends View {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
|
||||
public boolean onScroll(MotionEvent e1, @NonNull MotionEvent e2, float distanceX, float distanceY) {
|
||||
if (Math.abs(distanceX) > 0) {
|
||||
int availableToScroll = effectiveWidth * (zoomLevel - 1) - getScrollX();
|
||||
if (availableToScroll > 0) {
|
||||
@@ -137,7 +137,7 @@ public class ChartView extends View {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
|
||||
public boolean onFling(MotionEvent e1, @NonNull MotionEvent e2, float velocityX, float velocityY) {
|
||||
fling((int) -velocityX);
|
||||
return true;
|
||||
}
|
||||
@@ -147,7 +147,7 @@ public class ChartView extends View {
|
||||
private final ScaleGestureDetector detectorZoom = new ScaleGestureDetector(getContext(), new ScaleGestureDetector.SimpleOnScaleGestureListener() {
|
||||
|
||||
@Override
|
||||
public boolean onScale(ScaleGestureDetector detector) {
|
||||
public boolean onScale(@NonNull ScaleGestureDetector detector) {
|
||||
float scaleFactor = detector.getScaleFactor();
|
||||
if (scaleFactor >= 1.1f) {
|
||||
zoomIn();
|
||||
|
||||
@@ -4,10 +4,6 @@ import androidx.annotation.NonNull;
|
||||
|
||||
public class ParsingException extends RuntimeException {
|
||||
|
||||
protected ParsingException(@NonNull String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
protected ParsingException(@NonNull String message, Exception cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
@@ -15,6 +11,6 @@ public class ParsingException extends RuntimeException {
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return "" + getMessage();
|
||||
return getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import android.widget.ArrayAdapter;
|
||||
import android.widget.AutoCompleteTextView;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.preference.DialogPreference;
|
||||
import androidx.preference.PreferenceDialogFragmentCompat;
|
||||
|
||||
@@ -71,7 +72,7 @@ public class ActivityTypePreference extends DialogPreference {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onBindDialogView(View view) {
|
||||
protected void onBindDialogView(@NonNull View view) {
|
||||
super.onBindDialogView(view);
|
||||
|
||||
final Context context = getActivity();
|
||||
|
||||
@@ -3,6 +3,7 @@ package de.dennisguse.opentracks.settings;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.preference.ListPreference;
|
||||
import androidx.preference.Preference;
|
||||
@@ -48,7 +49,7 @@ public class DefaultsSettingsFragment extends PreferenceFragmentCompat implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisplayPreferenceDialog(Preference preference) {
|
||||
public void onDisplayPreferenceDialog(@NonNull Preference preference) {
|
||||
DialogFragment dialogFragment = null;
|
||||
if (preference instanceof ActivityTypePreference) {
|
||||
activityPreferenceDialog = ActivityTypePreference.ActivityPreferenceDialog.newInstance(preference.getKey());
|
||||
|
||||
+2
-1
@@ -17,6 +17,7 @@ import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.preference.DialogPreference;
|
||||
import androidx.preference.PreferenceDialogFragmentCompat;
|
||||
@@ -234,7 +235,7 @@ public abstract class BluetoothLeSensorPreference extends DialogPreference {
|
||||
|
||||
//Behave like ListPreferenceDialogFragmentCompat, but uses a custom listAdapter.
|
||||
@Override
|
||||
protected void onPrepareDialogBuilder(AlertDialog.Builder builder) {
|
||||
protected void onPrepareDialogBuilder(@NonNull AlertDialog.Builder builder) {
|
||||
super.onPrepareDialogBuilder(builder);
|
||||
|
||||
builder.setSingleChoiceItems(listAdapter, selectedEntryIndex,
|
||||
|
||||
@@ -3,6 +3,8 @@ package de.dennisguse.opentracks.ui.customRecordingLayout;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class DataField implements Parcelable {
|
||||
@@ -88,6 +90,7 @@ public class DataField implements Parcelable {
|
||||
return Objects.hash(key, isVisible, isPrimary, isWide);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DataField{" +
|
||||
|
||||
@@ -216,7 +216,7 @@ public class StringUtils {
|
||||
.setUnit(unitSystem)
|
||||
.build(context);
|
||||
|
||||
Distance distance = altitude_m != null ? Distance.of(altitude_m) : Distance.of((Double) null);
|
||||
Distance distance = altitude_m != null ? Distance.of(altitude_m) : Distance.of(null);
|
||||
return formatter.getDistanceParts(distance);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user