forked from upstream-mirrors/OpenTracks
Fix Map View to improve the initial camera position after screen rotation.
If showing a marker, after rotation, will zoom to the marker. If showing a track, after rotation, will zoom to the current location if is recording and is in tracking mode, else will zoom to the track.
This commit is contained in:
@@ -252,6 +252,12 @@ public interface MyTracksProviderUtils {
|
||||
*/
|
||||
public Location getLastValidTrackPoint(long trackId);
|
||||
|
||||
|
||||
/**
|
||||
* Gets the last valid location.
|
||||
*/
|
||||
public Location getLastValidTrackPoint();
|
||||
|
||||
/**
|
||||
* Creates a location cursor. The caller owns the returned cursor and is
|
||||
* responsible for closing it.
|
||||
|
||||
+8
@@ -816,6 +816,14 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils {
|
||||
return findTrackPointBy(selection, selectionArgs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location getLastValidTrackPoint() {
|
||||
String selection = TrackPointsColumns._ID + "=(select max(" + TrackPointsColumns._ID + ") from "
|
||||
+ TrackPointsColumns.TABLE_NAME + " WHERE " + TrackPointsColumns.LATITUDE + "<="
|
||||
+ MAX_LATITUDE + ")";
|
||||
return findTrackPointBy(selection, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Cursor getTrackPointCursor(
|
||||
long trackId, long startTrackPointId, int maxLocations, boolean descending) {
|
||||
|
||||
Reference in New Issue
Block a user