Android SDK Version
- AccessToken
- AccessToken.AccessTokenCreationCallback
- AccessToken.AccessTokenRefreshCallback
- AccessTokenManager
- AccessTokenSource
- AccessTokenTracker
- All
- AppEvent
- AppEventsConstants
- AppEventsLogger
- AppEventsLogger.FlushBehavior
- AppEventsLogger.ProductAvailability
- AppEventsLogger.ProductCondition
- AppEventsManager
- AppGroupCreationContent
- AppGroupCreationContent.AppGroupPrivacy
- AppGroupCreationContent.Builder
- AppInviteContent
- AppInviteContent.Builder
- AppInviteContent.Builder.Destination
- AppInviteDialog
- AppInviteDialog.Result
- AppLinkData
- AppLinkData.CompletionHandler
- AppLinks
- CallbackManager
- CallbackManager.Factory
- CameraEffectArguments
- CameraEffectArguments.Builder
- CameraEffectTextures
- CameraEffectTextures.Builder
- CampaignTrackingReceiver
- CodelessLoggingEventListener
- CodelessLoggingEventListener.AutoLoggingOnClickListener
- CodelessLoggingEventListener.AutoLoggingOnItemClickListener
- CodelessManager
- Common
- Core
- CreateAppGroupDialog
- CreateAppGroupDialog.Result
- CurrentAccessTokenExpirationBroadcastReceiver
- CurrentPlaceFeedbackRequestParams
- CurrentPlaceFeedbackRequestParams.Builder
- CurrentPlaceRequestParams
- CurrentPlaceRequestParams.Builder
- CurrentPlaceRequestParams.ConfidenceLevel
- CurrentPlaceRequestParams.ScanMode
- CustomTabActivity
- CustomTabLoginMethodHandler
- CustomTabMainActivity
- DefaultAudience
- DeviceAuthDialog
- DeviceLoginButton
- DeviceLoginManager
- DeviceShareButton
- DeviceShareDialog
- DeviceShareDialog.Result
- FacebookActivity
- FacebookAppLinkResolver
- FacebookAuthorizationException
- FacebookBroadcastReceiver
- FacebookButtonBase
- FacebookCallback
- FacebookContentProvider
- FacebookDialog
- FacebookDialogException
- FacebookException
- FacebookGraphResponseException
- FacebookOperationCanceledException
- FacebookRequestError
- FacebookRequestError.Category
- FacebookSdk
- FacebookSdk.InitializeCallback
- FacebookSdkNotInitializedException
- FacebookServiceException
- FlushResult
- GameRequestContent
- GameRequestContent.ActionType
- GameRequestContent.Builder
- GameRequestContent.Filters
- GameRequestDialog
- GameRequestDialog.Result
- GraphRequest
- GraphRequest.Callback
- GraphRequest.GraphJSONArrayCallback
- GraphRequest.GraphJSONObjectCallback
- GraphRequest.OnProgressCallback
- GraphRequest.ParcelableResourceWithMimeType
- GraphRequestAsyncTask
- GraphRequestBatch
- GraphRequestBatch.Callback
- GraphRequestBatch.OnProgressCallback
- GraphResponse
- GraphResponse.PagingDirection
- HttpMethod
- InternalAppEventsLogger
- JoinAppGroupDialog
- JoinAppGroupDialog.Result
- LikeView
- LikeView.AuxiliaryViewPosition
- LikeView.HorizontalAlignment
- LikeView.ObjectType
- LikeView.OnErrorListener
- LikeView.Style
- LoggingBehavior
- Login
- LoginBehavior
- LoginButton
- LoginButton.ToolTipMode
- LoginFragment
- LoginManager
- LoginResult
- LoginStatusCallback
- MessageDialog
- Messenger
- MessengerThreadParams
- MessengerThreadParams.Origin
- MessengerUtils
- MetadataIndexer
- PlaceFields
- PlaceInfoRequestParams
- PlaceInfoRequestParams.Builder
- PlaceManager
- PlaceManager.LocationError
- PlaceManager.OnRequestReadyCallback
- Places
- PlaceSearchRequestParams
- PlaceSearchRequestParams.Builder
- Profile
- ProfileManager
- ProfilePictureView
- ProfilePictureView.OnErrorListener
- ProfileTracker
- RCTCodelessLoggingEventListener
- RCTCodelessLoggingEventListener.AutoLoggingOnTouchListener
- RestrictiveDataManager
- SendButton
- Share
- ShareApi
- ShareBuilder
- ShareButton
- ShareButtonBase
- ShareCameraEffectContent
- ShareCameraEffectContent.Builder
- ShareContent
- ShareContent.Builder
- ShareDialog
- ShareDialog.Mode
- ShareGraphRequest
- ShareHashtag
- ShareHashtag.Builder
- ShareLinkContent
- ShareLinkContent.Builder
- ShareMedia
- ShareMedia.Builder
- ShareMedia.Type
- ShareMediaContent
- ShareMediaContent.Builder
- ShareMessengerActionButton
- ShareMessengerActionButton.Builder
- ShareMessengerGenericTemplateContent
- ShareMessengerGenericTemplateContent.Builder
- ShareMessengerGenericTemplateContent.ImageAspectRatio
- ShareMessengerGenericTemplateElement
- ShareMessengerGenericTemplateElement.Builder
- ShareMessengerMediaTemplateContent
- ShareMessengerMediaTemplateContent.Builder
- ShareMessengerMediaTemplateContent.MediaType
- ShareMessengerOpenGraphMusicTemplateContent
- ShareMessengerOpenGraphMusicTemplateContent.Builder
- ShareMessengerURLActionButton
- ShareMessengerURLActionButton.Builder
- ShareMessengerURLActionButton.WebviewHeightRatio
- ShareModel
- ShareModelBuilder
- ShareOpenGraphAction
- ShareOpenGraphAction.Builder
- ShareOpenGraphContent
- ShareOpenGraphContent.Builder
- ShareOpenGraphObject
- ShareOpenGraphObject.Builder
- ShareOpenGraphValueContainer
- ShareOpenGraphValueContainer.Builder
- SharePhoto
- SharePhoto.Builder
- SharePhotoContent
- SharePhotoContent.Builder
- Sharer
- Sharer.Result
- ShareStoryContent
- ShareStoryContent.Builder
- ShareToMessengerParams
- ShareToMessengerParamsBuilder
- ShareVideo
- ShareVideo.Builder
- ShareVideoContent
- ShareVideoContent.Builder
- ToolTipPopup
- ToolTipPopup.Style
- UserDataStore
- ViewIndexer
- WebDialog
- java.lang.Object
- Button
- com.facebook.FacebookButtonBase
- com.facebook.login.widget.LoginButton
Direct Known Subclasses:
public class LoginButton extends FacebookButtonBase
A Log In/Log Out button that maintains login state and logs in/out for the app. This control requires the app ID to be specified in the AndroidManifest.xml.
Nested Class Summary
Modifier and Type | Class and Description |
---|---|
protected class | LoginButton.LoginClickListener |
static class | LoginButton.ToolTipMode The display modes for the login button tool tip. |
Constructor Summary
Constructor and Description |
---|
LoginButton(Context context) Create the LoginButton by inflating from XML |
LoginButton(Context context, AttributeSet attrs) Create the LoginButton by inflating from XML |
LoginButton(Context context, AttributeSet attrs, int defStyle) Create the LoginButton by inflating from XML and applying a style. |
Method Summary
Modifier and Type | Method and Description |
---|---|
void | clearPermissions() Clears the permissions currently associated with this LoginButton. |
protected void | configureButton(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) |
void | dismissToolTip() Dismisses the Tooltip if it is currently visible |
java.lang.String | getAuthType() Gets the authType being used. |
DefaultAudience | getDefaultAudience() Gets the default audience to use when the user logs in. |
protected int | getDefaultRequestCode() |
protected int | getDefaultStyleResource() |
LoginBehavior | getLoginBehavior() Gets the login behavior during authorization. |
protected LoginButton.LoginClickListener | getNewLoginClickListener() |
long | getToolTipDisplayTime() Gets the current amount of time (in ms) that the tool tip will be displayed to the user. |
LoginButton.ToolTipMode | getToolTipMode() Return the current LoginButton.ToolTipMode for this LoginButton |
protected void | onAttachedToWindow() |
protected void | onDetachedFromWindow() |
protected void | onDraw(Canvas canvas) |
protected void | onLayout(boolean changed, int left, int top, int right, int bottom) |
protected void | onMeasure(int widthMeasureSpec, int heightMeasureSpec) |
protected void | onVisibilityChanged(View changedView, int visibility) |
void | registerCallback(CallbackManager callbackManager, FacebookCallback<LoginResult> callback) Registers a login callback to the given callback manager. |
void | setAuthType(java.lang.String authType) Sets the authType to be used. |
void | setDefaultAudience(DefaultAudience defaultAudience) Sets the default audience to use when the user logs in. |
void | setLoginBehavior(LoginBehavior loginBehavior) Sets the login behavior during authorization. |
void | setLoginText(java.lang.String loginText) |
void | setLogoutText(java.lang.String logoutText) |
void | setPermissions(java.util.List<java.lang.String> permissions) Set the permissions to use when the user logs in. |
void | setPermissions(java.lang.String... permissions) Set the permissions to use when the user logs in. |
void | setPublishPermissions(java.util.List<java.lang.String> permissions) Deprecated. use setPermissions |
void | setPublishPermissions(java.lang.String... permissions) Deprecated. use setPermissions |
void | setReadPermissions(java.util.List<java.lang.String> permissions) Deprecated. use setPermissions |
void | setReadPermissions(java.lang.String... permissions) Deprecated. use setPermissions |
void | setToolTipDisplayTime(long displayTime) Sets the amount of time (in milliseconds) that the tool tip will be shown to the user. |
void | setToolTipMode(LoginButton.ToolTipMode toolTipMode) Sets the mode of the Tool Tip popup. |
void | setToolTipStyle(ToolTipPopup.Style toolTipStyle) Sets the style (background) of the Tool Tip popup. |
void | unregisterCallback(CallbackManager callbackManager) Unregisters a login callback to the given callback manager. |
Methods inherited from class com.facebook.
callExternalOnClickListener, getActivity, getCompoundPaddingLeft, getCompoundPaddingRight, getFragment, getNativeFragment, getRequestCode, measureTextWidth, setFragment, setFragment, setInternalOnClickListener, setOnClickListener
Constructor Detail
LoginButton
public LoginButton(Context context)
Create the LoginButton by inflating from XML
See Also:
View#View(Context, AttributeSet)
LoginButton
public LoginButton(Context context, AttributeSet attrs)
Create the LoginButton by inflating from XML
See Also:
View#View(Context, AttributeSet)
LoginButton
public LoginButton(Context context, AttributeSet attrs, int defStyle)
Create the LoginButton by inflating from XML and applying a style.
See Also:
View#View(Context, AttributeSet, int)
Method Detail
setLoginText
public void setLoginText(java.lang.String loginText)
setLogoutText
public void setLogoutText(java.lang.String logoutText)
setDefaultAudience
public void setDefaultAudience(DefaultAudience defaultAudience)
Sets the default audience to use when the user logs in. This value is only useful when specifying publish permissions for the native login dialog.
Parameters:
defaultAudience
- the default audience value to usegetDefaultAudience
public DefaultAudience getDefaultAudience()
Gets the default audience to use when the user logs in. This value is only useful when specifying publish permissions for the native login dialog.
Returns:
the default audience value to use
setReadPermissions
public void setReadPermissions(java.util.List<java.lang.String> permissions)
Deprecated. use setPermissions
Set the permissions to use when the user logs in. The permissions here can only be read permissions. If any publish permissions are included, the login attempt by the user will fail. The LoginButton can only be associated with either read permissions or publish permissions, but not both. Calling both setReadPermissions and setPublishPermissions on the same instance of LoginButton will result in an exception being thrown unless clearPermissions is called in between. This method is only meaningful if called before the user logs in. If this is called after login, and the list of permissions passed in is not a subset of the permissions granted during the authorization, it will log an error. It's important to always pass in a consistent set of permissions to this method, or manage the setting of permissions outside of the LoginButton class altogether (by using the LoginManager explicitly).
Parameters:
permissions
- the read permissions to useThrows:
java.lang.UnsupportedOperationException
- if setPublishPermissions has been calledsetReadPermissions
public void setReadPermissions(java.lang.String... permissions)
Deprecated. use setPermissions
Set the permissions to use when the user logs in. The permissions here can only be read permissions. If any publish permissions are included, the login attempt by the user will fail. The LoginButton can only be associated with either read permissions or publish permissions, but not both. Calling both setReadPermissions and setPublishPermissions on the same instance of LoginButton will result in an exception being thrown unless clearPermissions is called in between. This method is only meaningful if called before the user logs in. If this is called after login, and the list of permissions passed in is not a subset of the permissions granted during the authorization, it will log an error. It's important to always pass in a consistent set of permissions to this method, or manage the setting of permissions outside of the LoginButton class altogether (by using the LoginManager explicitly).
Parameters:
permissions
- the read permissions to useThrows:
java.lang.UnsupportedOperationException
- if setPublishPermissions has been calledsetPermissions
public void setPermissions(java.util.List<java.lang.String> permissions)
Set the permissions to use when the user logs in. The permissions here can be either read or write permissions.
* This method is only meaningful if called before the user logs in. If this is called * after login, and the list of permissions passed in is not a subset of the permissions granted during the authorization, it will log an error. *
* It's important to always pass in a consistent set of permissions to this method, or manage the setting of permissions outside of the LoginButton class altogether (by using the LoginManager explicitly).
Parameters:
permissions
- the read and write permissions to usesetPermissions
public void setPermissions(java.lang.String... permissions)
Set the permissions to use when the user logs in. The permissions here can be either read or write permissions.
* This method is only meaningful if called before the user logs in. If this is called * after login, and the list of permissions passed in is not a subset of the permissions granted during the authorization, it will log an error. *
* It's important to always pass in a consistent set of permissions to this method, or manage the setting of permissions outside of the LoginButton class altogether (by using the LoginManager explicitly).
Parameters:
permissions
- the read and write permissions to usesetPublishPermissions
public void setPublishPermissions(java.util.List<java.lang.String> permissions)
Deprecated. use setPermissions
Set the permissions to use when the user logs in. The permissions here should only be publish permissions. If any read permissions are included, the login attempt by the user may fail. The LoginButton can only be associated with either read permissions or publish permissions, but not both. Calling both setReadPermissions and setPublishPermissions on the same instance of LoginButton will result in an exception being thrown unless clearPermissions is called in between. This method is only meaningful if called before the user logs in. If this is called after login, and the list of permissions passed in is not a subset of the permissions granted during the authorization, it will log an error. It's important to always pass in a consistent set of permissions to this method, or manage the setting of permissions outside of the LoginButton class altogether (by using the LoginManager explicitly).
Parameters:
permissions
- the publish permissions to useThrows:
java.lang.UnsupportedOperationException
- if setReadPermissions has been calledjava.lang.IllegalArgumentException
- if permissions is null or emptysetPublishPermissions
public void setPublishPermissions(java.lang.String... permissions)
Deprecated. use setPermissions
Set the permissions to use when the user logs in. The permissions here should only be publish permissions. If any read permissions are included, the login attempt by the user may fail. The LoginButton can only be associated with either read permissions or publish permissions, but not both. Calling both setReadPermissions and setPublishPermissions on the same instance of LoginButton will result in an exception being thrown unless clearPermissions is called in between. This method is only meaningful if called before the user logs in. If this is called after login, and the list of permissions passed in is not a subset of the permissions granted during the authorization, it will log an error. It's important to always pass in a consistent set of permissions to this method, or manage the setting of permissions outside of the LoginButton class altogether (by using the LoginManager explicitly).
Parameters:
permissions
- the publish permissions to useThrows:
java.lang.UnsupportedOperationException
- if setReadPermissions has been calledjava.lang.IllegalArgumentException
- if permissions is null or emptyclearPermissions
public void clearPermissions()
Clears the permissions currently associated with this LoginButton.
setLoginBehavior
public void setLoginBehavior(LoginBehavior loginBehavior)
Sets the login behavior during authorization. If null is specified, the default (
LoginBehavior.NATIVE_WITH_FALLBACK
will be used.Parameters:
loginBehavior
- The LoginBehavior
that specifies what behaviors should be attempted during authorization.getLoginBehavior
public LoginBehavior getLoginBehavior()
Gets the login behavior during authorization. If null is returned, the default (
LoginBehavior.NATIVE_WITH_FALLBACK
will be used.Returns:
loginBehavior The
LoginBehavior
that specifies what behaviors should be attempted during authorization.getAuthType
public java.lang.String getAuthType()
Gets the authType being used.
Returns:
the authType
setAuthType
public void setAuthType(java.lang.String authType)
Sets the authType to be used.
Parameters:
authType
- the authTypesetToolTipStyle
public void setToolTipStyle(ToolTipPopup.Style toolTipStyle)
Sets the style (background) of the Tool Tip popup. Currently a blue style and a black style are supported. Blue is default
Parameters:
toolTipStyle
- The style of the tool tip popup.setToolTipMode
public void setToolTipMode(LoginButton.ToolTipMode toolTipMode)
Sets the mode of the Tool Tip popup. Currently supported modes are default (normal behavior), always_on (popup remains up until forcibly dismissed), and always_off (popup doesn't show)
Parameters:
toolTipMode
- The new mode for the tool tipgetToolTipMode
public LoginButton.ToolTipMode getToolTipMode()
Return the current
LoginButton.ToolTipMode
for this LoginButtonReturns:
setToolTipDisplayTime
public void setToolTipDisplayTime(long displayTime)
Sets the amount of time (in milliseconds) that the tool tip will be shown to the user. The default is 6000L. Any value that is less than or equal to zero will cause the tool tip to be displayed indefinitely.
Parameters:
displayTime
- The amount of time (in milliseconds) that the tool tip will be displayed to the usergetToolTipDisplayTime
public long getToolTipDisplayTime()
Gets the current amount of time (in ms) that the tool tip will be displayed to the user.
Returns:
The current amount of time (in ms) that the tool tip will be displayed.
dismissToolTip
public void dismissToolTip()
Dismisses the Tooltip if it is currently visible
registerCallback
public void registerCallback(CallbackManager callbackManager, FacebookCallback<LoginResult> callback)
Registers a login callback to the given callback manager.
Parameters:
callbackManager
- The callback manager that will encapsulate the callback.callback
- The login callback that will be called on login completion.unregisterCallback
public void unregisterCallback(CallbackManager callbackManager)
Unregisters a login callback to the given callback manager.
Parameters:
callbackManager
- The callback manager that will encapsulate the callback.onAttachedToWindow
protected void onAttachedToWindow()
Overrides:
onAttachedToWindow
in class FacebookButtonBase
onLayout
protected void onLayout(boolean changed, int left, int top, int right, int bottom)
onDetachedFromWindow
protected void onDetachedFromWindow()
onVisibilityChanged
protected void onVisibilityChanged(View changedView, int visibility)
configureButton
protected void configureButton(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Overrides:
configureButton
in class FacebookButtonBase
getNewLoginClickListener
protected LoginButton.LoginClickListener getNewLoginClickListener()
getDefaultStyleResource
protected int getDefaultStyleResource()
Overrides:
onMeasure
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
getDefaultRequestCode
protected int getDefaultRequestCode()
Specified by:
getDefaultRequestCode
in class FacebookButtonBase