Fixes #5806 Implemented "Refresh" button to clear the cache and reload the Nearby map #5891
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The nearby map can be buggy, and a reload feature is much more efficient than reloading the whole app.
This pull request solves this by adding a refresh button which will empty the nearby cache, and then reload the map.
Fixes #5806
What changes did you make and why?
After cloning the app would not run in my environment, and I have noticed that this is a common issue with other new maintainers. To solve this I had to: Removed suspend from affected DAO files and funcs, and changed to (Kotlin v1.9.22) and (Kotlin compiler v1.5.8)
NearbyParentFragment.java
This is where the clicking of the refresh button is handled, which calls
emptyCache()
, which will then callreloadMap()
to complete the refresh. Main functionality has been implemented here.nearby_fragment_menu.xml
,ic_refresh_24dp_nearby.xml
Created new refresh icon and added it to the nearby menu, so that it is displayed in the top header.
NearbyParentFragment.java
,PlacesRepository.java
,PlacesLocalDataSource.java
,PlaceDao.java
These files were changed to implement emptying the nearby cache
NearbyParentFragment.java
Functionality for reloading the map is inside
reloadMap()
Tests performed (required)
Screenshots (for UI changes only)
Screen_recording_20241025_152616.webm