コード例 #1
0
 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;
        }
コード例 #3
0
 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;
 }
コード例 #4
0
 private LatLngBounds GetLocationBoundary(TowEvent e)
 {
     var location = GetEventLocation (e);
     return new LatLngBounds (location, location);
 }
コード例 #5
0
 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);
 }
コード例 #6
0
 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);
 }