public async void DownloadPoiListAsync()
 {
     progressBar.Visibility = Android.Views.ViewStates.Visible;
     poiListData            = GetPoiListTestData();
     progressBar.Visibility = Android.Views.ViewStates.Gone;
     listAdapter            = new POIListViewAdapter(this, poiListData);
     poiListView.Adapter    = listAdapter;
 }
Esempio n. 2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.POIList);
            _poiListView = FindViewById <ListView>
                               (Resource.Id.poiListView);
            _adapter             = new POIListViewAdapter(this);
            _poiListView.Adapter = _adapter;
        }
Esempio n. 3
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.POIList);

            _locationManager        = GetSystemService(Context.LocationService) as LocationManager;
            _poiListView            = FindViewById <ListView>(Resource.Id.poiListView);
            _listViewAdapter        = new POIListViewAdapter(this);
            _poiListView.Adapter    = _listViewAdapter;
            _poiListView.ItemClick += OnPOIClicked;
        }
Esempio n. 4
0
        public async void DownloadPoisListAsync()
        {
            progressBar.Visibility = ViewStates.Visible;
            POIService service = new POIService();

            if (!service.isConnected(this))
            {
                Toast toast = Toast.MakeText(this, "Not conntected to internet.Please check your device network settings.", ToastLength.Long);
                toast.Show();
            }
            else
            {
                poiListData = await service.GetPOIListAsync();

                progressBar.Visibility = ViewStates.Gone;
                poiListAdapter         = new POIListViewAdapter(this, poiListData);
                poiListView.Adapter    = poiListAdapter;
            }
        }
Esempio n. 5
0
        private async void DownloadPoisListAsync()
        {
            if (!IsConnected())
            {
                Toast toast = Toast.MakeText(this, "Not conntected to internet. Please check your device network settings.", ToastLength.Short);
                toast.Show();
                return;
            }

            progressBar.Visibility = ViewStates.Visible;
            poiListData            = await new POIService().GetPOIListAsync();
            progressBar.Visibility = ViewStates.Gone;

            poiListAdapter      = new POIListViewAdapter(this, poiListData.Pois);
            poiListView.Adapter = poiListAdapter;

            poiListView.Post(() => {
                poiListView.SetSelection(scrollPosition);
            });
        }