You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Library resource prefix breaks current attrs.xml #4021
For #3119 it seemed a great improvement to add resourcePrefix to build.gradle.
This enforces that resources should start with a certain prefix.
For this project I have chosen for the mapbox_ prefix.
This resulted in following strings.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<stringname="mapbox_compassContentDescription">Map compass. Click to reset the map rotation to North.</string>
<stringname="mapbox_attributionsIconContentDescription">Attribution icon. Click to show attribution dialog.</string>
<stringname="mapbox_attributionsDialogTitle">Mapbox Android SDK</string>
<stringname="mapbox_attributionTelemetryTitle">Make Mapbox Maps Better</string>
<stringname="mapbox_attributionTelemetryMessage">You are helping to make OpenStreetMap and Mapbox maps better by contributing anonymous usage data.</string>
<stringname="mapbox_mapboxIconContentDescription">The Mapbox logo.</string>
<stringname="mapbox_infoWindowTitle">Title</string>
<stringname="mapbox_infoWindowDescription">Description</string>
<stringname="mapbox_infoWindowAddress">Address</string>
<!-- these are public -->
<stringname="mapbox_style_mapbox_streets">mapbox://styles/mapbox/streets-v8</string>
<stringname="mapbox_style_emerald">mapbox://styles/mapbox/emerald-v8</string>
<stringname="mapbox_style_light">mapbox://styles/mapbox/light-v8</string>
<stringname="mapbox_style_dark">mapbox://styles/mapbox/dark-v8</string>
<stringname="mapbox_style_satellite">mapbox://styles/mapbox/satellite-v8</string>
<stringname="mapbox_style_satellite_streets">mapbox://styles/mapbox/satellite-hybrid-v8</string>
</resources>
This is a great improvement in comparison with before, the resource prefix requires us to follow certain guidelines. Now with implementing #4018, I'm noticing this is required also for other types of resources:
eg attrs.xml:
At first this doesn't seem a problem, but when you look at the end result in java code:
@bleege agreed! I'm quickly going to disable this for now in #4040. Not cool having errors/warnings in the IDE. This is still something that we should discuss before releasing 4.0.0 since as you noticed can be a breaking change.
I'm personally not a big fan of this, but this API is only for internal use.
If it's only for internal use, not a major problem. However, let's avoid unnecessary mapbox_ prefixes like in mapbox_style_mapbox_streets and let's stick to one kind of capitalization (mapbox_compassContentDescription vs mapbox_style_mapbox_streets).
This is still something that we should discuss before releasing 4.0.0 since as you noticed can be a breaking change.
If the only public facing change is for mapbox_access_token, can we just implement manually that one, and leave the larger lift for after 4.0.0?
Activity
bleege commentedon Feb 18, 2016
@tobrun Let's hold on this for time being as there are more immediate needs that require our bandwidth, namely better testing support.
tobrun commentedon Feb 19, 2016
@bleege agreed! I'm quickly going to disable this for now in #4040. Not cool having errors/warnings in the IDE. This is still something that we should discuss before releasing
4.0.0since as you noticed can be a breaking change.zugaldia commentedon Feb 22, 2016
If it's only for internal use, not a major problem. However, let's avoid unnecessary
mapbox_prefixes like inmapbox_style_mapbox_streetsand let's stick to one kind of capitalization (mapbox_compassContentDescriptionvsmapbox_style_mapbox_streets).If the only public facing change is for
mapbox_access_token, can we just implement manually that one, and leave the larger lift for after 4.0.0?tobrun commentedon Feb 25, 2016
@zugaldia
both the styles and the attributes you mentioned above are public.
You can see all our public resources in public.xml
For now I'm going to drop the
mapbox_prefix for all resources except formapbox_access_token.[android] #4021 - fix up library resource prefix
zugaldia commentedon Feb 25, 2016
@tobrun 👍