This commit is contained in:
Dimitris
2026-03-23 07:10:26 +01:00
parent d1968cfa68
commit bc8a53a5d8
13 changed files with 78 additions and 59 deletions

View File

@@ -130,9 +130,8 @@ object Constants {
const val TRAFFIC_UPDATE = 300
const val ROUTE_UPDATE = 60
const val INSTRUCTION_DISTANCE = 50
const val GMS_CAR_SPEED_PERMISSION = "com.google.android.gms.permission.CAR_SPEED"
const val AUTOMOTIVE_CAR_SPEED_PERMISSION = "android.car.permission.CAR_SPEED"

View File

@@ -105,15 +105,6 @@ data class Route(
}
}
fun nextStep(add: Int): Step {
val nextIndex = currentStepIndex + add
return if (isRouteValid() && nextIndex < legs().first().steps.size) {
legs().first().steps[nextIndex]
} else {
currentStep()
}
}
fun maneuverLocations(): List<Point> {
val waypoints = currentStep().maneuver.waypoints
val points = mutableListOf<Point>()
@@ -123,4 +114,13 @@ data class Route(
}
return points
}
fun nextStep(add: Int): Step {
val nextIndex = currentStepIndex + add
return if (isRouteValid() && nextIndex < legs().first().steps.size) {
legs().first().steps[nextIndex]
} else {
currentStep()
}
}
}

View File

@@ -19,9 +19,9 @@ const val tomtomTrafficUrl = "https://api.tomtom.com/traffic/services/5/incident
private const val tomtomFields =
"{incidents{type,geometry{type,coordinates},properties{iconCategory,events{description}}}}"
const val useLocal = false
const val useLocal = true
const val useLocalTraffic = false
const val useLocalTraffic = true
class TomTomRepository : NavigationRepository() {

View File

@@ -4,6 +4,7 @@ import android.content.Context
import android.location.Location
import android.location.LocationManager
import androidx.car.app.model.Distance
import com.kouros.navigation.data.Constants.TILT
import com.kouros.navigation.data.RouteEngine
import com.kouros.navigation.data.osrm.OsrmRepository
import com.kouros.navigation.data.tomtom.TomTomRepository
@@ -93,7 +94,7 @@ fun calculateTilt(newZoom: Double, tilt: Double): Double =
0.0
} else {
if (tilt == 0.0) {
55.0
TILT
} else {
tilt
}