Repository navigation
NMA-783: Merchants Map - #784
Conversation
- update build.gradle for feature: add google maps dependencies - update build.gradle for project and gradle-wrapper.properties: upgrade AGP and Gradle plugin to handle Secret Gradle Plugin - fix NPE crash on SendCoinsBaseViewModel.kt and PaymentsPayFragment.kt - Explore Flow: update SearchFragment.kt - display map with user location and atm merchants location - Explore Flow: UserLocationState.kt - set class to provide location update
Syn-McJ
left a comment
There was a problem hiding this comment.
@ClaudeHangui the code looks great. I have a couple of notes on implementation and UI, apart from the ones I've left in code:
-
The map should be full-screen, overlayed by the results panel. The results panel can be collapsed completely (only drag indicator will be visible), and right now there is nothing behind it.
-
We don't need to animate the map to the user location every time an updated location is received. This makes it annoying to look at the map away from the user location.
-
The user location circle and dash markers seem a bit too big (see the design). It might be better to just set the default user location icon - won't need custom drawable then and it should look the same, only smaller.
-
Dash icons should have a shadow according to the design - without a shadow, when the markers overlap each other it becomes just a mash of white and blue. If a shadow is too hard to make (although you might just use a png asset), then there should at least be a border of some kind.
-
The transparent blue circle usually indicates the accuracy of the location tracker (see the design). As I understand you're indicating 50 miles radius with it - that's not required, user will zoom in and see all of their dash markers on a blue background which is weird. Instead, the map should just be zoomed in to fit 50 miles radius on the screen.
| app:layout_constraintBottom_toBottomOf="parent" | ||
| app:layout_constraintTop_toBottomOf="@id/explore_map" | ||
| android:background="@color/white" | ||
| /> |
There was a problem hiding this comment.
We don't need this. The map should be full screen as the results panel can be hidden completely (except for drag indicator), but currently, you'll have this background left in place of it.
There was a problem hiding this comment.
fixed in last push !
| app:behavior_expandedOffset="40dp" | ||
| app:behavior_fitToContents="false" | ||
| app:behavior_halfExpandedRatio="0.41" | ||
| app:behavior_halfExpandedRatio="0.55" |
There was a problem hiding this comment.
Don't think this should be changed. Half expanded height is according to the design and it has to accommodate the fact that it stays the same when transitioning to the merchant details. If it's too high, merchant details will look weird and the map will be too small on small-screen devices.
There was a problem hiding this comment.
I actually changed this value since I was displaying the map up to a certain height
There was a problem hiding this comment.
Fixed in last push !
| } else { | ||
| permissionRequestLauncher.launch(Manifest.permission.ACCESS_FINE_LOCATION) | ||
| } | ||
| googleMap?.uiSettings?.isZoomControlsEnabled = true |
There was a problem hiding this comment.
I'm not sure we need zoom controls. They aren't in the design and no one uses them anyway on mobile when there is multitouch.
There was a problem hiding this comment.
Fixed in last push !
| @@ -0,0 +1,18 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | |||
There was a problem hiding this comment.
This is the merchant marker, but named ATM
There was a problem hiding this comment.
Fixed in last push
| override fun onPause() { | ||
| super.onPause() | ||
| view!!.viewTreeObserver?.removeOnWindowFocusChangeListener(onWindowFocusChangeListener) | ||
| view?.viewTreeObserver?.removeOnWindowFocusChangeListener(onWindowFocusChangeListener) |
There was a problem hiding this comment.
why wouldn't we use requireView() instead?
are there cases where view or viewTreeObserver could be null?
There was a problem hiding this comment.
we could use requireView. I just made sure the app doesn't crash by using ? instead of !!
|
The user location circle and dash markers seem a bit too big (see the design). It might be better to just set the default user location icon - won't need custom drawable then and it should look the same, only smaller. Dash icons should have a shadow according to the design - without a shadow, when the markers overlap each other it becomes just a mash of white and blue. If a shadow is too hard to make (although you might just use a png asset), then there should at least be a border of some kind The transparent blue circle usually indicates the accuracy of the location tracker (see the design). As I understand you're indicating 50 miles radius with it - that's not required, user will zoom in and see all of their dash markers on a blue background which is weird. Instead, the map should just be zoomed in to fit 50 miles radius on the screen. This is just the 1st iteration related to this feature. As you know, there is another story related to the map, were I'll be dealing with improving the UI/UX regarding location permission as we discussed last week. I'll be bringing up all the aforementionned refinements |
- remove zoom controls - resize bottom sheet height - rename merchant_marker.xml
- update markers displayed on map after filtering results - set workflow to read the play service api key
…ant-map # Conflicts: # features/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/ExploreViewModel.kt # features/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/SearchFragment.kt # features/exploredash/src/main/res/layout/fragment_search.xml # features/exploredash/src/main/res/values/strings-explore-dash.xml
- fix merge conflicts with `explore_dash` remote branch
- add mockito dependency to handle mocking of final classes
- update merchant data path - set default view of map to 50 mile radius
…ant-map # Conflicts: # features/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/SearchFragment.kt
- update api key for google maps and provide new config file - refresh map after filtering merchants
…ant-map # Conflicts: # features/exploredash/src/main/java/org/dash/wallet/features/exploredash/di/ExploreDashModule.kt # features/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/ExploreViewModel.kt # features/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/SearchFragment.kt # features/exploredash/src/test/java/org/dash/wallet/features/exploredash/ExploreViewModelTest.kt
HashEngineering
left a comment
There was a problem hiding this comment.
Need to fix merge conflicts
| api 'androidx.paging:paging-runtime-ktx:3.0.1' | ||
|
|
||
| // Fused Location Provider, Google Maps service $ Kotlin extension for map sdk | ||
| implementation 'com.google.android.gms:play-services-location:18.0.0' |
There was a problem hiding this comment.
We got an email about 18.0.0 being the most recent version.
We're writing to inform you that we released a major update of Maps SDK for Android (version 18.0.0),
and it is now available via Google Play services.
Syn-McJ
left a comment
There was a problem hiding this comment.
Looks good. There are some potential improvements that should probably go into the second map story.
Issue being fixed or feature implemented
NB: I recommend to remove the api_key value stored in the string.xml file
Related PR's and Dependencies
Screenshots / Videos
How Has This Been Tested?
Checklist: