[Android] Setting logo/attribution visibility bug
Probably there is a bug when you set logo/attribution visibility in attributes (xml layout file).
Here those two views are invisible:
<com.mapbox.mapboxsdk.maps.MapView
android:background="@color/map_background"
android:id="@+id/map_view"
android:layout_height="match_parent"
android:layout_width="match_parent"
app:attribution_visibility="visible"
app:compass_enabled="false"
app:logo_visibility="visible"
app:my_location_enabled="true"
app:rotate_enabled="false" />
When I set logo or attribution to gone/invisible it appears on map.
Thanks for the report, picking this up asap.
Found the bug, we are exposing the attrs as
<attr name="logo_visibility">
<enum name="visible" value="0x0" />
<enum name="invisible" value="0x4" />
<enum name="gone" value="0x8" />
</attr>
while the SDK resolves this as a boolean:
mapboxMapOptions.logoEnabled(typedArray.getBoolean(R.styleable.MapView_logo_visibility, true));
Since the SDK exposes:
/**
* <p>
* Enables or disables the Mapbox logo.
* </p>
* By default, the compass is enabled.
*
* @param enabled True to enable the logo; false to disable the logo.
*/
public void setLogoEnabled(boolean enabled) {
logoSettings.setEnabled(enabled);
mapView.setLogoEnabled(enabled);
}
I'm going to change the attrs to take in account and change the name from visibility to enabled.
This will be fixed on the release branch here
Merged with https://github.com/mapbox/mapbox-gl-native/commit/e04fea8409714c6c4c055b95ddfc67122a2b860d. Closing.