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); } }
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); } }
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; } }
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); } }
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; }