Skip to content

Instantly share code, notes, and snippets.

@ibrahimbroachwala
Created February 15, 2020 16:29
var tollsList: LiveData<List<GeofenceModel>> =
Transformations.map(DataRepository.getAllTolls(), ::getTolls)
private fun getTolls(tolls: List<Toll>): List<GeofenceModel> {
val list = ArrayList<GeofenceModel>()
tolls.forEach {
list.add(
GeofenceModel(
it.id,
it.lat.toDouble(),
it.lng.toDouble(),
Constants.GEOFENCE_TOLL_RADIUS
)
)
}
return list
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment