Android APIs
public final class

SignInButton

extends FrameLayout
implements View.OnClickListener
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ com.google.android.gms.common.SignInButton

Class Overview

The Google sign-in button to authenticate the user. Note that this class only handles the visual aspects of the button. In order to trigger an action, register a listener using setOnClickListener(OnClickListener).

Note that you must explicitly call setOnClickListener(OnClickListener). Do not register a listener via XML, or you won't receive your callbacks.

Summary

Nested Classes
@interface SignInButton.ButtonSize Size constants - enumeration of supported sizes. 
@interface SignInButton.ColorScheme Color constants - enumeration of supported color schemes. 
Constants
int COLOR_AUTO Google Play services will decide the color scheme for sign-in button.
int COLOR_DARK The dark color scheme of the sign-in button.
int COLOR_LIGHT The light color scheme of the sign-in button.
int SIZE_ICON_ONLY The icon-only size of the Google sign-in button.
int SIZE_STANDARD The standard size of the Google sign-in button.
int SIZE_WIDE The wide size of the Google sign-in button.
[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
SignInButton(Context context)
SignInButton(Context context, AttributeSet attrs)
SignInButton(Context context, AttributeSet attrs, int defStyle)
Public Methods
void onClick(View view)
void setColorScheme(int colorScheme)
Set the color scheme of the button to use.
void setEnabled(boolean enabled)
void setOnClickListener(View.OnClickListener listener)
void setScopes(Scope[] scopes)
Set the scopes your app will use to sign in and the sign in button will choose the right branding for you.
void setSize(int buttonSize)
Set the size of the button to use.
void setStyle(int buttonSize, int colorScheme, Scope[] scopes)
Set the desired style of button to use.
void setStyle(int buttonSize, int colorScheme)
Set the desired style of button to use.
[Expand]
Inherited Methods
From class android.widget.FrameLayout
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.view.ViewParent
From interface android.view.ViewManager
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.accessibility.AccessibilityEventSource
From interface android.view.View.OnClickListener

Constants

public static final int COLOR_AUTO

Google Play services will decide the color scheme for sign-in button.

Constant Value: 2 (0x00000002)

public static final int COLOR_DARK

The dark color scheme of the sign-in button.

Constant Value: 0 (0x00000000)

public static final int COLOR_LIGHT

The light color scheme of the sign-in button.

Constant Value: 1 (0x00000001)

public static final int SIZE_ICON_ONLY

The icon-only size of the Google sign-in button.

Constant Value: 2 (0x00000002)

public static final int SIZE_STANDARD

The standard size of the Google sign-in button.

Constant Value: 0 (0x00000000)

public static final int SIZE_WIDE

The wide size of the Google sign-in button.

Constant Value: 1 (0x00000001)

Public Constructors

public SignInButton (Context context)

public SignInButton (Context context, AttributeSet attrs)

public SignInButton (Context context, AttributeSet attrs, int defStyle)

Public Methods

public void onClick (View view)

public void setColorScheme (int colorScheme)

Set the color scheme of the button to use. The size and branding scheme will remain unchanged.

Parameters
colorScheme The color scheme to use for the button. See SignInButton.ColorScheme

public void setEnabled (boolean enabled)

public void setOnClickListener (View.OnClickListener listener)

public void setScopes (Scope[] scopes)

Set the scopes your app will use to sign in and the sign in button will choose the right branding for you. The color scheme and the size will remain unchanged.

Parameters
scopes A scope array.

public void setSize (int buttonSize)

Set the size of the button to use. The color and branding scheme will remain unchanged.

Parameters
buttonSize The size of the button to display. See SignInButton.ButtonSize

public void setStyle (int buttonSize, int colorScheme, Scope[] scopes)

Set the desired style of button to use. This will update the button to use the specified size, color scheme and corresponding branding.

Parameters
buttonSize The size of the button to display. See SignInButton.ButtonSize
colorScheme The color scheme to use for the button. See SignInButton.ColorScheme
scopes The scopes your app will use to sign in.

public void setStyle (int buttonSize, int colorScheme)

Set the desired style of button to use. This will update the button to use the specified size and color scheme.

Parameters
buttonSize The size of the button to display. See SignInButton.ButtonSize
colorScheme The color scheme to use for the button. See SignInButton.ColorScheme