Skip to content

NMA-783: Merchants Map - #784

Merged
HashEngineering merged 21 commits into
explore-dashfrom
NMA-783-merchant-map
Nov 2, 2021
Merged

HashEngineering merged 21 commits into
explore-dashfrom
NMA-783-merchant-map

Conversation

@ClaudeHangui

@ClaudeHangui ClaudeHangui commented Oct 17, 2021 •

Copy link
Copy Markdown
Contributor

Issue being fixed or feature implemented

  1. API Key Storage: As described here, Google recommends using Secret Gradle Plugin (SGP) for managing API keys. With this plugin, the key is stored in (and accessed from) the local.properties file. Usage of SGP required an upgrade of our AGP and Gradle versions. We did not use the latest version of SGP as this requires migrating our AGP and GP versions from 4.x to 7.x. As our app is right now, this is not a requirement
    NB: I recommend to remove the api_key value stored in the string.xml file
  2. Location Permission: The app as it is now requires us to get the user's location while in foreground ONLY; as such irrespective of the android version (M, Q or above) we require only the ACCESS_FINE_LOCATION which is more precise than the ACCESS_COARSE_LOCATION
  3. Location update: We provide the logic to get latest user's location via a custom class. The user's coordinates are provided as a Flow

Related PR's and Dependencies

Screenshots / Videos

How Has This Been Tested?

  • QA (Mobile Team)

Checklist:

  • [ x] I have performed a self-review of my own code and added comments where necessary
  • I have added or updated relevant unit/integration/functional/e2e tests

- 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
@ClaudeHangui
ClaudeHangui changed the base branch from master to explore-dash October 17, 2021 14:17
@ClaudeHangui
ClaudeHangui requested a review from Syn-McJ October 17, 2021 14:21

@Syn-McJ Syn-McJ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@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"
/>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed in last push !

app:behavior_expandedOffset="40dp"
app:behavior_fitToContents="false"
app:behavior_halfExpandedRatio="0.41"
app:behavior_halfExpandedRatio="0.55"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I actually changed this value since I was displaying the map up to a certain height

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in last push !

} else {
permissionRequestLauncher.launch(Manifest.permission.ACCESS_FINE_LOCATION)
}
googleMap?.uiSettings?.isZoomControlsEnabled = true

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in last push !

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is the merchant marker, but named ATM

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in last push

override fun onPause() {
super.onPause()
view!!.viewTreeObserver?.removeOnWindowFocusChangeListener(onWindowFocusChangeListener)
view?.viewTreeObserver?.removeOnWindowFocusChangeListener(onWindowFocusChangeListener)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why wouldn't we use requireView() instead?

are there cases where view or viewTreeObserver could be null?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we could use requireView. I just made sure the app doesn't crash by using ? instead of !!

@ClaudeHangui

Copy link
Copy Markdown
Contributor Author

@Syn-McJ

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.
Well, the design shows a custom marker, so I'll just have to adjust it's size. I'll check with Brian to see if we use the default marker rather than the custom one seen on the design

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
I personally don't see any shadow, but this is something that can be fixed with an asset indeed. I'll see with Rost !

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.
Good point ! I agree with the fact that zooming might have the blue circle overlap with the closest merchant markers. Removing this will improve UX. ​I'll need to validate this modification with Brian

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

@Syn-McJ Syn-McJ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great

- 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 HashEngineering left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Need to fix merge conflicts

@HashEngineering
HashEngineering self-requested a review October 30, 2021 18:07

@HashEngineering HashEngineering left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good.

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'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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 Syn-McJ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good. There are some potential improvements that should probably go into the second map story.

@HashEngineering
HashEngineering merged commit eb098ce into explore-dash Nov 2, 2021
@HashEngineering
HashEngineering deleted the NMA-783-merchant-map branch March 14, 2022 03:42
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.

3 participants