Created
September 10, 2020 14:17
-
-
Save tugcearar/e8d43e04ebaccaf3e8829d80ec374d4a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal class MapInfoWindowAdapter : Java.Lang.Object, HuaweiMap.IInfoWindowAdapter | |
{ | |
private MainActivity activity; | |
private GeofenceModel selectedCoordinates; | |
private View addressLayout; | |
public MapInfoWindowAdapter(MainActivity currentActivity) | |
{ | |
activity = currentActivity; | |
} | |
public View GetInfoContents(Marker marker) | |
{ | |
return null; | |
} | |
public View GetInfoWindow(Marker marker) | |
{ | |
if (marker == null) | |
return null; | |
//update everytime, drawcircle need it | |
selectedCoordinates = new GeofenceModel { LatLng = new LatLng(marker.Position.Latitude, marker.Position.Longitude) }; | |
View mapInfoView = activity.LayoutInflater.Inflate(Resource.Layout.map_info_view, null); | |
var radiusBar = activity.FindViewById<SeekBar>(Resource.Id.radiusBar); | |
if (radiusBar.Visibility == Android.Views.ViewStates.Invisible) | |
{ | |
radiusBar.Visibility = Android.Views.ViewStates.Visible; | |
radiusBar.SetProgress(30, true); | |
} | |
activity.FindViewById<SeekBar>(Resource.Id.radiusBar)?.SetProgress(30, true); | |
activity.DrawCircleOnMap(selectedCoordinates); | |
Button button = mapInfoView.FindViewById<Button>(Resource.Id.btnInfoWindow); | |
button.Click += btnInfoWindow_ClickAsync; | |
return mapInfoView; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment