Allows for setting the user location icon to transparent (#7393)
* allows for setting the user location icon to transparent * removed color check
This commit is contained in:
@@ -211,8 +211,8 @@ public class MapboxMapOptions implements Parcelable {
|
||||
, (int) (typedArray.getDimension(R.styleable.mapbox_MapView_mapbox_uiAttributionMarginBottom, DIMENSION_SEVEN_DP * screenDensity))});
|
||||
|
||||
mapboxMapOptions.locationEnabled(typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_myLocation, false));
|
||||
mapboxMapOptions.myLocationForegroundTintColor(typedArray.getColor(R.styleable.mapbox_MapView_mapbox_myLocationTintColor, Color.TRANSPARENT));
|
||||
mapboxMapOptions.myLocationBackgroundTintColor(typedArray.getColor(R.styleable.mapbox_MapView_mapbox_myLocationBackgroundTintColor, Color.TRANSPARENT));
|
||||
mapboxMapOptions.myLocationForegroundTintColor(typedArray.getColor(R.styleable.mapbox_MapView_mapbox_myLocationTintColor, ColorUtils.getPrimaryColor(context)));
|
||||
mapboxMapOptions.myLocationBackgroundTintColor(typedArray.getColor(R.styleable.mapbox_MapView_mapbox_myLocationBackgroundTintColor, Color.WHITE));
|
||||
|
||||
Drawable foregroundDrawable = typedArray.getDrawable(R.styleable.mapbox_MapView_mapbox_myLocationDrawable);
|
||||
if (foregroundDrawable == null) {
|
||||
|
||||
@@ -173,13 +173,11 @@ public class MyLocationView extends View {
|
||||
}
|
||||
|
||||
public final void setForegroundDrawableTint(@ColorInt int color) {
|
||||
if (color != Color.TRANSPARENT) {
|
||||
if (foregroundDrawable != null) {
|
||||
foregroundDrawable.mutate().setColorFilter(color, PorterDuff.Mode.SRC_IN);
|
||||
}
|
||||
if (foregroundBearingDrawable != null) {
|
||||
foregroundBearingDrawable.mutate().setColorFilter(color, PorterDuff.Mode.SRC_IN);
|
||||
}
|
||||
if (foregroundDrawable != null) {
|
||||
foregroundDrawable.mutate().setColorFilter(color, PorterDuff.Mode.SRC_IN);
|
||||
}
|
||||
if (foregroundBearingDrawable != null) {
|
||||
foregroundBearingDrawable.mutate().setColorFilter(color, PorterDuff.Mode.SRC_IN);
|
||||
}
|
||||
invalidate();
|
||||
}
|
||||
@@ -202,12 +200,10 @@ public class MyLocationView extends View {
|
||||
}
|
||||
|
||||
public final void setShadowDrawableTint(@ColorInt int color) {
|
||||
if (color != Color.TRANSPARENT) {
|
||||
if (backgroundDrawable == null) {
|
||||
return;
|
||||
}
|
||||
backgroundDrawable.mutate().setColorFilter(color, PorterDuff.Mode.SRC_IN);
|
||||
if (backgroundDrawable == null) {
|
||||
return;
|
||||
}
|
||||
backgroundDrawable.mutate().setColorFilter(color, PorterDuff.Mode.SRC_IN);
|
||||
invalidate();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user