-
Notifications
You must be signed in to change notification settings - Fork 754
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
Fix copyright attributions of map views [PSF-1058] - [PSF-1072] #6247
Conversation
setLogoMargins(dimensionConverter.dpToPx(8), 0, 0, dimensionConverter.dpToPx(208)) | ||
setAttributionMargins(dimensionConverter.dpToPx(96), 0, 0, dimensionConverter.dpToPx(208)) |
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 use the size of the view that these values depend on instead of using static values ?
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.
Good idea, done. Although it is not possible to calculate the width of the "mapbox" logo.
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.
One remark about the new string.
@@ -3036,6 +3036,7 @@ | |||
<string name="labs_enable_live_location_summary">Temporary implementation: locations persist in room history</string> | |||
<string name="live_location_bottom_sheet_stop_sharing">Stop sharing</string> | |||
<string name="live_location_bottom_sheet_last_updated_at">Updated %1$s ago</string> | |||
<string name="location_map_view_copyright">© MapTiler © OpenStreetMap contributors</string> |
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.
Do we really want this string to be translated? I think this is not necessary.
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.
Exactly, moved.
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 have just added some small remarks.
@@ -111,5 +113,6 @@ abstract class AbsMessageLocationItem<H : AbsMessageLocationItem.Holder> : AbsMe | |||
val staticMapImageView by bind<ImageView>(R.id.staticMapImageView) | |||
val staticMapPinImageView by bind<ImageView>(R.id.staticMapPinImageView) | |||
val staticMapErrorTextView by bind<TextView>(R.id.staticMapErrorTextView) | |||
val mapCopyrightTextView by bind<TextView>(R.id.mapCopyrightTextView) |
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 we follow the same convention as for other ids by starting by staticMap
prefix?
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.
Done.
@@ -63,10 +62,8 @@ class UrlMapProvider @Inject constructor( | |||
append(height) | |||
append(".png") | |||
append(keyParam) | |||
if (!localeProvider.isRTL()) { |
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.
The localeProvider
dependency can be removed from this class since it is no longer used.
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.
Right, done.
append("&attribution=bottomleft") | ||
} | ||
// Since the default copyright font is too small we put a custom one on map | ||
append("&attribution=0") |
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.
Should we use attribution=false
if it works: the intention may be clearer with a boolean.
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, works, done.
mapboxMap.uiSettings.apply { | ||
// Place copyright above the user list bottom sheet | ||
setLogoMargins(dimensionConverter.dpToPx(8), 0, 0, bottomSheetHeight + dimensionConverter.dpToPx(8)) | ||
setAttributionMargins(dimensionConverter.dpToPx(96), 0, 0, bottomSheetHeight + dimensionConverter.dpToPx(8)) |
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 also add this setAttributionMargins
in MapTilerMapView
? In this view, we only call setLogoMargins
.
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.
It is working well with default margins. Since I moved the position of attribution here I also needed re-set all the margins.
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.
What I meant is what you have done is great (we see the logo + information icon). But I have seen in MapTilerMapView
, we only call the setLogoMargins
implying we only see the logo but not the information icon. I know it is out of the scope of this PR but we could align this behaviour and add the call to setAttributionMargins
in MapTilerMapView
so that we can see the information icon.
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 actually see both logo and the info icon in MapTilerMapView
. You can see it in maximized static location sharing.
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.
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.
Oh, I missed this screen!
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 catch, done!
@@ -42,4 +42,6 @@ | |||
<string name="ftue_auth_email_verification_subtitle">To confirm your email address, tap the button in the email we just sent to %s</string> | |||
<string name="ftue_auth_email_verification_footer">Did not receive an email?</string> | |||
<string name="ftue_auth_email_resend_email">Resend email</string> | |||
|
|||
<string name="location_map_view_copyright">© MapTiler © OpenStreetMap contributors</string> |
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 add translatable="false"
please?
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 didn't know that, done.
SonarCloud Quality Gate failed. |
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.
LGTM
Type of change
Content
Motivation and context
Screenshots / GIFs
Tests
Tested devices
Checklist