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

Constants
int COLOR_DARK The dark color scheme of the Google sign-in button.
int COLOR_LIGHT The light color scheme of the Google 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 setSize(int buttonSize)
Set the size of the 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_DARK

The dark color scheme of the Google sign-in button.

Constant Value: 0 (0x00000000)

public static final int COLOR_LIGHT

The light color scheme of the Google 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 will remain unchanged.

Parameters
colorScheme The color scheme to use for the button. Valid values are COLOR_DARK or COLOR_LIGHT.

public void setEnabled (boolean enabled)

public void setOnClickListener (View.OnClickListener listener)

public void setSize (int buttonSize)

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

Parameters
buttonSize The size of the button to display. Valid values are SIZE_STANDARD, SIZE_WIDE, or SIZE_ICON_ONLY.

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. Valid values are SIZE_STANDARD, SIZE_WIDE, or SIZE_ICON_ONLY.
colorScheme The color scheme to use for the button. Valid values are COLOR_DARK or COLOR_LIGHT.