Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/r4.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
vshcherb committed Jul 28, 2023
2 parents 69a49dd + e898e6f commit 7d584ef
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 15 deletions.
14 changes: 7 additions & 7 deletions OsmAnd-java/src/main/java/net/osmand/gpx/GPXFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -263,13 +263,13 @@ public GPXUtilities.TrkSegment getGeneralSegment() {
}

private void buildGeneralSegment() {
GPXUtilities.TrkSegment segment = new GPXUtilities.TrkSegment();
for (GPXUtilities.Track track : tracks) {
for (GPXUtilities.TrkSegment s : track.segments) {
if (s.points.size() > 0) {
List<GPXUtilities.WptPt> waypoints = new ArrayList<>(s.points.size());
for (GPXUtilities.WptPt wptPt : s.points) {
waypoints.add(new GPXUtilities.WptPt(wptPt));
TrkSegment segment = new TrkSegment();
for (Track track : tracks) {
for (TrkSegment trkSegment : track.segments) {
if (trkSegment.points.size() > 0) {
List<WptPt> waypoints = new ArrayList<>(trkSegment.points.size());
for (WptPt wptPt : trkSegment.points) {
waypoints.add(new WptPt(wptPt));
}
waypoints.get(0).firstPoint = true;
waypoints.get(waypoints.size() - 1).lastPoint = true;
Expand Down
1 change: 1 addition & 0 deletions OsmAnd-java/src/main/java/net/osmand/gpx/GPXUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ public WptPt(WptPt wptPt) {
this.slopeColor = wptPt.slopeColor;
this.colourARGB = wptPt.colourARGB;
this.distance = wptPt.distance;
getExtensionsToWrite().putAll(wptPt.getExtensionsToWrite());
}

public void setDistance(double dist) {
Expand Down
2 changes: 1 addition & 1 deletion OsmAnd/src/net/osmand/plus/auto/FavoritesScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ protected int getConstraintLimitType() {
}

private void setupFavorites(ItemList.Builder listBuilder) {
LatLon location = getApp().getSettings().getLastKnownMapLocation();
LatLon location = getApp().getMapViewTrackingUtilities().getDefaultLocation();
List<FavouritePoint> favoritesPoints = getFavorites();
int favoritesPointsSize = favoritesPoints.size();
List<FavouritePoint> limitedFavoritesPoints = favoritesPoints.subList(0, Math.min(favoritesPointsSize, getContentLimit() - 1));
Expand Down
3 changes: 1 addition & 2 deletions OsmAnd/src/net/osmand/plus/auto/HistoryScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import android.text.Spanned
import androidx.car.app.CarContext
import androidx.car.app.constraints.ConstraintManager
import androidx.car.app.model.*
import androidx.car.app.navigation.model.PlaceListNavigationTemplate
import androidx.core.graphics.drawable.IconCompat
import net.osmand.data.LatLon
import net.osmand.plus.R
Expand All @@ -26,7 +25,7 @@ class HistoryScreen(
val app = app
val historyHelper = SearchHistoryHelper.getInstance(app)
val results = historyHelper.getHistoryEntries(true)
val location = app.settings.lastKnownMapLocation
val location = app.mapViewTrackingUtilities.defaultLocation
val resultsSize = results.size
val limitedResults = results.subList(0, resultsSize.coerceAtMost(contentLimit - 1))
for (result in limitedResults) {
Expand Down
2 changes: 1 addition & 1 deletion OsmAnd/src/net/osmand/plus/auto/MapMarkersScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class MapMarkersScreen(
val markersSize = app.mapMarkersHelper.mapMarkers.size
val markers =
app.mapMarkersHelper.mapMarkers.subList(0, markersSize.coerceAtMost(contentLimit - 1))
val location = app.settings.lastKnownMapLocation
val location = app.mapViewTrackingUtilities.defaultLocation
app.osmandMap.mapLayers.mapMarkersLayer.setCustomMapObjects(markers)
val mapRect = QuadRect()
if (!Algorithms.isEmpty(markers)) {
Expand Down
2 changes: 1 addition & 1 deletion OsmAnd/src/net/osmand/plus/auto/POIScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class POIScreen(
}

private fun setupPOI(listBuilder: ItemList.Builder, searchResults: List<SearchResult>?) {
val location = app.settings.lastKnownMapLocation
val location = app.mapViewTrackingUtilities.defaultLocation
val mapPoint = ArrayList<Amenity>()
val mapRect = QuadRect()
searchResults?.let {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public static OrderedLineDataSet createSensorDataSet(@NonNull OsmandApplication

Pair<Float, Float> pair = ChartUtils.getScalingY(app, graphType);
float mulY = pair != null ? pair.first : 1f;
float divY = pair != null ? pair.second : 1f;
float divY = pair != null ? pair.second : Float.NaN;

boolean speedInTrack = analysis.hasSpeedInTrack();
int textColor = ColorUtilities.getColor(app, graphType.getTextColorId(!speedInTrack));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,7 @@ public void onDraw(Canvas canvas, RotatedTileBox tb, DrawSettings settings) {
wasPinchZoomOrRotation = true;
}

boolean showTwoFingersDistance = !wasPinchZoomOrRotation &&
!view.isWasZoomInMultiTouch() &&
boolean showTwoFingersDistance =
currentTime - view.getMultiTouchStartTime() > DELAY_BEFORE_DRAW &&
(view.isMultiTouch() || currentTime - cacheMultiTouchEndTime < DRAW_TIME);

Expand Down

0 comments on commit 7d584ef

Please sign in to comment.