当前位置: 首页>>代码示例>>Java>>正文


Java AutocompleteFilter类代码示例

本文整理汇总了Java中com.google.android.gms.location.places.AutocompleteFilter的典型用法代码示例。如果您正苦于以下问题:Java AutocompleteFilter类的具体用法?Java AutocompleteFilter怎么用?Java AutocompleteFilter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AutocompleteFilter类属于com.google.android.gms.location.places包,在下文中一共展示了AutocompleteFilter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: selectCity

import com.google.android.gms.location.places.AutocompleteFilter; //导入依赖的package包/类
@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.
    }
}
 
开发者ID:dan-silver,项目名称:cast-dashboard-android-app,代码行数:18,代码来源:WeatherSettings.java

示例2: PlaceAutocompleteAdapter

import com.google.android.gms.location.places.AutocompleteFilter; //导入依赖的package包/类
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;
}
 
开发者ID:Mun0n,项目名称:MADBike,代码行数:8,代码来源:PlaceAutocompleteAdapter.java

示例3: AutoCompleteAdapter

import com.google.android.gms.location.places.AutocompleteFilter; //导入依赖的package包/类
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;
}
 
开发者ID:jotaramirez90,项目名称:AutocompleteLocation,代码行数:8,代码来源:AutoCompleteAdapter.java

示例4: PlaceAutoCompleteAdapter

import com.google.android.gms.location.places.AutocompleteFilter; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:LewisVo,项目名称:Overkill,代码行数:13,代码来源:PlaceAutoCompleteAdapter.java

示例5: AutoCompleteAdapter

import com.google.android.gms.location.places.AutocompleteFilter; //导入依赖的package包/类
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;
}
 
开发者ID:pmathew92,项目名称:MapsWithPlacesAutoComplete,代码行数:9,代码来源:AutoCompleteAdapter.java

示例6: onClick

import com.google.android.gms.location.places.AutocompleteFilter; //导入依赖的package包/类
@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.
	}
}
 
开发者ID:EduardoVernier,项目名称:bikedeboa-android,代码行数:15,代码来源:MapActivity.java

示例7: PlaceAutocompleteAdapter

import com.google.android.gms.location.places.AutocompleteFilter; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:codemybrainsout,项目名称:place-search-dialog,代码行数:13,代码来源:PlaceAutocompleteAdapter.java

示例8: PlaceAutocompleteAdapter

import com.google.android.gms.location.places.AutocompleteFilter; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:SkyTreasure,项目名称:Airbnb-Android-Google-Map-View,代码行数:15,代码来源:PlaceAutocompleteAdapter.java

示例9: PlaceAutocompleteAdapter

import com.google.android.gms.location.places.AutocompleteFilter; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:blessingoraz,项目名称:Akwukwo,代码行数:13,代码来源:PlaceAutocompleteAdapter.java

示例10: PlaceAutocompleteAdapter

import com.google.android.gms.location.places.AutocompleteFilter; //导入依赖的package包/类
/**
 * 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<>();
}
 
开发者ID:nogalavi,项目名称:Bikeable,代码行数:14,代码来源:PlaceAutocompleteAdapter.java

示例11: PlaceAutocompleteAdapter

import com.google.android.gms.location.places.AutocompleteFilter; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:AMOS-2015,项目名称:amos-ss15-proj2,代码行数:12,代码来源:PlaceAutocompleteAdapter.java

示例12: PlaceAutocompleteAdapter

import com.google.android.gms.location.places.AutocompleteFilter; //导入依赖的package包/类
public PlaceAutocompleteAdapter(Context context, int resource, GoogleApiClient googleApiClient,
                                LatLngBounds bounds, AutocompleteFilter filter) {
    super(context, resource);
    mGoogleApiClient = googleApiClient;
    mBounds = bounds;
    mPlaceFilter = filter;
}
 
开发者ID:dakotasanchez,项目名称:farmers-market-finder,代码行数:8,代码来源:PlaceAutocompleteAdapter.java

示例13: PlaceAutocompleteAdapter

import com.google.android.gms.location.places.AutocompleteFilter; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:googlesamples,项目名称:android-play-places,代码行数:13,代码来源:PlaceAutocompleteAdapter.java

示例14: displayPredictiveResults

import com.google.android.gms.location.places.AutocompleteFilter; //导入依赖的package包/类
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 );
}
 
开发者ID:Lakkichand,项目名称:AndroidDemoProjects,代码行数:31,代码来源:AutoCompleteAdapter.java

示例15: PlacesAutoCompleteAdapter

import com.google.android.gms.location.places.AutocompleteFilter; //导入依赖的package包/类
public PlacesAutoCompleteAdapter(Context context, int resource, GoogleApiClient googleApiClient,
                                LatLngBounds bounds, AutocompleteFilter filter) {
    mContext = context;
    layout = resource;
    mGoogleApiClient = googleApiClient;
    mBounds = bounds;
    mPlaceFilter = filter;
}
 
开发者ID:doomtrooper,项目名称:GoogleAutoCompleteWithRecyclerView,代码行数:9,代码来源:PlacesAutoCompleteAdapter.java


注:本文中的com.google.android.gms.location.places.AutocompleteFilter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。