Skip to content

Conversation

@Jason-Whitmore
Copy link
Collaborator

Description (required)

Fixes #6587

What changes did you make and why?

This PR continues and completes work on refactoring the loadPlacesDataAsync() method.

Nearly all of the changes in this PR are simply moving existing related code into separate methods, and then calling the new methods where the old code used to be. Documentation is added to the new methods. Some symbols have been renamed.

The new methods can help maintainers isolate and fix bugs quicker. The names and documentation of these new methods help explain what the code is doing.

NOTE: I highly recommend reviewers look at each commit in this PR sequentially. The commits build upon each other, but each commit is an isolated and small refactoring.

Tests performed (required)

Tested ProdDebug on Android Studio Emulator with API level 36.

The Nearby fragment appears to behave the same as the main branch when using bookmarks and clicking on grey pins while the loadPlacesDataAsync() method is running (which can easily be run by moving the map).

The code which ensures any places currently clicked are not updated by
WikiData server responses has been moved into a separate method
(with documentation). This method is called where the moved code was before
this commit.
… code

The code which ensures that the correct Places are (un)bookmarked
when the bookmarks have recently changed.
This code has been moved into a separate method (with documentation).
This method is called where the moved code was before this commit.
Duplicate code which created a HashMap containing (LatLng, Place) pairs
has been moved into a separate method (with documentation).
This method is called where the duplicated code was before this commit.
@github-actions
Copy link

✅ Generated APK variants!

Copy link
Member

@nicolas-raoul nicolas-raoul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 3 commits look good, I will test asap. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor NearbyParentFragmentPresenter.loadPlacesDataAsync()

2 participants