-
Notifications
You must be signed in to change notification settings - Fork 749
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#5417: Pinned location sharing #5479
Conversation
2cc7751
to
fce6c66
Compare
Hello @gaelledel, this PR is ready for design review. Can you check everything is okay? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work :D
object CurrentUserLocationSharingAction : LocationSharingAction() | ||
data class PinnedLocationSharingAction(val locationData: LocationData?) : LocationSharingAction() | ||
data class LocationTargetChangeAction(val locationData: LocationData) : LocationSharingAction() | ||
object ZoomToUserLocationAction : LocationSharingAction() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove Action suffix like ZoomToUserLocation
to continue the naming convention of other actions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes in fact it is not necessary.
@@ -130,21 +143,52 @@ class LocationSharingFragment @Inject constructor( | |||
.show() | |||
} | |||
|
|||
private fun initLocateBtn() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer renaming to initLocateButton()
pinDrawable = it | ||
) | ||
private fun updatePin(isUserPin: Boolean? = true) { | ||
if (isUserPin == true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We generally prefer if (isUserPin.orFalse())
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I was not aware of this extension.
pinId = DEFAULT_PIN_ID, | ||
pinDrawable = pinDrawable | ||
pinDrawable = null, | ||
showPin = areTargetAndUserLocationEqual == false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.orFalse
can be used here too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I replaced it by areTargetAndUserLocationEqual.orTrue().not()
to be equivalent to areTargetAndUserLocationEqual == false
.
private var mapRefs: MapRefs? = null | ||
private var initZoomDone = false | ||
private var showLocationBtn = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please rename locateBtn, createLocateBtn, showLocationBtn, initLocateBtn and adjustCompassBtn?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes no problem, done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Tested on my device. I just have small remarks.
70a6d2b
to
19e7ec2
Compare
Thanks! I fixed all comments and rebased the branch on develop. Can you have a look again? |
When testing again with previous version, I now have a "Malformed event" message for pinned location events sent with a version built from this branch. This is due to the enum type |
19e7ec2
to
b72c87d
Compare
Type of change
Content
Implementation of the pinned location sharing. User can now select a location on the map different from its current location. User can also zoom to its current location using a dedicated button placed above the compass icon.
Motivation and context
Closes #5417
Screenshots / GIFs
User location sharing
Pinned location sharing
Tests
User location case
Pinned location case
Compatibility with previous versions
Tested devices
Checklist