Java 类com.google.android.gms.location.places.AutocompleteFilter 实例源码

项目:cast-dashboard-android-app    文件:WeatherSettings.java   
@OnClick(R.id.weather_city)
public void selectCity() {

    //restrict to cities
    AutocompleteFilter cityFilter = new AutocompleteFilter.Builder()
            .setTypeFilter(AutocompleteFilter.TYPE_FILTER_CITIES)
            .build();
    try {
        Intent intent =
                new PlaceAutocomplete.IntentBuilder(PlaceAutocomplete.MODE_OVERLAY)
                        .setFilter(cityFilter)
                        .build(getActivity());
        startActivityForResult(intent, PLACE_AUTOCOMPLETE_REQUEST_CODE);
    } catch (GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException e) {
        // TODO: Handle the error.
    }
}
项目:MADBike    文件:PlaceAutocompleteAdapter.java   
public PlaceAutocompleteAdapter(Context context, GoogleApiClient googleApiClient,
                                LatLngBounds bounds, AutocompleteFilter filter) {
    super(context, android.R.layout.simple_expandable_list_item_2, android.R.id.text1);
    mGoogleApiClient = googleApiClient;
    mBounds = bounds;
    mPlaceFilter = filter;
}
项目:AutocompleteLocation    文件:AutoCompleteAdapter.java   
public AutoCompleteAdapter(Context context, GoogleApiClient googleApiClient, LatLngBounds bounds,
    AutocompleteFilter filter) {
  super(context, android.R.layout.simple_expandable_list_item_2, android.R.id.text1);
  mGoogleApiClient = googleApiClient;
  mBounds = bounds;
  mPlaceFilter = filter;
}
项目:Overkill    文件:PlaceAutoCompleteAdapter.java   
/**
 * Initializes with a resource for text rows and autocomplete query bounds.
 *
 * @see ArrayAdapter#ArrayAdapter(Context, int)
 */
public PlaceAutoCompleteAdapter(Context context, int resource, GoogleApiClient googleApiClient,
                                LatLngBounds bounds, AutocompleteFilter filter) {
    super(context, resource);
    mGoogleApiClient = googleApiClient;
    mBounds = bounds;
    mPlaceFilter = filter;
}
项目:MapsWithPlacesAutoComplete    文件:AutoCompleteAdapter.java   
public AutoCompleteAdapter(Context mContext, int mLayout, GoogleApiClient mGoogleApiClient, LatLngBounds mBounds, AutocompleteFilter mPlaceFilter, PlaceAutoCompleteInterface mPlaceClickInterface){
    this.mContext=mContext;
    this.mLayout=mLayout;
    this.mGoogleApiClient=mGoogleApiClient;
    this.mPlaceFilter=mPlaceFilter;
    this.mBounds=mBounds;
    this.mPlaceClickInterface=mPlaceClickInterface;
}
项目:bikedeboa-android    文件:MapActivity.java   
@Override
public void onClick(View v) {
    try {
        // Launch autocomplete activity
        Intent intent = new PlaceAutocomplete.IntentBuilder(PlaceAutocomplete.MODE_FULLSCREEN)
                .setFilter(new AutocompleteFilter.Builder()
                        .setCountry("BR")
                        .build())
                .build(MapActivity.this);
        startActivityForResult(intent, PLACE_AUTOCOMPLETE_REQUEST_CODE);
    } catch (GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException e) {
        // TODO: Handle the error.
    }
}
项目:AutocompleteLocation    文件:AutoCompleteAdapter.java   
public AutoCompleteAdapter(Context context, GoogleApiClient googleApiClient, LatLngBounds bounds,
    AutocompleteFilter filter) {
  super(context, android.R.layout.simple_expandable_list_item_2, android.R.id.text1);
  mGoogleApiClient = googleApiClient;
  mBounds = bounds;
  mPlaceFilter = filter;
}
项目:place-search-dialog    文件:PlaceAutocompleteAdapter.java   
/**
 * Initializes with a resource for text rows and autocomplete query bounds.
 *
 * @see ArrayAdapter#ArrayAdapter(Context, int)
 */
public PlaceAutocompleteAdapter(Context context, GoogleApiClient googleApiClient,
                                LatLngBounds bounds, AutocompleteFilter filter) {
    super(context, android.R.layout.simple_expandable_list_item_2, android.R.id.text1);
    mGoogleApiClient = googleApiClient;
    mBounds = bounds;
    mPlaceFilter = filter;
}
项目:Airbnb-Android-Google-Map-View    文件:PlaceAutocompleteAdapter.java   
/**
 * Initializes with a resource for text rows and autocomplete query bounds.
 *
 * @see ArrayAdapter#ArrayAdapter(Context, int)
 */
public PlaceAutocompleteAdapter(Context context, int resource, GoogleApiClient googleApiClient,
                                LatLngBounds bounds, AutocompleteFilter filter) {
    super(context, resource);
    mResultList = new ArrayList<>();
    mContext = context;
    mGoogleApiClient = googleApiClient;
    mBounds = bounds;
    mPlaceFilter = filter;
}
项目:Akwukwo    文件:PlaceAutocompleteAdapter.java   
/**
 * Initializes with a resource for text rows and autocomplete query bounds.
 *
 * @see android.widget.ArrayAdapter#ArrayAdapter(android.content.Context, int)
 */
