-
-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix #1957 open MarkerEditActivity to receive external marker #1960
Conversation
I pulled out the location retrieval from the |
Long story short: yes, duration and distance are only for the charts. Best guess, we should just remove these as it doesn't always fit. For the API, I would just leave these values empty. If you want to have fun, you can also remove duration and distance:) |
@dennisguse don't tell me to delete something. I love removing unused code 😉 What is your opinion with |
What about creating a new activity like .api.CreateMarker? Then this activity can do the parsing, security checks (if necessary), and we do not expose an internal activity;) |
And the DB migration is missing - deletion comes with ugly parts :) |
That's a good idea. I'll do that. So external interface is separated from the internal. Should we do it for the |
I see the ugly part now. Is it really necessary to drop the two columns from the DB? They are nullable anyway. For the public API part, I've created two new Activities for it which receive the external extras from the Intent and forward to the internal Activities if appropriate. Do we want to allow that only if the public API is enabled? The ShowMarkerActivity might be ok, but the CreateMarkerActivity writes to the DB. |
Public API: better safe than sorry. |
I know, seen that 😉 Ok, I've added DB version 38 with upgrade and downgrade methods. |
src/main/java/de/dennisguse/opentracks/publicapi/CreateMarkerActivity.java
Outdated
Show resolved
Hide resolved
src/main/java/de/dennisguse/opentracks/publicapi/CreateMarkerActivity.java
Outdated
Show resolved
Hide resolved
src/main/java/de/dennisguse/opentracks/publicapi/CreateMarkerActivity.java
Outdated
Show resolved
Hide resolved
src/main/java/de/dennisguse/opentracks/publicapi/CreateMarkerActivity.java
Outdated
Show resolved
Hide resolved
src/main/java/de/dennisguse/opentracks/publicapi/CreateMarkerActivity.java
Outdated
Show resolved
Hide resolved
src/main/java/de/dennisguse/opentracks/publicapi/ShowMarkerActivity.java
Outdated
Show resolved
Hide resolved
src/main/java/de/dennisguse/opentracks/services/TrackRecordingManager.java
Outdated
Show resolved
Hide resolved
|
||
private static final String CAMERA_PHOTO_URI_KEY = "camera_photo_uri_key"; | ||
|
||
private static final String NEW_MARKER_ID = "new_marker_id"; | ||
|
||
private static final String TAG = MarkerEditActivity.class.getSimpleName(); | ||
private Track.Id trackId; | ||
private Location location; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have an internal value object for location.
Reason was that the android location requires lat/lng which is sometimes not present (e.g. only elevation via barometer).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is that? Even TrackPoint is using the android Location.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't there a link to a Position class or record I saw in the email?
src/main/java/de/dennisguse/opentracks/ui/markers/MarkerEditActivity.java
Outdated
Show resolved
Hide resolved
src/main/java/de/dennisguse/opentracks/publicapi/CreateMarkerActivity.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
markers.clear(); | ||
// TODO: why do we need to match the markers with the TrackPoints? We will loose the manual added from the map. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dennisguse what do we do here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old stuff. Back then there was code to only import markers that could be mapped to one TrackPoint. But that is not needed anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More to delete 🙌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gone
Squashing and reordering commits and this is good to go? |
Squashing can be done here via the Web UI as well. What do you have in mind with reordering? |
@pstorch if you would want separate commits ;) |
Opens MarkerEditActivity to be able to receive external marker for a (completed) track.