commit c8db0f89d49e9b6ef360ecc4529cb58fd5715f0e Author: Fabio Mazza Date: Tue Nov 18 14:54:16 2025 +0100 Fix bearing also in LinesDetailFragment diff --git a/app/src/main/java/it/reyboz/bustorino/fragments/LinesDetailFragment.kt b/app/src/main/java/it/reyboz/bustorino/fragments/LinesDetailFragment.kt index 9d2ddf6..2b792f5 100644 --- a/app/src/main/java/it/reyboz/bustorino/fragments/LinesDetailFragment.kt +++ b/app/src/main/java/it/reyboz/bustorino/fragments/LinesDetailFragment.kt @@ -1256,6 +1256,10 @@ class LinesDetailFragment() : GeneralMapLibreFragment() { val samePosition = oldPos?.let { (it.latitude==newPos.latitude)&&(it.longitude == newPos.longitude) }?:false val setPattern = (oldPattern==null) && (patternStops!=null) + if(newPos.bearing == null && oldPos?.bearing != null){ + //copy old bearing + newPos.bearing = oldPos.bearing + } if((!samePosition)|| setPattern) { val newOrOldPosInBounds = isPointInsideVisibleRegion( @@ -1343,10 +1347,11 @@ class LinesDetailFragment() : GeneralMapLibreFragment() { latLng = animation.animatedValue as LatLng //update position on animation val update = updatesByVehDict[positionUpdate.vehicle] - if(update!=null) latLng?.let { ll-> + if(update!=null){ latLng?.let { ll -> update.posUpdate.latitude = ll.latitude update.posUpdate.longitude = ll.longitude updatePositionsIcons(false) + } } else{ //The update is null Log.w(DEBUG_TAG, "The bus position to animate has been removed, but the animator is still running!")