Conversation
73a82e9 to
706cd2c
Compare
Codecov Report
@@ Coverage Diff @@
## main #5853 +/- ##
==========================================
Coverage 67.55% 67.56%
+ Complexity 3877 3834 -43
==========================================
Files 591 586 -5
Lines 23844 23621 -223
Branches 2747 2725 -22
==========================================
- Hits 16108 15959 -149
+ Misses 6709 6644 -65
+ Partials 1027 1018 -9
|
| mapboxMap.getStyle { style -> | ||
| style.addPersistentStyleCustomLayer( | ||
| styleLoadedListener = mapboxCarMapSurface.handleStyleOnAttached { | ||
| it.addPersistentStyleCustomLayer( |
There was a problem hiding this comment.
What if style is updated without detach - won't you try to add persistent style several times?
There was a problem hiding this comment.
is it an issue to add a persistent style custom layer multiple times?
another note is that, we want to delete this class and adopt the new map widgets #5793.
The solution here will be temporary, but the solution would translate to other persistent styles
There was a problem hiding this comment.
It won't crash but will return Expected.error from
Expected<String, com.mapbox.bindgen.None> addPersistentStyleCustomLayer(@NonNull String layerId, @NonNull CustomLayerHost layerHost, @Nullable LayerPosition layerPosition);.
It's not a big issue but I assume still better to fix to avoid possible issues.
25ceef9 to
ed945e3
Compare
|
@kmadsen btw, do we really need to observe style changes? can it be changed somehow at runtime? do we have any usecases? it can't be added if we observe style dynamically depending on a head uint / phone settings cc @Zayankovsky |
50dfff5 to
686bdb2
Compare
686bdb2 to
b2cc801
Compare
b2cc801 to
32cdfa6
Compare
|
Noting that |
7af179d to
a1c4ee0
Compare
|
@kmadsen any concerns here? |
| import com.mapbox.maps.extension.androidauto.MapboxCarMapSurface | ||
| import com.mapbox.maps.plugin.delegates.listeners.OnStyleLoadedListener | ||
|
|
||
| internal fun MapboxCarMapSurface.handleStyleOnAttached( |
There was a problem hiding this comment.
This is quite nice. Nice work!
Thinking about this more, and I think we can move it up to the maps-androidauto extension
https://github.com/mapbox/mapbox-maps-android/tree/main/extension-androidauto
Happy to merge this here, and then we can propose it to maps. And eventually delete it from here
| compassWidget.host, | ||
| layerPosition | ||
| ) | ||
| styleLoadedListener = mapboxCarMapSurface.handleStyleOnAttached { |
There was a problem hiding this comment.
This class does not do anything when the style changes. So let's use the getStyle extension here and remove the styleLoadedListener handle and persistentStyleAdded flag
| styleLoadedListener = mapboxCarMapSurface.handleStyleOnAttached { | |
| mapboxCarMapSurface.getStyle { |
There was a problem hiding this comment.
can't use a sync getStyle extension, because style might be null when onAttached is called, so added a new
getStyleAsync extension
a1c4ee0 to
f2720a4
Compare
@kmadsen I've tested this commands on 1Tap and they do nothing (tested with AA but style change works with Screen.Recording.2022-06-07.at.12.31.30.online-video-cutter.com.mp4 |
f2720a4 to
a7035c8
Compare
kmadsen
left a comment
There was a problem hiding this comment.
Nice work! Video looks great #5853 (comment)




Description
observe map style when MapboxCarMapSurface is attached
Screenshots or Gifs