-
Notifications
You must be signed in to change notification settings - Fork 758
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
Changes from 4 commits
b455bf0
b284b92
ec1eb49
4b50058
68c6e52
adde210
d0ab6af
9b22880
f9f1b3e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fix copyright attributions of map views |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,6 @@ package im.vector.app.features.location | |
|
||
import im.vector.app.BuildConfig | ||
import im.vector.app.core.resources.LocaleProvider | ||
import im.vector.app.core.resources.isRTL | ||
import im.vector.app.features.raw.wellknown.getElementWellknown | ||
import org.matrix.android.sdk.api.extensions.tryOrNull | ||
import org.matrix.android.sdk.api.raw.RawService | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, done. |
||
// On LTR languages we want the legal mentions to be displayed on the bottom left of the image | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. Should we use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice, works, done. |
||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ import im.vector.app.R | |
import im.vector.app.core.extensions.addChildFragment | ||
import im.vector.app.core.extensions.configureWith | ||
import im.vector.app.core.platform.VectorBaseFragment | ||
import im.vector.app.core.utils.DimensionConverter | ||
import im.vector.app.databinding.FragmentLocationLiveMapViewBinding | ||
import im.vector.app.features.location.UrlMapProvider | ||
import im.vector.app.features.location.zoomToBounds | ||
|
@@ -58,6 +59,7 @@ class LocationLiveMapViewFragment @Inject constructor() : VectorBaseFragment<Fra | |
|
||
@Inject lateinit var urlMapProvider: UrlMapProvider | ||
@Inject lateinit var bottomSheetController: LiveLocationBottomSheetController | ||
@Inject lateinit var dimensionConverter: DimensionConverter | ||
|
||
private val viewModel: LocationLiveMapViewModel by fragmentViewModel() | ||
|
||
|
@@ -94,6 +96,12 @@ class LocationLiveMapViewFragment @Inject constructor() : VectorBaseFragment<Fra | |
private fun setupMap() { | ||
val mapFragment = getOrCreateSupportMapFragment() | ||
mapFragment.getMapAsync { mapboxMap -> | ||
mapboxMap.uiSettings.apply { | ||
// Place copyright above the user list bottom sheet | ||
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 commentThe 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 commentThe 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. |
||
} | ||
|
||
lifecycleScope.launch { | ||
mapboxMap.setStyle(urlMapProvider.getMapUrl()) { style -> | ||
mapStyle = style | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Exactly, moved. |
||
|
||
<string name="message_bubbles">Show Message bubbles</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.
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.