Hide

SignInButton

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

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.

Constant Summary

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.

Inherited Constant Summary

Inherited Field Summary

Public Constructor Summary

SignInButton(Context context, AttributeSet attrs, int defStyle)

Public Method Summary

void
onClick(View view)
void
setColorScheme(int colorScheme)
void
setEnabled(boolean enabled)
void
void
setSize(int buttonSize)
void
setStyle(int buttonSize, int colorScheme)

Constants

public static final int COLOR_DARK

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

Constant Value: 0

public static final int COLOR_LIGHT

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

Constant Value: 1

public static final int SIZE_ICON_ONLY

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

Constant Value: 2

public static final int SIZE_STANDARD

The standard size of the Google sign-in button.

Constant Value: 0

public static final int SIZE_WIDE

The wide size of the Google sign-in button.

Constant Value: 1

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.