SwEnt-Group13 / Unio

The world’s largest campus life platform.
3 stars 1 forks source link

Feat/map gps refresh #182

Closed Zafouche closed 1 week ago

Zafouche commented 1 week ago

Description

This PR implements periodic location updates to the MapViewModel using existing FusedLocationProviderClient. The periodic updates allow the app to refresh the location displayed on the map at regular intervals between 5-10 seconds. The logic ensures the GPS shows live location updates, such that the user can see their movements in real time on the map. The time interval can be discussed and adapted later, depending on the load of the rest of the app on a phone, but 5 seconds seems like a fair interval for our map.

Motivation and Context

The FusedLocationProviderClient provides automatic location updates, which had to be coupled with the MapViewModel to be able to use it in our Map screen. This feature ensures the map reflects the user’s live current location while moving.

MapViewModel:

MapScreen:

How Has This Been Tested?

sonarcloud[bot] commented 1 week ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
78.1% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud