Custom colors
Description
Custom styles implementation!
Screenshots
Technical details
- Layers in styles have metadata so that microG knows what layers are associated with what group of layers in GMS
- microG traverses layers selected by the styler and applies the style operation to each color that it finds
Limitations:
- Icons cannot be recolored (POI icons, road icons)
- POIs cannot be targeted with high granularity (
poi.attraction,poi.businessetc.) because they are consolidated in one layer
Tests
Test arbitrary custom styles like this:
--- a/play-services-maps-core-mapbox/src/main/kotlin/org/microg/gms/maps/mapbox/Styles.kt
+++ b/play-services-maps-core-mapbox/src/main/kotlin/org/microg/gms/maps/mapbox/Styles.kt
@@ -35,7 +35,19 @@ fun getStyle(context: MapContext, storedMapType: Int, styleOptions: MapStyleOpti
).bufferedReader().readText()
)
- styleOptions?.apply(styleJson)
+ (styleOptions?: MapStyleOptions("""
+[
+ {
+ "stylers": [
+ {
+ "invert_lightness": true
+ }
+ ]
+
+ }
+]
+ """.trimIndent()))
+ .apply(styleJson)
return Style.Builder().fromJson(styleJson.toString())
}
Or test Uber's style in the Uber app.
Issues
10 commandments of code reviews
Edited by Fynn Godau
