Location Repository
class LocationRepository( val context: Context, defaultLocation: LatLng, shouldGetPermission: MutableLiveData<Boolean>, registerListener: (input: LocationUpdateListener) -> Unit)
Content copied to clipboard
Repository for location data. This class uses the registerListener in order to aquire the location data.
Constructors
Link copied to clipboard
fun LocationRepository( context: Context, defaultLocation: LatLng, shouldGetPermission: MutableLiveData<Boolean>, registerListener: (input: LocationUpdateListener) -> Unit)
Content copied to clipboard
defaultLocation: the default location to use if no location is available, shouldGetPermission: whether the permission to access the location should be requested, registerListener: a function to register a location listener
Functions
Link copied to clipboard
fun locationCallback(registerListener: (input: LocationUpdateListener) -> Unit)
Content copied to clipboard
Register a new location listener.
Link copied to clipboard
fun registerNewListener(registerListener: (input: LocationUpdateListener) -> Unit)
Content copied to clipboard
Register a new location listener that only cares about non default values.