com.facebook.widget
Class FriendPickerFragment

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

public class FriendPickerFragment
extends PickerFragment<GraphUser>

Provides a Fragment that displays a list of a user's friends and allows one or more of the friends to be selected.


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 String MULTI_SELECT_BUNDLE_KEY
          The key for a boolean parameter in the fragment's Intent bundle to indicate whether the picker should allow more than one friend to be selected or not.
static String USER_ID_BUNDLE_KEY
          The key for a String parameter in the fragment's Intent bundle to indicate what user's friends should be shown.
 
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
FriendPickerFragment()
          Default constructor.
FriendPickerFragment(Bundle args)
          Constructor.
 
Method Summary
 boolean getMultiSelect()
          Gets whether the user can select multiple friends, or only one friend.
 List<GraphUser> getSelection()
          Gets the currently-selected list of users.
 String getUserId()
          Gets the ID of the user whose friends should be displayed.
 void onInflate(Activity activity, AttributeSet attrs, Bundle savedInstanceState)
           
 void setMultiSelect(boolean multiSelect)
          Sets whether the user can select multiple friends, or only one friend.
 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 setUserId(String userId)
          Sets the ID of the user whose friends should be displayed.
 
Methods inherited from class com.facebook.widget.PickerFragment
getDoneButtonText, getExtraFields, getFilter, getOnDataChangedListener, getOnDoneButtonClickedListener, getOnErrorListener, getOnSelectionChangedListener, getSession, getShowPictures, getShowTitleBar, getTitleText, loadData, onActivityCreated, onCreate, onCreateView, onDetach, 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, onAttach, 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

USER_ID_BUNDLE_KEY

public static final String USER_ID_BUNDLE_KEY
The key for a String parameter in the fragment's Intent bundle to indicate what user's friends should be shown. The default is to display the currently authenticated user's friends.

See Also:
Constant Field Values

MULTI_SELECT_BUNDLE_KEY

public static final String MULTI_SELECT_BUNDLE_KEY
The key for a boolean parameter in the fragment's Intent bundle to indicate whether the picker should allow more than one friend to be selected or not.

See Also:
Constant Field Values
Constructor Detail

FriendPickerFragment

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


FriendPickerFragment

public FriendPickerFragment(Bundle args)
Constructor.

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

getUserId

public String getUserId()
Gets the ID of the user whose friends should be displayed. If null, the default is to show the currently authenticated user's friends.

Returns:
the user ID, or null

setUserId

public void setUserId(String userId)
Sets the ID of the user whose friends should be displayed. If null, the default is to show the currently authenticated user's friends.

Parameters:
userId - the user ID, or null

getMultiSelect

public boolean getMultiSelect()
Gets whether the user can select multiple friends, or only one friend.

Returns:
true if the user can select multiple friends, false if only one friend

setMultiSelect

public void setMultiSelect(boolean multiSelect)
Sets whether the user can select multiple friends, or only one friend.

Parameters:
multiSelect - true if the user can select multiple friends, false if only one friend

getSelection

public List<GraphUser> getSelection()
Gets the currently-selected list of users.

Returns:
the currently-selected list of users

onInflate

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

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<GraphUser>
Parameters:
inState - a Bundle containing keys corresponding to properties of the PickerFragment