SignInButton
class SignInButton : FrameLayout, View.OnClickListener
| kotlin.Any | ||||
| ↳ | 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.
Note that you must explicitly call setOnClickListener. Do not register a listener via XML, or you won't receive your callbacks.
Summary
Nested types |
|---|
@Retention(value = RetentionPolicy.SOURCE)Size constants - enumeration of supported sizes. |
@Retention(value = RetentionPolicy.SOURCE)Color constants - enumeration of supported color schemes. |
Constants |
|
|---|---|
const Int |
COLOR_AUTO = 2Google Play services will decide the color scheme for sign-in button. |
const Int |
COLOR_DARK = 0The dark color scheme of the sign-in button. |
const Int |
COLOR_LIGHT = 1The light color scheme of the sign-in button. |
const Int |
SIZE_ICON_ONLY = 2The icon-only size of the Google sign-in button. |
const Int |
SIZE_STANDARD = 0The standard size of the Google sign-in button. |
const Int |
SIZE_WIDE = 1The wide size of the Google sign-in button. |
Public constructors |
|---|
SignInButton(context: Context!) |
SignInButton(context: Context!, attrs: AttributeSet?) |
SignInButton(context: Context!, attrs: AttributeSet?, defStyle: Int) |
Public functions |
|
|---|---|
Unit |
|
Unit |
setColorScheme(@SignInButton.ColorScheme colorScheme: Int)Set the color scheme of the button to use. |
Unit |
setEnabled(enabled: Boolean) |
Unit |
setOnClickListener(listener: View.OnClickListener?) |
Unit |
This function is deprecated. Setting scopes will no longer impact the branding. |
Unit |
setSize(@SignInButton.ButtonSize buttonSize: Int)Set the size of the button to use. |
Unit |
setStyle(Set the desired style of button to use. |
Unit |
@InlineMe(replacement = "this.setStyle(buttonSize, colorScheme)")This function is deprecated. Setting scopes will no longer impact the branding. |
Inherited Constants |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Constants
COLOR_AUTO
const val COLOR_AUTO = 2: Int
Google Play services will decide the color scheme for sign-in button.
Public constructors
Public functions
setColorScheme
fun setColorScheme(@SignInButton.ColorScheme colorScheme: Int): Unit
Set the color scheme of the button to use. The size and branding scheme will remain unchanged.
| Parameters | |
|---|---|
@SignInButton.ColorScheme colorScheme: Int |
The color scheme to use for the button. See |
setScopes
funsetScopes(scopes: Array<Scope!>!): Unit
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.
setSize
fun setSize(@SignInButton.ButtonSize buttonSize: Int): Unit
Set the size of the button to use. The color and branding scheme will remain unchanged.
| Parameters | |
|---|---|
@SignInButton.ButtonSize buttonSize: Int |
The size of the button to display. See |
setStyle
fun setStyle(
@SignInButton.ButtonSize buttonSize: Int,
@SignInButton.ColorScheme colorScheme: Int
): Unit
Set the desired style of button to use. This will update the button to use the specified size and color scheme.
| Parameters | |
|---|---|
@SignInButton.ButtonSize buttonSize: Int |
The size of the button to display. See |
@SignInButton.ColorScheme colorScheme: Int |
The color scheme to use for the button. See |
setStyle
@InlineMe(replacement = "this.setStyle(buttonSize, colorScheme)")
funsetStyle(
@SignInButton.ButtonSize buttonSize: Int,
@SignInButton.ColorScheme colorScheme: Int,
scopes: Array<Scope!>!
): Unit
Set the desired style of button to use. This will update the button to use the specified size, color scheme and corresponding branding.
| Parameters | |
|---|---|
@SignInButton.ButtonSize buttonSize: Int |
The size of the button to display. See |
@SignInButton.ColorScheme colorScheme: Int |
The color scheme to use for the button. See |
scopes: Array<Scope!>! |
The scopes your app will use to sign in. |