public class PlacePickerFragment extends PickerFragment<GraphPlace>
PickerFragment.GraphObjectFilter<T>, PickerFragment.OnDataChangedListener, PickerFragment.OnDoneButtonClickedListener, PickerFragment.OnErrorListener, PickerFragment.OnSelectionChangedListener
Fragment.InstantiationException, Fragment.SavedState
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_RADIUS_IN_METERS
The default radius around the center point to search.
|
static int |
DEFAULT_RESULTS_LIMIT
The default number of results to retrieve.
|
static String |
LOCATION_BUNDLE_KEY
The key for a Location parameter in the fragment's Intent bundle to indicate what geographical
location should be the center of the search.
|
static String |
RADIUS_IN_METERS_BUNDLE_KEY
The key for an int parameter in the fragment's Intent bundle to indicate the radius in meters around
the center point to search.
|
static String |
RESULTS_LIMIT_BUNDLE_KEY
The key for an int parameter in the fragment's Intent bundle to indicate what how many results to
return at a time.
|
static String |
SEARCH_TEXT_BUNDLE_KEY
The key for a String parameter in the fragment's Intent bundle to indicate what search text should
be sent to the service.
|
static String |
SHOW_SEARCH_BOX_BUNDLE_KEY
The key for a boolean parameter in the fragment's Intent bundle to indicate that the fragment
should display a search box and automatically update the search text as it changes.
|
DONE_BUTTON_TEXT_BUNDLE_KEY, EXTRA_FIELDS_BUNDLE_KEY, SHOW_PICTURES_BUNDLE_KEY, SHOW_TITLE_BAR_BUNDLE_KEY, TITLE_TEXT_BUNDLE_KEY
Constructor and Description |
---|
PlacePickerFragment()
Default constructor.
|
PlacePickerFragment(Bundle args)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Location |
getLocation()
Gets the location to search around.
|
int |
getRadiusInMeters()
Gets the radius in meters around the location to search.
|
int |
getResultsLimit()
Gets the number of results to retrieve.
|
String |
getSearchText()
Gets the search text (e.g., category, name) to search for.
|
GraphPlace |
getSelection()
Gets the currently-selected place.
|
void |
onAttach(Activity activity) |
void |
onDetach() |
void |
onInflate(Activity activity,
AttributeSet attrs,
Bundle savedInstanceState) |
void |
onSearchBoxTextChanged(String searchText,
boolean forceReloadEventIfSameText)
Sets the search text and reloads the data in the control.
|
void |
setLocation(Location location)
Sets the location to search around.
|
void |
setRadiusInMeters(int radiusInMeters)
Sets the radius in meters around the location to search.
|
void |
setResultsLimit(int resultsLimit)
Sets the number of results to retrieve.
|
void |
setSearchText(String searchText)
Sets the search text (e.g., category, name) to search for.
|
void |
setSettingsFromBundle(Bundle inState)
Updates the properties of the PickerFragment based on the contents of the supplied Bundle;
calling Activities may use this to pass additional configuration information to the
PickerFragment beyond what is specified in its XML layout.
|
getDoneButtonText, getExtraFields, getFilter, getOnDataChangedListener, getOnDoneButtonClickedListener, getOnErrorListener, getOnSelectionChangedListener, getSession, getShowPictures, getShowTitleBar, getTitleText, loadData, onActivityCreated, onCreate, onCreateView, onSaveInstanceState, onStop, setArguments, setDoneButtonText, setExtraFields, setFilter, setOnDataChangedListener, setOnDoneButtonClickedListener, setOnErrorListener, setOnSelectionChangedListener, setSession, setShowPictures, setShowTitleBar, setTitleText
dump, equals, getActivity, getArguments, getChildFragmentManager, getFragmentManager, getId, getLayoutInflater, getLoaderManager, getParentFragment, getResources, getRetainInstance, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, hashCode, hasOptionsMenu, instantiate, instantiate, isAdded, isDetached, isHidden, isInLayout, isMenuVisible, isRemoving, isResumed, isVisible, onActivityResult, onConfigurationChanged, onContextItemSelected, onCreateAnimation, onCreateContextMenu, onCreateOptionsMenu, onDestroy, onDestroyOptionsMenu, onDestroyView, onHiddenChanged, onLowMemory, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPrepareOptionsMenu, onResume, onStart, onViewCreated, onViewStateRestored, registerForContextMenu, setHasOptionsMenu, setInitialSavedState, setMenuVisibility, setRetainInstance, setTargetFragment, setUserVisibleHint, startActivity, startActivityForResult, toString, unregisterForContextMenu
public static final String RADIUS_IN_METERS_BUNDLE_KEY
public static final String RESULTS_LIMIT_BUNDLE_KEY
public static final String SEARCH_TEXT_BUNDLE_KEY
public static final String LOCATION_BUNDLE_KEY
public static final String SHOW_SEARCH_BOX_BUNDLE_KEY
public static final int DEFAULT_RADIUS_IN_METERS
public static final int DEFAULT_RESULTS_LIMIT
public PlacePickerFragment()
public PlacePickerFragment(Bundle args)
args
- a Bundle that optionally contains one or more values containing additional
configuration information for the Fragment.public Location getLocation()
public void setLocation(Location location)
location
- the Location to search aroundpublic int getRadiusInMeters()
public void setRadiusInMeters(int radiusInMeters)
radiusInMeters
- the radius in meterspublic int getResultsLimit()
public void setResultsLimit(int resultsLimit)
resultsLimit
- the number of results to retrievepublic String getSearchText()
public void setSearchText(String searchText)
searchText
- the search textpublic void onSearchBoxTextChanged(String searchText, boolean forceReloadEventIfSameText)
searchText
- the search textforceReloadEventIfSameText
- if true, will reload even if the search text has not changed; if false,
identical search text will not force a reloadpublic GraphPlace getSelection()
public void setSettingsFromBundle(Bundle inState)
PickerFragment
setSettingsFromBundle
in class PickerFragment<GraphPlace>
inState
- a Bundle containing keys corresponding to properties of the PickerFragmentpublic void onInflate(Activity activity, AttributeSet attrs, Bundle savedInstanceState)
onInflate
in class PickerFragment<GraphPlace>
public void onDetach()
onDetach
in class PickerFragment<GraphPlace>