Beispiel #1
0
        private async void TxtSearch_TextChanged(object sender, Android.Text.TextChangedEventArgs e)
        {
            var places = await googleMapsApi.GetPlaces(e.Text.ToString());

            var listSearch = FindViewById <ListView>(Resource.Id.listSearch);

            Adapter = new GooglePlaceAutoCompletePredictionAdapter(Application.Context, places.AutoCompletePlaces);

            listSearch.Adapter = Adapter;
        }
        public async Task GetPlacesByName(string placeText)
        {
            var places = await googleMapsApi.GetPlaces(placeText);

            var placeResult = places.AutoCompletePlaces;

            if (placeResult != null && placeResult.Count > 0)
            {
                Places = new ObservableCollection <GooglePlaceAutoCompletePrediction>(placeResult);
            }
        }
Beispiel #3
0
        public async Task GetPlacesByName(string placeText)
        {
            Device.BeginInvokeOnMainThread(() => IsBusy = true);
            var places = await googleMapsApi.GetPlaces(placeText);

            var placeResult = places.AutoCompletePlaces;

            if (placeResult != null && placeResult.Count > 0)
            {
                Places = new ObservableCollection <GooglePlaceAutoCompletePrediction>(placeResult);
                Device.BeginInvokeOnMainThread(() => IsBusy = false);
            }
        }
Beispiel #4
0
        public async Task GetPlacesByName(string placeText)
        {
            var places = await _googleMapsApi.GetPlaces(placeText);

            var placeResult = places?.AutoCompletePlaces;

            if (placeResult != null && placeResult.Count > 0)
            {
                Places = new ObservableCollection <GooglePlaceAutoCompletePrediction>(placeResult);
            }

            Suggestions?.Clear();
            foreach (var place in Places)
            {
                Suggestions?.Add($"{place.StructuredFormatting.MainText} - {place.StructuredFormatting.SecondaryText}");
            }
        }
        public async Task GetPlacesByName(string placeText)
        {
            try
            {
                var places = await googleMapsApi.GetPlaces(placeText);

                var placeResult = places.AutoCompletePlaces;
                if (placeResult != null && placeResult.Count > 0)
                {
                    Places = new ObservableCollection <GooglePlaceAutoCompletePrediction>(placeResult);
                }

                ShowRecentPlaces = (placeResult == null || placeResult.Count == 0);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #6
0
        async void ExecuteSearch()
        {
            try
            {
                if (!string.IsNullOrEmpty(SearchAddress))
                {
                    var res = await _googleMapsApiService.GetPlaces(SearchAddress);

                    if (res.AutoCompletePlaces?.Count > 0)
                    {
                        PlacesResult = new List <GooglePlaceAutoCompletePrediction>(res.AutoCompletePlaces);
                    }
                }
                else
                {
                    PlacesResult = new List <GooglePlaceAutoCompletePrediction>();
                }
            }
            catch (Exception ex)
            {
                _quickMessageDependency.ShowToastMessage(ex.Message);
            }
        }
Beispiel #7
0
        public async Task GetPlacesByName(string placeText)
        {
            var places = await googleMapsApi.GetPlaces(placeText);

            var placeResult = places.AutoCompletePlaces;

            if (placeResult != null && placeResult.Count > 0)
            {
                GoogleLocations = new ObservableCollection <GooglePlaceAutoCompletePrediction>(placeResult);
            }

            if (placeResult == null || placeResult.Count == 0)
            {
                ShowRecentPlaces = false;
            }
            else
            {
                ShowRecentPlaces = true;
            }

            PickupText       = DestinationText = string.Empty;
            ShowRecentPlaces = true;
        }