[android] #4003 - add unit tests for InfoWindow

This commit is contained in:
Tobrun
2016-02-18 11:12:50 +01:00
parent daedb3ddb2
commit a24d06b992
2 changed files with 93 additions and 3 deletions

View File

@@ -192,10 +192,10 @@ public class InfoWindow {
if (mIsVisible) {
mIsVisible = false;
View view = mView.get();
if (view != null) {
if (view != null && view.getParent() != null) {
((ViewGroup) view.getParent()).removeView(view);
onClose();
}
onClose();
}
return this;
}
@@ -223,7 +223,7 @@ public class InfoWindow {
MapboxMap mapboxMap = mMapboxMap.get();
if (mapboxMap != null) {
MapboxMap.OnInfoWindowCloseListener listener = mapboxMap.getOnInfoWindowCloseListener();
if(listener!=null){
if (listener != null) {
listener.onInfoWindowClose(getBoundMarker());
}
mapboxMap.deselectMarker(getBoundMarker());
@@ -254,4 +254,8 @@ public class InfoWindow {
}
}
boolean isVisible() {
return mIsVisible;
}
}