[android] alpha not applied from builder fix for marker view (#6152)

This commit is contained in:
Tobrun
2016-08-29 14:50:52 +02:00
committed by GitHub
parent e759f1c948
commit 4db99d2024
2 changed files with 3 additions and 4 deletions

View File

@@ -61,6 +61,7 @@ public class MarkerView extends Marker {
*/
public MarkerView(BaseMarkerViewOptions baseMarkerViewOptions) {
super(baseMarkerViewOptions);
this.alpha = baseMarkerViewOptions.getAlpha();
this.anchorU = baseMarkerViewOptions.getAnchorU();
this.anchorV = baseMarkerViewOptions.getAnchorV();
this.infoWindowAnchorU = baseMarkerViewOptions.getInfoWindowAnchorU();

View File

@@ -118,7 +118,7 @@ public class MarkerViewManager {
PointF point = mapboxMap.getProjection().toScreenLocation(marker.getPosition());
if (marker.getOffsetX() == MapboxConstants.UNMEASURED) {
// ensure view is measured first
if (convertView.getMeasuredWidth() == 0) {
if (convertView.getWidth() == 0) {
convertView.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
}
if (convertView.getMeasuredWidth() != 0) {
@@ -133,9 +133,7 @@ public class MarkerViewManager {
// animate visibility
if (marker.isVisible() && convertView.getVisibility() == View.GONE) {
convertView.animate().cancel();
convertView.setAlpha(0);
AnimatorUtils.alpha(convertView, 1);
animateVisible(marker, true);
}
}
}