Pass the location's satellites through the constructor.

This commit is contained in:
voussoir 2022-04-03 00:55:26 -07:00
parent 0c510d4a11
commit c3922240e0
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -42,10 +42,28 @@ data class WayPoint(@Expose val provider: String,
@Expose var starred: Boolean = false): Parcelable {
/* Constructor using just Location */
constructor(location: Location) : this (location.provider, location.latitude, location.longitude, location. altitude, location.accuracy, location.time)
constructor(location: Location) : this (
provider=location.provider,
latitude=location.latitude,
longitude=location.longitude,
altitude=location. altitude,
accuracy=location.accuracy,
time=location.time,
distanceToStartingPoint=0F,
numberSatellites=LocationHelper.getNumberOfSatellites(location),
)
/* Constructor using Location plus distanceToStartingPoint and numberSatellites */
constructor(location: Location, distanceToStartingPoint: Float) : this (location.provider, location.latitude, location.longitude, location. altitude, location.accuracy, location.time, distanceToStartingPoint, LocationHelper.getNumberOfSatellites(location))
constructor(location: Location, distanceToStartingPoint: Float) : this (
provider=location.provider,
latitude=location.latitude,
longitude=location.longitude,
altitude=location. altitude,
accuracy=location.accuracy,
time=location.time,
distanceToStartingPoint=distanceToStartingPoint,
numberSatellites=LocationHelper.getNumberOfSatellites(location),
)
/* Converts WayPoint into Location */
fun toLocation(): Location {