protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); ActionBar.Title = "Dashboard"; // Button action Piechartbutton = FindViewById <Button>(Resource.Id.PieChart); Piechartbutton.Click += (sender, e) => { StartActivity(typeof(PieChartActivity)); }; ButtonList.Add(Piechartbutton); samplePageButton = FindViewById <Button>(Resource.Id.ListView); samplePageButton.Click += (sender, e) => { StartActivity(typeof(ContainerListActivity)); }; ButtonList.Add(samplePageButton); bressButton = FindViewById <Button>(Resource.Id.bress); bressButton.Click += (sender, e) => { StartActivity(typeof(Barchartact)); }; ButtonList.Add(bressButton); multibar = FindViewById <Button>(Resource.Id.multibar); multibar.Click += (sender, e) => { StartActivity(typeof(MultibarActivity)); }; ButtonList.Add(multibar); LineChart = FindViewById <Button>(Resource.Id.LineChart); LineChart.Click += (sender, e) => { StartActivity(typeof(LineChartActivity)); }; ButtonList.Add(LineChart); Notepage = FindViewById <Button>(Resource.Id.note); Notepage.Click += (sender, e) => { Intent intent = new Intent(this, typeof(NoteActivity)); intent.PutExtra("Longitude", this._long); intent.PutExtra("Latitudes", this._lat); StartActivity(intent); }; ButtonList.Add(Notepage); LineChart = FindViewById <Button>(Resource.Id.LineChart); LineChart.Click += (sender, e) => { StartActivity(typeof(LineChartActivity)); }; ButtonList.Add(LineChart); ClosestBikeCon = FindViewById <Button>(Resource.Id.CloseBikeContainer); ClosestBikeCon.Click += (sender, e) => { AdaptedList <BikeContainer> Containers = new DataFactory().GetBikeContainers(); ConLocation Closest = new ProcessClosestBikeCon(Containers, this._lat, this._long).GetProcessedData(); var geoUri = Android.Net.Uri.Parse($"google.navigation:q={Extensions.ToGBString(Closest.Container.GetLatitude())}, {Extensions.ToGBString(Closest.Container.GetLongitude())}"); var mapIntent = new Intent(Intent.ActionView, geoUri); StartActivity(mapIntent); }; ButtonList.Add(ClosestBikeCon); ConnectionThread = new Thread(new ThreadStart(BackGroundConnectionCheck)); ConnectionThread.Start(); }
private string Createstring() { this._long = Extensions.ToGBString(Intent.GetDoubleExtra("Longitude", 4.477733)); this._lat = Extensions.ToGBString(Intent.GetDoubleExtra("Latitude", 51.92442)); string personaltext = $"Your bike is located at: \n " + $"Latitude: {this._lat}, Longitude: {this._long} \n" + "This can be filled in on a Map App to show the exact location \n" + $"This note was made on {(_date = DateTime.Now).ToString(_culture)} \n" + "Thank you for using our app!! :) \n" + "Room for a personal message is below here :) \n"; return(personaltext); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Import view and set title SetContentView(Resource.Layout.ContainerListItem); Button locshow = FindViewById <Button>(Resource.Id.show); Button routeshow = FindViewById <Button>(Resource.Id.navigate); appointment = FindViewById <Button>(Resource.Id.calendar); // Get BikeData send by ContainerListAcitivity BikeData = JsonConvert.DeserializeObject <BikeContainer>(Intent.GetStringExtra("data")); // Activity settings ActionBar.Title = BikeData.Trommelid.Replace("ft", "Bike container "); ActionBar.SetDisplayHomeAsUpEnabled(true); // Set view BikeData FindViewById <TextView>(Resource.Id.address).Text = BikeData.Straat + " " + BikeData.Huisnummer; // Location show Button logic locshow.Click += delegate { var geoUri = Android.Net.Uri.Parse($"geo:0,0?q={Extensions.ToGBString(BikeData.GetLatitude())},{Extensions.ToGBString(BikeData.GetLongitude())}({BikeData.Trommelid.Replace("ft", "Bike container ")})"); var mapIntent = new Intent(Intent.ActionView, geoUri); StartActivity(mapIntent); }; // Route show button logic routeshow.Click += delegate { var geoUri = Android.Net.Uri.Parse($"google.navigation:q={Extensions.ToGBString(BikeData.GetLatitude())}, {Extensions.ToGBString(BikeData.GetLongitude())}"); var mapIntent = new Intent(Intent.ActionView, geoUri); StartActivity(mapIntent); }; //Appointment button logic appointment.Click += delegate { _calId = Intent.GetIntExtra("calId", 1); var DatePicker = new DatePickerFrag(BaseContext, DateTime.Now, this); DatePicker.Show(FragmentManager, null); }; }