public PlaceAutocompleteAdapter(Context context, GoogleApiClient googleApiClient,
                                LatLngBounds bounds, AutocompleteFilter filter) {
    super(context, android.R.layout.simple_expandable_list_item_2, android.R.id.text1);
    mGoogleApiClient = googleApiClient;
    mBounds = bounds;
    mPlaceFilter = filter;
}
项目:ExamplesAndroid    文件:PlaceAutocompleteAdapter.java   
/**
 * Initializes with a resource for text rows and autocomplete query bounds.
 *
 * @see android.widget.ArrayAdapter#ArrayAdapter(android.content.Context, int)
 */
public PlaceAutocompleteAdapter(Context context, GoogleApiClient googleApiClient,
                                LatLngBounds bounds, AutocompleteFilter filter) {
    super(context, android.R.layout.simple_expandable_list_item_2, android.R.id.text1);
    mGoogleApiClient = googleApiClient;
    mBounds = bounds;
    mPlaceFilter = filter;
}
项目:Ghumo_Android    文件:PlaceAutoCompleteAdapter.java   
/**
 * Initializes with a resource for text rows and autocomplete query bounds.
 *
 * @see ArrayAdapter#ArrayAdapter(Context, int)
 */
public PlaceAutoCompleteAdapter(Context context, int resource, GoogleApiClient googleApiClient,
                                LatLngBounds bounds, AutocompleteFilter filter) {
    super(context, resource);
    mGoogleApiClient = googleApiClient;
    mBounds = bounds;
    mPlaceFilter = filter;
}
项目:Bikeable    文件:PlaceAutocompleteAdapter.java   
/**
 * Initializes with a resource for text rows and autocomplete query bounds.
 *
 * @see ArrayAdapter#ArrayAdapter(Context, int)
 */
public PlaceAutocompleteAdapter(Context context, GoogleApiClient googleApiClient,
                                LatLngBounds bounds, AutocompleteFilter filter) {
    super(context, R.layout.list_item_layout, android.R.id.text1);
    mGoogleApiClient = googleApiClient;
    mBounds = bounds;
    mPlaceFilter = filter;
    fixedResults = new ArrayList<>();
}
项目:amos-ss15-proj2    文件:PlaceAutocompleteAdapter.java   
/**
 * Initializes with a resource for text rows and autocomplete query bounds.
 *
 * @see android.widget.ArrayAdapter#ArrayAdapter(android.content.Context, int)
 */
public PlaceAutocompleteAdapter(Context context, int resource, LatLngBounds bounds,
                                AutocompleteFilter filter) {
    super(context, resource);
    mBounds = bounds;
    mPlaceFilter = filter;
}
项目:farmers-market-finder    文件:PlaceAutocompleteAdapter.java   
public PlaceAutocompleteAdapter(Context context, int resource, GoogleApiClient googleApiClient,
                                LatLngBounds bounds, AutocompleteFilter filter) {
    super(context, resource);
    mGoogleApiClient = googleApiClient;
    mBounds = bounds;
    mPlaceFilter = filter;
}
项目:android-play-places    文件:PlaceAutocompleteAdapter.java   
/**
 * Initializes with a resource for text rows and autocomplete query bounds.
 *
 * @see android.widget.ArrayAdapter#ArrayAdapter(android.content.Context, int)
 */
public PlaceAutocompleteAdapter(Context context, GeoDataClient geoDataClient,
        LatLngBounds bounds, AutocompleteFilter filter) {
    super(context, android.R.layout.simple_expandable_list_item_2, android.R.id.text1);
    mGeoDataClient = geoDataClient;
    mBounds = bounds;
    mPlaceFilter = filter;
}
项目:AndroidDemoProjects    文件:AutoCompleteAdapter.java   
private void displayPredictiveResults( String query )
{
    //Southwest corner to Northeast corner.
    LatLngBounds bounds = new LatLngBounds( new LatLng( 39.906374, -105.122337 ), new LatLng( 39.949552, -105.068779 ) );

    //Filter: https://developers.google.com/places/supported_types#table3
    List<Integer> filterTypes = new ArrayList<Integer>();
    filterTypes.add( Place.TYPE_ESTABLISHMENT );

    Places.GeoDataApi.getAutocompletePredictions( mGoogleApiClient, query, bounds, AutocompleteFilter.create( filterTypes ) )
        .setResultCallback (
            new ResultCallback<AutocompletePredictionBuffer>() {
                @Override
                public void onResult( AutocompletePredictionBuffer buffer ) {

                    if( buffer == null )
                        return;

                    if( buffer.getStatus().isSuccess() ) {
                        for( AutocompletePrediction prediction : buffer ) {
                            //Add as a new item to avoid IllegalArgumentsException when buffer is released
                            add( new AutoCompletePlace( prediction.getPlaceId(), prediction.getDescription() ) );
                        }
                    }

                    //Prevent memory leak by releasing buffer
                    buffer.release();
                }
            }, 60, TimeUnit.SECONDS );
}
项目:GoogleAutoCompleteWithRecyclerView    文件:PlacesAutoCompleteAdapter.java   
public PlacesAutoCompleteAdapter(Context context, int resource, GoogleApiClient googleApiClient,
                                LatLngBounds bounds, AutocompleteFilter filter) {
    mContext = context;
    layout = resource;
    mGoogleApiClient = googleApiClient;
    mBounds = bounds;
    mPlaceFilter = filter;
}
项目:voyager2-android    文件:PlaceAutoCompleteAdapter.java   
/**
 * Initializes with a resource for text rows and autocomplete query bounds.
 *
 * @see ArrayAdapter#ArrayAdapter(Context, int)
 */
