-
Notifications
You must be signed in to change notification settings - Fork 913
Fix copyright attributions of map views [PSF-1058] - [PSF-1072] #6247
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
Changes from all 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 |
|---|---|---|
|
|
@@ -25,6 +25,7 @@ import androidx.core.graphics.drawable.toBitmap | |
| import androidx.lifecycle.lifecycleScope | ||
| import com.airbnb.mvrx.fragmentViewModel | ||
| import com.airbnb.mvrx.withState | ||
| import com.google.android.material.bottomsheet.BottomSheetBehavior | ||
| import com.mapbox.mapboxsdk.geometry.LatLng | ||
| import com.mapbox.mapboxsdk.geometry.LatLngBounds | ||
| import com.mapbox.mapboxsdk.maps.MapView | ||
|
|
@@ -40,6 +41,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 +60,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 +97,13 @@ class LocationLiveMapViewFragment @Inject constructor() : VectorBaseFragment<Fra | |
| private fun setupMap() { | ||
| val mapFragment = getOrCreateSupportMapFragment() | ||
| mapFragment.getMapAsync { mapboxMap -> | ||
| val bottomSheetHeight = BottomSheetBehavior.from(views.bottomSheet).peekHeight | ||
| 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)) | ||
|
Contributor
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 also add this
Contributor
Author
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. It is working well with default margins. Since I moved the position of attribution here I also needed re-set all the margins.
Contributor
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. What I meant is what you have done is great (we see the logo + information icon). But I have seen in
Contributor
Author
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. We actually see both logo and the info icon in
Contributor
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.
Contributor
Author
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. Oh, I missed this screen!
Contributor
Author
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 catch, done! |
||
| } | ||
|
|
||
| lifecycleScope.launch { | ||
| mapboxMap.setStyle(urlMapProvider.getMapUrl()) { style -> | ||
| mapStyle = style | ||
|
|
||

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
localeProviderdependency 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.