Skip to content
Permalink
Browse files

Fix mapview invalidation when Marker visibility changed

Change-Id: Iea7872a0896e39c30353cd89d950c6d3779370bf
  • Loading branch information...
ewpatton authored and SusanRatiLane committed Jan 23, 2019
1 parent 302f30f commit 0e3f0ac5492892012525f997ec87c114a08688bf
@@ -1137,6 +1137,7 @@ public void showFeature(MapFeature feature) {

protected void showOverlay(OverlayWithIW overlay) {
view.getOverlayManager().add(overlay);
view.invalidate();
}

@Override
@@ -1146,6 +1147,7 @@ public void hideFeature(MapFeature feature) {

protected void hideOverlay(OverlayWithIW overlay) {
view.getOverlayManager().remove(overlay);
view.invalidate();
}

@Override
@@ -6,12 +6,15 @@
package com.google.appinventor.components.runtime;

import android.graphics.Color;
import android.view.ViewGroup;
import com.google.appinventor.components.runtime.shadows.ShadowEventDispatcher;
import com.google.appinventor.components.runtime.shadows.org.osmdroid.views.ShadowMapView;
import com.google.appinventor.components.runtime.util.ErrorMessages;
import org.junit.Before;
import org.junit.Test;
import org.locationtech.jts.geom.Geometry;
import org.osmdroid.util.GeoPoint;
import org.robolectric.internal.bytecode.ShadowMap;
import org.robolectric.shadow.api.Shadow;
import org.robolectric.shadows.ShadowView;

@@ -271,7 +274,7 @@ public void testStrokeColor() {

@Test
public void testVisibleNoInvalidate() {
ShadowView mapView = Shadow.extract(getMap().getView());
ShadowMapView mapView = Shadow.extract(((ViewGroup) getMap().getView()).getChildAt(0));
Marker marker = new Marker(getMap());
mapView.clearWasInvalidated();
marker.Visible(true);
@@ -281,7 +284,7 @@ public void testVisibleNoInvalidate() {

@Test
public void testVisibleInvalidate() {
ShadowView mapView = Shadow.extract(getMap().getView());
ShadowMapView mapView = Shadow.extract(((ViewGroup) getMap().getView()).getChildAt(0));
Marker marker = new Marker(getMap());
mapView.clearWasInvalidated();
marker.Visible(true);

0 comments on commit 0e3f0ac

Please sign in to comment.
You can’t perform that action at this time.