public PlaceAutoCompleteAdapter(Context context, int resource, GoogleApiClient googleApiClient, LatLngBounds bounds, AutocompleteFilter filter) {
    super(context, resource);
    mGoogleApiClient = googleApiClient;
    mBounds = bounds;
    mPlaceFilter = filter;
}
项目:Google-Directions-Android    文件:PlaceAutoCompleteAdapter.java   
/**
 * Initializes with a resource for text rows and autocomplete query bounds.
 *
 * @see ArrayAdapter#ArrayAdapter(Context, int)
 */
public PlaceAutoCompleteAdapter(Context context, int resource, GoogleApiClient googleApiClient,
                                LatLngBounds bounds, AutocompleteFilter filter) {
    super(context, resource);
    mGoogleApiClient = googleApiClient;
    mBounds = bounds;
    mPlaceFilter = filter;
}
项目:go-jay    文件:PlaceAutoCompleteHelper.java   
public PlaceAutoCompleteAdapter(Context context, GoogleApiClient googleApiClient,
                                AutocompleteFilter filter) {
    super(context, R.layout.item_place, R.id.place1);
    mGoogleApiClient = googleApiClient;
    mPlaceFilter = filter;
}
项目:RxTask    文件:RxGeoDataClient.java   
@NonNull
public Single<AutocompletePredictionBufferResponse> getAutocompletePredictions(String query,
                                                                               LatLngBounds
                                                                                       bounds, AutocompleteFilter filter) {
    return SingleTask.create(() -> client.getAutocompletePredictions(query, bounds, filter));
}
项目:movemate_android    文件:PlaceArrayAdapter.java   
public PlaceArrayAdapter(Context context, int resource, LatLngBounds bounds,
                         AutocompleteFilter filter) {
    super(context, resource);
    mBounds = bounds;
    mPlaceFilter = filter;
}
项目:android_packages_apps_GmsCore    文件:GoogleLocationManagerServiceImpl.java   
@Override
public void iglms55(String var1, LatLngBounds var2, AutocompleteFilter var3, PlacesParams var4,
                    IPlacesCallbacks var5) throws RemoteException {
    Log.d(TAG, "iglms55: " + var1);
}
项目:GitHub    文件:ReactiveLocationProvider.java   
/**
 * Returns observable that fetches autocomplete predictions from Places API. To flatmap and autorelease
 * {@link com.google.android.gms.location.places.AutocompletePredictionBuffer} you can use
 * {@link DataBufferObservable}.
 *
 * @param query  search query
 * @param bounds bounds where to fetch suggestions from
 * @param filter filter
 * @return observable with suggestions buffer and completes
 */
public Observable<AutocompletePredictionBuffer> getPlaceAutocompletePredictions(final String query, final LatLngBounds bounds, final AutocompleteFilter filter) {
    return getGoogleApiClientObservable(Places.PLACE_DETECTION_API, Places.GEO_DATA_API)
            .flatMap(new Func1<GoogleApiClient, Observable<AutocompletePredictionBuffer>>() {
                @Override
                public Observable<AutocompletePredictionBuffer> call(GoogleApiClient api) {
                    return fromPendingResult(Places.GeoDataApi.getAutocompletePredictions(api, query, bounds, filter));
                }
            });
}
项目:moneytracking    文件:PlaceAdapter.java   
/**
 * Constructor
 *
 * @param context  Context
 * @param resource Layout resource
 * @param bounds   Used to specify the search bounds
 * @param filter   Used to specify place types
 */
public PlaceAdapter(Context context, int resource, LatLngBounds bounds,
                    AutocompleteFilter filter) {
    super(context, resource);
    mBounds = bounds;
    mPlaceFilter = filter;
}
项目:PlaceAPIAutocomplete    文件:PlaceArrayAdapter.java   
/**
 * Constructor
 *
 * @param context  Context
 * @param resource Layout resource
 * @param bounds   Used to specify the search bounds
 * @param filter   Used to specify place types
 */
public PlaceArrayAdapter(Context context, int resource, LatLngBounds bounds,
                         AutocompleteFilter filter) {
    super(context, resource);
    mBounds = bounds;
    mPlaceFilter = filter;
}