private void Spinner_ItemSelected(object sender, AdapterView.ItemSelectedEventArgs e)
        {
            Spinner spinner = (Spinner)sender;
            string  toast   = spinner.GetItemAtPosition(e.Position).ToString();

            Toast.MakeText(e.Parent.Context, toast, ToastLength.Long).Show();
            mCarName = toast;

            var url        = "http://10.0.2.2:4344/image/" + toast;
            var imageBimap = HttpImage.GetImageBitmapFromUri(url);

            mCarView.SetImageBitmap(imageBimap);
        }
Exemplo n.º 2
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            View row = convertView;

            if (row == null)
            {
                row = LayoutInflater.From(mContent).Inflate(Resource.Menu.fScheduleList, null, false);
            }


            TextView mDepatureDate = row.FindViewById <TextView>(Resource.Id.Sch_depatureD);

            mDepatureDate.Text = mItems[position].DepartDate.ToShortDateString();

            TextView mDepatureTime = row.FindViewById <TextView>(Resource.Id.Sch_depatureT);

            mDepatureTime.Text = mItems[position].DepartTime.ToShortTimeString();

            for (int x = 0; x < mItems[position].aircrafts.Count; x++)
            {
                TextView mFlightName = row.FindViewById <TextView>(Resource.Id.Sch_flightName);
                string   Flight      = mItems[position].aircrafts[x].AircraftName + " #" + mItems[position].aircrafts[x].AircraftNo;
                mFlightName.Text = Flight;

                TextView mPrice = row.FindViewById <TextView>(Resource.Id.Sch_price);
                mPrice.Text = mItems[position].aircrafts[x].price.ToString();

                TextView mSeatLeft = row.FindViewById <TextView>(Resource.Id.Sch_seatLeft);
                int      seatLeft  = mItems[position].aircrafts[x].MaxSeats - mItems[position].aircrafts[x].NumSeatBooked;
                mSeatLeft.Text = seatLeft.ToString();

                ImageView FlightLogo = row.FindViewById <ImageView>(Resource.Id.Sch_flightImg);

                var url        = "http://10.0.2.2:4344/image/" + (mItems[position].aircrafts[x].AircraftLogo);
                var imageBimap = HttpImage.GetImageBitmapFromUri(url);
                FlightLogo.SetImageBitmap(imageBimap);
                int brk = 0;
            }
            return(row);
        }