com.facebook.widget
Class PlacePickerFragment

java.lang.Object
  extended by android.support.v4.app.Fragment
      extended by com.facebook.widget.PickerFragment<GraphPlace>
          extended by com.facebook.widget.PlacePickerFragment
All Implemented Interfaces:
ComponentCallbacks, View.OnCreateContextMenuListener

public class PlacePickerFragment
extends PickerFragment<GraphPlace>


Nested Class Summary
 
Nested classes/interfaces inherited from class com.facebook.widget.PickerFragment
PickerFragment.GraphObjectFilter<T>, PickerFragment.OnDataChangedListener, PickerFragment.OnDoneButtonClickedListener, PickerFragment.OnErrorListener, PickerFragment.OnSelectionChangedListener
 
Nested classes/interfaces inherited from class android.support.v4.app.Fragment
Fragment.InstantiationException, Fragment.SavedState
 
Field Summary
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.
 
Fields inherited from class com.facebook.widget.PickerFragment
DONE_BUTTON_TEXT_BUNDLE_KEY, EXTRA_FIELDS_BUNDLE_KEY, SHOW_PICTURES_BUNDLE_KEY, SHOW_TITLE_BAR_BUNDLE_KEY, TITLE_TEXT_BUNDLE_KEY
 
Constructor Summary
PlacePickerFragment()
          Default constructor.
PlacePickerFragment(Bundle args)
          Constructor.
 
Method Summary
 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 onActivityCreated(Bundle savedInstanceState)
           
 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.
 
Methods inherited from class com.facebook.widget.PickerFragment
getDoneButtonText, getExtraFields, getFilter, getOnDataChangedListener, getOnDoneButtonClickedListener, getOnErrorListener, getOnSelectionChangedListener, getSession, getShowPictures, getShowTitleBar, getTitleText, loadData, onCreate, onCreateView, onSaveInstanceState, setArguments, setDoneButtonText, setExtraFields, setFilter, setOnDataChangedListener, setOnDoneButtonClickedListener, setOnErrorListener, setOnSelectionChangedListener, setSession, setShowPictures, setShowTitleBar, setTitleText
 
Methods inherited from class android.support.v4.app.Fragment
dump, equals, getActivity, getArguments, getChildFragmentManager, getFragmentManager, getId, getLayoutInflater, getLoaderManager, getParentFragment, getResources, getRetainInstance, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, hashCode, instantiate, instantiate, isAdded, isDetached, isHidden, isInLayout, isRemoving, isResumed, isVisible, onActivityResult, onConfigurationChanged, onContextItemSelected, onCreateAnimation, onCreateContextMenu, onCreateOptionsMenu, onDestroy, onDestroyOptionsMenu, onDestroyView, onHiddenChanged, onLowMemory, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPrepareOptionsMenu, onResume, onStart, onStop, onViewCreated, onViewStateRestored, registerForContextMenu, setHasOptionsMenu, setInitialSavedState, setMenuVisibility, setRetainInstance, setTargetFragment, setUserVisibleHint, startActivity, startActivityForResult, toString, unregisterForContextMenu
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

RADIUS_IN_METERS_BUNDLE_KEY

public static final 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. The default is 1000 meters.

See Also:
Constant Field Values

RESULTS_LIMIT_BUNDLE_KEY

public static final 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. The default is 100 results.

See Also:
Constant Field Values

SEARCH_TEXT_BUNDLE_KEY

public static final 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. The default is to have no search text.

See Also:
Constant Field Values

LOCATION_BUNDLE_KEY

public static final 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.

See Also:
Constant Field Values

SHOW_SEARCH_BOX_BUNDLE_KEY

public static final 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.

See Also:
Constant Field Values

DEFAULT_RADIUS_IN_METERS

public static final int DEFAULT_RADIUS_IN_METERS
The default radius around the center point to search.

See Also:
Constant Field Values

DEFAULT_RESULTS_LIMIT

public static final int DEFAULT_RESULTS_LIMIT
The default number of results to retrieve.

See Also:
Constant Field Values
Constructor Detail

PlacePickerFragment

public PlacePickerFragment()
Default constructor. Creates a Fragment with all default properties.


PlacePickerFragment

public PlacePickerFragment(Bundle args)
Constructor.

Parameters:
args - a Bundle that optionally contains one or more values containing additional configuration information for the Fragment.
Method Detail

getLocation

public Location getLocation()
Gets the location to search around. Either the location or the search text (or both) must be specified.

Returns:
the Location to search around

setLocation

public void setLocation(Location location)
Sets the location to search around. Either the location or the search text (or both) must be specified.

Parameters:
location - the Location to search around

getRadiusInMeters

public int getRadiusInMeters()
Gets the radius in meters around the location to search.

Returns:
the radius in meters

setRadiusInMeters

public void setRadiusInMeters(int radiusInMeters)
Sets the radius in meters around the location to search.

Parameters:
radiusInMeters - the radius in meters

getResultsLimit

public int getResultsLimit()
Gets the number of results to retrieve.

Returns:
the number of results to retrieve

setResultsLimit

public void setResultsLimit(int resultsLimit)
Sets the number of results to retrieve.

Parameters:
resultsLimit - the number of results to retrieve

getSearchText

public String getSearchText()
Gets the search text (e.g., category, name) to search for. Either the location or the search text (or both) must be specified.

Returns:
the search text

setSearchText

public void setSearchText(String searchText)
Sets the search text (e.g., category, name) to search for. Either the location or the search text (or both) must be specified. If a search box is displayed, this will update its contents to the specified text.

Parameters:
searchText - the search text

onSearchBoxTextChanged

public void onSearchBoxTextChanged(String searchText,
                                   boolean forceReloadEventIfSameText)
Sets the search text and reloads the data in the control. This is used to provide search-box functionality where the user may be typing or editing text rapidly. It uses a timer to avoid repeated requerying, preferring to wait until the user pauses typing to refresh the data. Note that this method will NOT update the text in the search box, if any, as it is intended to be called as a result of changes to the search box (and is public to enable applications to provide their own search box UI instead of the default one).

Parameters:
searchText - the search text
forceReloadEventIfSameText - if true, will reload even if the search text has not changed; if false, identical search text will not force a reload

getSelection

public GraphPlace getSelection()
Gets the currently-selected place.

Returns:
the currently-selected place, or null if there is none

setSettingsFromBundle

public void setSettingsFromBundle(Bundle inState)
Description copied from class: PickerFragment
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.

Overrides:
setSettingsFromBundle in class PickerFragment<GraphPlace>
Parameters:
inState - a Bundle containing keys corresponding to properties of the PickerFragment

onInflate

public void onInflate(Activity activity,
                      AttributeSet attrs,
                      Bundle savedInstanceState)
Overrides:
onInflate in class PickerFragment<GraphPlace>

onActivityCreated

public void onActivityCreated(Bundle savedInstanceState)
Overrides:
onActivityCreated in class PickerFragment<GraphPlace>

onAttach

public void onAttach(Activity activity)
Overrides:
onAttach in class Fragment

onDetach

public void onDetach()
Overrides:
onDetach in class PickerFragment<GraphPlace>