|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectandroid.support.v4.app.Fragment
com.facebook.widget.PickerFragment<T>
public abstract class PickerFragment<T extends GraphObject>
Provides functionality common to SDK UI elements that allow the user to pick one or more
graph objects (e.g., places, friends) from a list of possibilities. The UI is exposed as a
Fragment to allow to it to be included in an Activity along with other Fragments. The Fragments
can be configured by passing parameters as part of their Intent bundle, or (for certain
properties) by specifying attributes in their XML layout files.
PickerFragments support callbacks that will be called in the event of an error, when the
underlying data has been changed, or when the set of selected graph objects changes.
Nested Class Summary | |
---|---|
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. |
Nested classes/interfaces inherited from class android.support.v4.app.Fragment |
---|
Fragment.InstantiationException, Fragment.SavedState |
Field Summary | |
---|---|
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. |
Method Summary | |
---|---|
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 |
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. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
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
Method Detail |
---|
public void onCreate(Bundle savedInstanceState)
onCreate
in class Fragment
public void onInflate(Activity activity, AttributeSet attrs, Bundle savedInstanceState)
onInflate
in class Fragment
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
onCreateView
in class Fragment
public void onActivityCreated(Bundle savedInstanceState)
onActivityCreated
in class Fragment
public void onDetach()
onDetach
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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |