1. On devices less than xhdpi request a 1x image from MapTiler (such devices are generally old, slower and with little memory so avoiding to get the 2x image only to have to shrink it later could help).
2. Coerce too big width/height combos within the API limits keeping the aspect ratio (this will allow requests on big horizontal displays to succeed).
3. Don't crash when given weird width/height combos (i.e. zero or negative).
4. Introduce interfaces to hide this whole logic and make it easier for forks to implement their own.
Related to:
- https://github.com/vector-im/element-meta/issues/1678
In an effort to make it easier for forks to (a) use their own
API keys (b) change map styles or maybe even providers, move
the MapTiler key out of the source code and pass it in via
env var or property.
Also refactor the utility classes slightly to keep all the URL
related functions together, to reduce the chance of collisions
when maintaining such forks.
Centering the titles is very iOS-y and not aligned with the material
guidelines (which say center aligned top bars are only for the main
root page in the app). They also present issues when we have titles
and textual actions that end up being quite long in other languages,
as they end up merging together.
Fixes#655
With this change, composable previews and screenshots should be created with just:
```
@ElementPreviews@Composable
fun MyViewPreview() {
ElementPreview {
MyView()
}
}
```
- Adds `@ElementPreviews` which is a shorthand for:
```
@Preview(name = "D")
@Preview(name = "N", uiMode = Configuration.UI_MODE_NIGHT_YES)
```
Should be used in connection with the now public `fun ElementPreview()` composable.
- Adds ElementPreviews to previewAnnotations in dangerfile
- Screenshots of night mode previews are now rendered with night mode
- Replaces `ElementPreviewLight` and `ElementThemedPreview` with `ElementPreview`
- Deprecates `ElementPreviewDark` which should be removed.
- Remaining usages of `ElementPreviewDark` are now ignored during screenshot tests
Show a fully-featured MapView, centered on the dropped pin,
which allows panning/zooming. Share button allows opening
in a map application.
Supports showing a description at the top of the screen,
if one is supplied with the event.
Out of scope: showing the local user's location (being
done as a separate story).
Includes some minor tidying: remove duplicate Location,
and make GeoURI parsing a method on that class; fix the
pointer location in MapView (I broke it earlier, whoops!)