protected override void OnCreate(Bundle bundle)
 {
     MyLogger.Debug (this.LocalClassName, "Lifecycle Entered: OnCreate");
     base.OnCreate (bundle);
     string selectedEventId = Intent.GetStringExtra ("selectedEventId");
     if (string.IsNullOrEmpty (selectedEventId)) {
         MyLogger.Error (this.LocalClassName, "Selected Event ID not passed. Activity closed.");
         Finish ();
     }
     selectedEvent = (TowEvent)TowManager.First (x => x.Id.ToString () == (selectedEventId));
     SetContentView (Resource.Layout.TowNotificationDetail);
     InitializeVariables ();
     SetMojioEventInfo ();
     SetupMaps ();
     MyLogger.Debug (this.LocalClassName, "Lifecycle Exited: OnCreate");
 }
예제 #2
0
        private Marker AddTowEventMarkerToMap(TowEvent towEvent)
        {
            if (towEvent.Location != null) {
                var loc = new LatLng (towEvent.Location.Lat, towEvent.Location.Lng);
                MarkerOptions marker = new MarkerOptions ();
                marker.SetPosition (loc);
                marker.SetTitle (string.Format ("Device: {0}", towEvent.MojioId));
                marker.SetSnippet (string.Format ("Date: {0}", towEvent.Time));
                MyLogger.Information (this.LocalClassName, string.Format ("Event Marker Added: {0} at {1}", towEvent.MojioId, loc.ToString ()));
                return AddMarkerToMap (marker);
            }

            return null;
        }
 private MarkerOptions GetMarkerOption(TowEvent e)
 {
     MarkerOptions marker = new MarkerOptions ();
     marker.SetPosition (GetEventLocation (e));
     marker.SetTitle (e.Location == null ? "Location Not Available!" : string.Format ("{0}", e.MojioId));
     return marker;
 }
 private LatLngBounds GetLocationBoundary(TowEvent e)
 {
     var location = GetEventLocation (e);
     return new LatLngBounds (location, location);
 }
 private LatLng GetEventLocation(TowEvent e)
 {
     if (selectedEvent.Location == null)
         return new LatLng (49.2389f, -123.1201f); //Vancouver LatLng
     else
         return new LatLng (e.Location.Lat, e.Location.Lng);
 }
 private void OnEventItemClicked(TowEvent towEvent)
 {
     MyLogger.Information (this.LocalClassName, string.Format ("Notificiation Clicked: {0}", towEvent.Id));
     var towDetailsActivity = new Intent (this, typeof(TowDetailsActivity));
     towDetailsActivity.PutExtra ("selectedEventId", towEvent.Id.ToString ());
     StartActivity (towDetailsActivity);
 }