Esempio n. 1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            var _items = new List <CarInfo>()
            {
                new CarInfo()
                {
                    Manufacturer = "", Model = "4m/s", Year = "1980", KW = "123"
                },
                new CarInfo()
                {
                    Manufacturer = "10c", Model = "2m/s", Year = "2200", KW = "133"
                },
                new CarInfo()
                {
                    Manufacturer = "9c", Model = "7m/s", Year = "4212", KW = "163"
                },
                new CarInfo()
                {
                    Manufacturer = "15c", Model = "5m/s", Year = "1245", KW = "143"
                },
                new CarInfo()
                {
                    Manufacturer = "13c", Model = "2m/s", Year = "1990", KW = "222"
                },
                new CarInfo()
                {
                    Manufacturer = "11c", Model = "1m/s", Year = "1980", KW = "14"
                },
                new CarInfo()
                {
                    Manufacturer = "12c", Model = "4m/s", Year = "1895", KW = "754"
                },
                new CarInfo()
                {
                    Manufacturer = "13c", Model = "2m/s", Year = "1995", KW = "432"
                },
                new CarInfo()
                {
                    Manufacturer = "11c", Model = "1m/s", Year = "2012", KW = "123"
                },
                new CarInfo()
                {
                    Manufacturer = "12c", Model = "4m/s", Year = "2002", KW = "64"
                },
            };

            ListAdapter = new BasicAdapter(this, _items);

            ListView.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs args)
            {
                var item = _items[args.Position];

                Toast.MakeText(Application, item.Manufacturer, ToastLength.Short).Show();
            };
        }
Esempio n. 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            _items = new List <CarInfo>()
            {
                new CarInfo()
                {
                    Manufacturer = "Audi", Model = "1", Year = "2002", KW = "1"
                },
                new CarInfo()
                {
                    Manufacturer = "Audi", Model = "1", Year = "2002", KW = "1"
                },
                new CarInfo()
                {
                    Manufacturer = "Audi", Model = "1", Year = "2002", KW = "1"
                },
                new CarInfo()
                {
                    Manufacturer = "Audi", Model = "1", Year = "2002", KW = "1"
                },
                new CarInfo()
                {
                    Manufacturer = "Audi", Model = "1", Year = "2002", KW = "1"
                },
                new CarInfo()
                {
                    Manufacturer = "Audi", Model = "1", Year = "2002", KW = "1"
                },
                new CarInfo()
                {
                    Manufacturer = "Audi", Model = "1", Year = "2002", KW = "1"
                },
                new CarInfo()
                {
                    Manufacturer = "Audi", Model = "1", Year = "2002", KW = "1"
                },
                new CarInfo()
                {
                    Manufacturer = "Audi", Model = "1", Year = "2002", KW = "1"
                },
                new CarInfo()
                {
                    Manufacturer = "Audi", Model = "1", Year = "2002", KW = "1"
                }
            };

            ListAdapter = new BasicAdapter(this, _items);

            ListView.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs args)
            {
                var item = _items[args.Position];

                Toast.MakeText(Application, item.Manufacturer, ToastLength.Short).Show();
            };
        }
Esempio n. 3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            List <WeatherInfo> _items;
            var queryString = "https://www.metaweather.com/api/location/4418";

            //var data = Core.DataService.GetDataFromService(queryString);

            _items = new List <WeatherInfo>()
            {
                new WeatherInfo()
                {
                    Name = "Esmaspäev", Temperature = "12C", WindSpeed = "4m/s"
                },
                new WeatherInfo()
                {
                    Name = "Teisipäev", Temperature = "10C", WindSpeed = "5m/s"
                },
                new WeatherInfo()
                {
                    Name = "Kolmapäev", Temperature = "12C", WindSpeed = "4m/s"
                },
                new WeatherInfo()
                {
                    Name = "Neljapäev", Temperature = "12C", WindSpeed = "4m/s"
                },
                new WeatherInfo()
                {
                    Name = "Reede", Temperature = "12C", WindSpeed = "4m/s"
                },
                new WeatherInfo()
                {
                    Name = "Laupäev", Temperature = "12C", WindSpeed = "4m/s"
                },
                new WeatherInfo()
                {
                    Name = "Pühapäev", Temperature = "12C", WindSpeed = "4m/s"
                },
            };

            ListAdapter         = new BasicAdapter(this, _items);
            ListView.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs args)
            {
                //var item=_items[args]
                Toast.MakeText(Application, ((TextView)args.View).Text, ToastLength.Short).Show();
            };
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            _items = new List <WeatherInfo>()
            {
                new WeatherInfo()
                {
                    Name = "Esmaspäev", Temperature = "12c", WindSpeed = "4m/s"
                },
                new WeatherInfo()
                {
                    Name = "Teisipäev", Temperature = "11c", WindSpeed = "2m/s"
                },
                new WeatherInfo()
                {
                    Name = "Kolmapäev", Temperature = "9c", WindSpeed = "6m/s"
                },
                new WeatherInfo()
                {
                    Name = "Neljapäev", Temperature = "12c", WindSpeed = "4m/s"
                },
                new WeatherInfo()
                {
                    Name = "Reede", Temperature = "4c", WindSpeed = "2m/s"
                },
                new WeatherInfo()
                {
                    Name = "Laupäev", Temperature = "2c", WindSpeed = "3m/s"
                },
                new WeatherInfo()
                {
                    Name = "Pühapäev", Temperature = "15c", WindSpeed = "6m/s"
                }
            };

            ListAdapter = new BasicAdapter(this, _items);

            ListView.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs args)
            {
                var item = _items[args.Position];

                Toast.MakeText(Application, item.Name, ToastLength.Short).Show();
            };
        }