Ejemplo n.º 1
0
        private void spinner_ItemSelected(object sender, AdapterView.ItemSelectedEventArgs e)
        {
            var v = spinner.GetItemAtPosition(e.Position).ToString();

            location = Core.TideData.GetLocationId(v);
            string toast = string.Format("The location chaged to {0}", v);

            Toast.MakeText(this, toast, ToastLength.Short).Show();
            this.DoUpdate();
        }
Ejemplo n.º 2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            WireObjects();
            this.datePicker.DateTime = DateTime.Now;
            location = Core.TideData.Location.BowleysBar;
            this.DoUpdate();
        }
Ejemplo n.º 3
0
        private async void DoUpdate()
        {
            var now = startDatePicker.Date;

            if (picker.SelectedItem == null)
            {
                setDefaultLocation();
            }
            LocationData locationData = picker.SelectedItem as LocationData;

            location = Core.TideData.GetLocationId(locationData.Description);
            Task <Core.DailyData> loadTask = Core.TideData.LoadTideData(now, location);
            var results = await loadTask;

            highTide1.Text = GetTideText(results.FirstHighTide, results);
            highTide2.Text = GetTideText(results.SecondHighTide, results);
            lowTide1.Text  = GetTideText(results.FirstLowTide, results);
            lowTide2.Text  = GetTideText(results.SecondLowTide, results);
            sunRise.Text   = results.SunRise.Value.ToShortTimeString();
            sunSet.Text    = results.SunSet.Value.ToShortTimeString();
            //Toast.MakeText(this, toast, ToastLength.Short).Show();
        }