public abstract class PickerFragment<T extends GraphObject> extends Fragment
Modifier and Type | Class and Description |
---|---|
static interface |
PickerFragment.GraphObjectFilter<T>
Callback interface that will be called to determine if a graph object should be displayed.
|
static interface |
PickerFragment.OnDataChangedListener
Callback interface that will be called when the underlying data being displayed in the
picker has been updated.
|
static interface |
PickerFragment.OnDoneButtonClickedListener
Callback interface that will be called when the user clicks the Done button on the
title bar.
|
static interface |
PickerFragment.OnErrorListener
Callback interface that will be called when a network or other error is encountered
while retrieving graph objects.
|
static interface |
PickerFragment.OnSelectionChangedListener
Callback interface that will be called when the user selects or unselects graph objects
in the picker.
|
Fragment.InstantiationException, Fragment.SavedState
Modifier and Type | Field and Description |
---|---|
static String |
DONE_BUTTON_TEXT_BUNDLE_KEY
The key for a String parameter in the fragment's Intent bundle to indicate the text to
display in the Done btuton.
|
static String |
EXTRA_FIELDS_BUNDLE_KEY
The key for a String parameter in the fragment's Intent bundle to indicate which extra fields
beyond the default fields should be retrieved for any graph objects in the results.
|
static String |
SHOW_PICTURES_BUNDLE_KEY
The key for a boolean parameter in the fragment's Intent bundle to indicate whether the
picker should show pictures (if available) for the graph objects.
|
static String |
SHOW_TITLE_BAR_BUNDLE_KEY
The key for a boolean parameter in the fragment's Intent bundle to indicate whether the
picker should display a title bar with a Done button.
|
static String |
TITLE_TEXT_BUNDLE_KEY
The key for a String parameter in the fragment's Intent bundle to indicate the text to
display in the title bar.
|
Modifier and Type | Method and Description |
---|---|
String |
getDoneButtonText()
Gets the text to show in the Done button, if a title bar is to be shown.
|
Set<String> |
getExtraFields()
Gets the extra fields to request for the retrieved graph objects.
|
PickerFragment.GraphObjectFilter<T> |
getFilter()
Gets the current filter for this fragment, which will be called for each graph object
returned from the service to determine if it should be displayed in the list.
|
PickerFragment.OnDataChangedListener |
getOnDataChangedListener()
Gets the current OnDataChangedListener for this fragment, which will be called whenever
the underlying data being displaying in the picker has changed.
|
PickerFragment.OnDoneButtonClickedListener |
getOnDoneButtonClickedListener()
Gets the current OnDoneButtonClickedListener for this fragment, which will be called
when the user clicks the Done button.
|
PickerFragment.OnErrorListener |
getOnErrorListener()
Gets the current OnErrorListener for this fragment, which will be called in the event
of network or other errors encountered while populating the graph objects in the list.
|
PickerFragment.OnSelectionChangedListener |
getOnSelectionChangedListener()
Gets the current OnSelectionChangedListener for this fragment, which will be called
whenever the user selects or unselects a graph object in the list.
|
Session |
getSession()
Gets the Session to use for any Facebook requests this fragment will make.
|
boolean |
getShowPictures()
Gets whether to display pictures, if available, for displayed graph objects.
|
boolean |
getShowTitleBar()
Gets whether to show a title bar with a Done button.
|
String |
getTitleText()
Gets the text to show in the title bar, if a title bar is to be shown.
|
void |
loadData(boolean forceReload)
Causes the picker to load data from the service and display it to the user.
|
void |
onActivityCreated(Bundle savedInstanceState) |
void |
onCreate(Bundle savedInstanceState) |
View |
onCreateView(LayoutInflater inflater,
ViewGroup container,
Bundle savedInstanceState) |
void |
onDetach() |
void |
onInflate(Activity activity,
AttributeSet attrs,
Bundle savedInstanceState) |
void |
onSaveInstanceState(Bundle outState) |
void |
onStop() |
void |
setArguments(Bundle args) |
void |
setDoneButtonText(String doneButtonText)
Sets the text to show in the Done button, if a title bar is to be shown.
|
void |
setExtraFields(Collection<String> fields)
Sets the extra fields to request for the retrieved graph objects.
|
void |
setFilter(PickerFragment.GraphObjectFilter<T> filter)
Sets the current filter for this fragment, which will be called for each graph object
returned from the service to determine if it should be displayed in the list.
|
void |
setOnDataChangedListener(PickerFragment.OnDataChangedListener onDataChangedListener)
Sets the current OnDataChangedListener for this fragment, which will be called whenever
the underlying data being displaying in the picker has changed.
|
void |
setOnDoneButtonClickedListener(PickerFragment.OnDoneButtonClickedListener onDoneButtonClickedListener)
Sets the current OnDoneButtonClickedListener for this fragment, which will be called
when the user clicks the Done button.
|
void |
setOnErrorListener(PickerFragment.OnErrorListener onErrorListener)
Sets the current OnErrorListener for this fragment, which will be called in the event
of network or other errors encountered while populating the graph objects in the list.
|
void |
setOnSelectionChangedListener(PickerFragment.OnSelectionChangedListener onSelectionChangedListener)
Sets the current OnSelectionChangedListener for this fragment, which will be called
whenever the user selects or unselects a graph object in the list.
|
void |
setSession(Session session)
Sets the Session to use for any Facebook requests this fragment will make.
|
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.
|
void |
setShowPictures(boolean showPictures)
Sets whether to display pictures, if available, for displayed graph objects.
|
void |
setShowTitleBar(boolean showTitleBar)
Sets whether to show a title bar with a Done button.
|
void |
setTitleText(String titleText)
Sets the text to show in the title bar, if a title bar is to be shown.
|
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, onAttach, 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 SHOW_PICTURES_BUNDLE_KEY
public static final String EXTRA_FIELDS_BUNDLE_KEY
public static final String SHOW_TITLE_BAR_BUNDLE_KEY
public static final String TITLE_TEXT_BUNDLE_KEY
public static final String DONE_BUTTON_TEXT_BUNDLE_KEY
public void onInflate(Activity activity, AttributeSet attrs, Bundle savedInstanceState)
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
onCreateView
in class Fragment
public void onActivityCreated(Bundle savedInstanceState)
onActivityCreated
in class Fragment
public void onSaveInstanceState(Bundle outState)
onSaveInstanceState
in class Fragment
public void setArguments(Bundle args)
setArguments
in class Fragment
public PickerFragment.OnDataChangedListener getOnDataChangedListener()
public void setOnDataChangedListener(PickerFragment.OnDataChangedListener onDataChangedListener)
onDataChangedListener
- the OnDataChangedListener, or null if there is nonepublic PickerFragment.OnSelectionChangedListener getOnSelectionChangedListener()
public void setOnSelectionChangedListener(PickerFragment.OnSelectionChangedListener onSelectionChangedListener)
onSelectionChangedListener
- the OnSelectionChangedListener, or null if there is nonepublic PickerFragment.OnDoneButtonClickedListener getOnDoneButtonClickedListener()
public void setOnDoneButtonClickedListener(PickerFragment.OnDoneButtonClickedListener onDoneButtonClickedListener)
onDoneButtonClickedListener
- the OnDoneButtonClickedListener, or null if there is nonepublic PickerFragment.OnErrorListener getOnErrorListener()
public void setOnErrorListener(PickerFragment.OnErrorListener onErrorListener)
onErrorListener
- the OnErrorListener, or null if there is nonepublic PickerFragment.GraphObjectFilter<T> getFilter()
public void setFilter(PickerFragment.GraphObjectFilter<T> filter)
filter
- the GraphObjectFilter, or null if there is nonepublic Session getSession()
public void setSession(Session session)
session
- the Session to use for Facebook requests, or null to use the active sessionpublic boolean getShowPictures()
public void setShowPictures(boolean showPictures)
showPictures
- true if pictures should be displayed, false if notpublic Set<String> getExtraFields()
public void setExtraFields(Collection<String> fields)
fields
- the extra fields to requestpublic void setShowTitleBar(boolean showTitleBar)
showTitleBar
- true if a title bar should be displayed, false if notpublic boolean getShowTitleBar()
public void setTitleText(String titleText)
titleText
- the text to show in the title barpublic String getTitleText()
public void setDoneButtonText(String doneButtonText)
doneButtonText
- the text to show in the Done buttonpublic String getDoneButtonText()
public void loadData(boolean forceReload)
forceReload
- if true, data will be loaded even if there is already data being displayed (or loading);
if false, data will not be re-loaded if it is already displayed (or loading)public void setSettingsFromBundle(Bundle inState)
inState
- a Bundle containing keys corresponding to properties of the PickerFragment