SignInButton

class SignInButton : FrameLayout, View.OnClickListener


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)
@IntDef(value = )
annotation SignInButton.ButtonSize

Size constants - enumeration of supported sizes.

@Retention(value = RetentionPolicy.SOURCE)
@IntDef(value = )
annotation SignInButton.ColorScheme

Color constants - enumeration of supported color schemes.

Constants

const Int

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

const Int

The dark color scheme of the sign-in button.

const Int

The light color scheme of the sign-in button.

const Int

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

const Int

The standard size of the Google sign-in button.

const Int

The 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
onClick(view: View!)
Unit

Set the color scheme of the button to use.

Unit
setEnabled(enabled: Boolean)
Unit
Unit
setScopes(scopes: Array<Scope!>!)

This function is deprecated.

Setting scopes will no longer impact the branding.

Unit

Set the size of the button to use.

Unit
setStyle(
    @SignInButton.ButtonSize buttonSize: Int,
    @SignInButton.ColorScheme colorScheme: Int
)

Set the desired style of button to use.

Unit
@InlineMe(replacement = "this.setStyle(buttonSize, colorScheme)")
setStyle(
    @SignInButton.ButtonSize buttonSize: Int,
    @SignInButton.ColorScheme colorScheme: Int,
    scopes: Array<Scope!>!
)

This function is deprecated.

Setting scopes will no longer impact the branding.

Inherited Constants

From android.view.View
const Int
const Int
const Int
const Int
const Int
const Int
const Property<View!, Float!>!
const Int
const String!
AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE = "creditCardExpirationDate"
const String!
AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY = "creditCardExpirationDay"
const String!
AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH = "creditCardExpirationMonth"
const String!
AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR = "creditCardExpirationYear"
const String!
const String!
AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE = "creditCardSecurityCode"
const String!
const String!
const String!
const String!
const String!
const String!
const String!
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const Int
const Int
const Int
const Int
const Int
const Int
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const Int
const Int
const Int
const Int
const Int
const Int
const Int
GONE = 8
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
KEEP_SCREEN_ON = 67108864
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
NO_ID = -1
const Int
const Int
const Int
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const IntArray<Int>!
const Float
const Float
const Float
const Float
const Float
const Property<View!, Float!>!
const Property<View!, Float!>!
const Property<View!, Float!>!
const Property<View!, Float!>!
const Property<View!, Float!>!
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const IntArray<Int>!
const IntArray<Int>!
const Int
const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Int
const Property<View!, Float!>!
const Property<View!, Float!>!
const Property<View!, Float!>!
const String!
VIEW_LOG_TAG = "View"
const Int
const IntArray<Int>!
const Property<View!, Float!>!
const Property<View!, Float!>!
const Property<View!, Float!>!
From android.view.ViewGroup
const Int
const Int
const Int
const Int
const Int
const Int
const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

const Int

This property is deprecated.

Inherited functions

From android.widget.FrameLayout
From android.view.View
Unit
Unit
Unit
ViewPropertyAnimator!
Unit

This function is deprecated.

Unit
Boolean
Unit
Unit

This function is deprecated.

Unit
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Unit
Unit
Unit
Boolean
Unit
Unit
Unit
java-static Int
Int
Int
Int
Unit
WindowInsets!
Int
Int
Int
AccessibilityNodeInfo!
Unit
Unit

This function is deprecated.

Boolean
Boolean
Boolean
Boolean
Boolean
dispatchNestedPreScroll(p: Int, p1: Int, p2: IntArray!, p3: IntArray!)
Boolean
dispatchNestedScroll(p: Int, p1: Int, p2: Int, p3: Int, p4: IntArray!)
Boolean
Unit
draw(p: Canvas!)
Unit
OnBackInvokedDispatcher!
T!
<T : View?> findViewById(p: Int)
T!
<T : View?> findViewWithTag(p: Any!)
Boolean

This function is deprecated.

Unit
Unit
Unit
generateDisplayHash(
    p: String!,
    p1: Rect!,
    p2: Executor!,
    p3: DisplayHashResultCallback!
)
java-static Int
View.AccessibilityDelegate!
Int
AccessibilityNodeProvider!
CharSequence!
Int
Int
String!
String!
Float
Animation!
Matrix!
IBinder!
IntArray<Int>!
(Mutable)Map<Int!, Int!>!
Array<String!>!
AutofillId!
Int
AutofillValue!
Drawable!
BlendMode!
ColorStateList!
PorterDuff.Mode!
Int
Int
Float
Int
Float
Rect!
Boolean
Boolean
ContentCaptureSession!
CharSequence!
Int
Context!
ContextMenu.ContextMenuInfo!
Boolean
java-static Int
getDefaultSize(p: Int, p1: Int)
Display!
IntArray<Int>!
Bitmap!

This function is deprecated.

Int

This function is deprecated.

Int

This function is deprecated.

Unit
Long
Float
Int
Boolean
Boolean
Int
ArrayList<View!>!
Unit
Drawable!
Int
BlendMode!
ColorStateList!
PorterDuff.Mode!
Float
Boolean
Handler!
Float
Float
Float
Float
Int
Runnable!
Boolean
Int
Unit
Int
Int
Drawable!
Drawable!
Int
Int
Int
Int
Boolean
KeyEvent.DispatcherState!
Int
Int
Int
ViewGroup.LayoutParams!
Int
Float
Int
Boolean
Unit
Unit
Unit
Matrix!
Int
Int
Int
Int
Int
Int
Int
Int
Int
Int
Int
Int
Int
View.OnFocusChangeListener!
Int
ViewOutlineProvider!
Int
Int
ViewOverlay!
Int
Int
Int
Int
Int
Int
ViewParent!
ViewParent!
OutcomeReceiver<GetCredentialResponse!, GetCredentialException!>!
GetCredentialRequest!
Float
Float
PointerIcon!
(Mutable)List<Rect!>!
Array<String!>!
Float
Resources!
Boolean
Int
Float
Int
AttachedSurfaceControl!
View!
WindowInsets!
Float
Float
Float
Float
Float
Int
Int
Int
Int
Int
Int
Int
Int
Int
Int
CharSequence!
StateListAnimator!
Int
Int
CharSequence!
(Mutable)List<Rect!>!
Int

This function is deprecated.

Any!
Int
Int
CharSequence!
Int
Float
Int
TouchDelegate!
ArrayList<View!>!
Float
String!
Float
Float
Float
Long
Int
Int
Drawable!
Drawable!
Int
ViewTranslationResponse!
ViewTreeObserver!
Int
Int
Int
WindowId!
WindowInsetsController!
Int

This function is deprecated.

IBinder!
Int
Unit
Float
Float
Float
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
java-static View!
inflate(p: Context!, p1: Int, p2: ViewGroup!)
Unit
Unit
Unit
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean

This function is deprecated.

Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
View!
Unit
measure(p: Int, p1: Int)
java-static IntArray<Int>!
Unit
Unit
Unit
Unit
WindowInsets!
Unit
Boolean
Boolean
Unit
Unit
InputConnection!
Unit
Unit
Unit
Boolean
Unit
Unit
Unit
Boolean
Unit
Unit
Unit
onFocusChanged(p: Boolean, p1: Int, p2: Rect!)
Boolean
Unit
Boolean
Unit
Unit
Boolean
onKeyDown(p: Int, p1: KeyEvent!)
Boolean
Boolean
onKeyMultiple(p: Int, p1: Int, p2: KeyEvent!)
Boolean
onKeyPreIme(p: Int, p1: KeyEvent!)
Boolean
Boolean
onKeyUp(p: Int, p1: KeyEvent!)
Unit
onOverScrolled(p: Int, p1: Int, p2: Boolean, p3: Boolean)
Unit
Unit
Unit
Unit
Unit
Unit
Unit
ContentInfo!
Unit
Unit
Parcelable!
Unit
Unit
onScrollCaptureSearch(
    p: Rect!,
    p1: Point!,
    p2: Consumer<ScrollCaptureTarget!>!
)
Unit
onScrollChanged(p: Int, p1: Int, p2: Int, p3: Int)
Boolean
Unit
onSizeChanged(p: Int, p1: Int, p2: Int, p3: Int)
Unit
Boolean
Boolean
Unit
Unit
Unit
Unit
Unit
Unit

This function is deprecated.

Unit
Boolean
overScrollBy(
    p: Int,
    p1: Int,
    p2: Int,
    p3: Int,
    p4: Int,
    p5: Int,
    p6: Int,
    p7: Int,
    p8: Boolean
)
Boolean
Boolean
Boolean
Boolean
Boolean
ContentInfo!
Unit
Boolean
Boolean
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Boolean
Unit
Unit
Unit
Unit
Unit
Unit

This function is deprecated.

Boolean
Unit
Unit
Boolean
Unit
T!
<T : View?> requireViewById(p: Int)
Unit
java-static Int
resolveSize(p: Int, p1: Int)
java-static Int
resolveSizeAndState(p: Int, p1: Int, p2: Int)
Unit
Unit
saveAttributeDataForStyleable(
    p: Context!,
    p1: IntArray!,
    p2: AttributeSet!,
    p3: TypedArray!,
    p4: Int,
    p5: Int
)
Unit
Unit
scheduleDrawable(p: Drawable!, p1: Runnable!, p2: Long)
Unit
scrollBy(p: Int, p1: Int)
Unit
scrollTo(p: Int, p1: Int)
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit

This function is deprecated.

Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
setId(p: Int)
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
setLayerType(p: Int, p1: Paint!)
Unit
Unit
Unit
Unit
setLeftTopRightBottom(p: Int, p1: Int, p2: Int, p3: Int)
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit

This function is deprecated.

Unit
Unit
Unit
Unit
Unit
Unit
setPadding(p: Int, p1: Int, p2: Int, p3: Int)
Unit
setPaddingRelative(p: Int, p1: Int, p2: Int, p3: Int)
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit

This function is deprecated.

Unit
setTag(p: Int, p1: Any!)
Unit
Unit
Unit
Unit
setTop(p: Int)
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit

This function is deprecated.

Unit
Unit
setX(p: Float)
Unit
setY(p: Float)
Unit
setZ(p: Float)
Boolean
ActionMode!
Unit
Boolean
startDrag(p: ClipData!, p1: View.DragShadowBuilder!, p2: Any!, p3: Int)

This function is deprecated.

Boolean
Boolean
Unit
String!
Unit
Unit
Unit
Unit
Boolean
Boolean

This function is deprecated.

Boolean
From android.view.ViewGroup
Unit
Unit
Unit
addFocusables(p: ArrayList<View!>!, p1: Int, p2: Int)
Unit
Boolean
Unit
Unit
Boolean
Unit
attachLayoutAnimationParameters(
    p: View!,
    p1: ViewGroup.LayoutParams!,
    p2: Int,
    p3: Int
)
Unit
Unit
Boolean
Unit
Unit
Unit
Unit
Unit
Unit
Unit
debug(p: Int)
Unit
Unit
Unit
WindowInsets!
Boolean
Unit
Unit
Unit
Boolean
Unit
Unit
Unit
Unit
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Unit
Unit
Unit
Unit
Unit
Unit
dispatchScrollCaptureSearch(
    p: Rect!,
    p1: Point!,
    p2: Consumer<ScrollCaptureTarget!>!
)
Unit
Unit
Unit
Unit
Unit

This function is deprecated.

Unit
Boolean
Boolean
Boolean
Unit
Unit
Unit
Unit
WindowInsets!
WindowInsetsAnimation.Bounds!
Unit

This function is deprecated.

Unit
Boolean
drawChild(p: Canvas!, p1: View!, p2: Long)
Unit
Unit
View!
OnBackInvokedDispatcher!
Unit
View!
focusSearch(p: View!, p1: Int)
Unit
Boolean
View!
Int
Int
java-static Int
getChildMeasureSpec(p: Int, p1: Int, p2: Int)
Boolean
Boolean
getChildVisibleRect(p: View!, p1: Rect!, p2: Point!)
Boolean
Boolean
Int
View!
LayoutAnimationController!
Animation.AnimationListener!
Int
LayoutTransition!
Int
ViewGroupOverlay!
Int

This function is deprecated.

Boolean
Boolean
Boolean
Int
Unit
invalidateChild(p: View!, p1: Rect!)

This function is deprecated.

ViewParent!

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Boolean
Boolean

This function is deprecated.

Boolean
Boolean
Boolean
Unit
Unit
layout(p: Int, p1: Int, p2: Int, p3: Int)
Unit
measureChild(p: View!, p1: Int, p2: Int)
Unit
measureChildWithMargins(p: View!, p1: Int, p2: Int, p3: Int, p4: Int)
Unit
measureChildren(p: Int, p1: Int)
Unit
Unit
Unit
Unit
IntArray<Int>!
Unit
Unit
Boolean
Boolean
Boolean
onNestedFling(p: View!, p1: Float, p2: Float, p3: Boolean)
Boolean
onNestedPreFling(p: View!, p1: Float, p2: Float)
Boolean
Unit
onNestedPreScroll(p: View!, p1: Int, p2: Int, p3: IntArray!)
Unit
onNestedScroll(p: View!, p1: Int, p2: Int, p3: Int, p4: Int)
Unit
onNestedScrollAccepted(p: View!, p1: View!, p2: Int)
Boolean
Boolean
PointerIcon!
Boolean
onStartNestedScroll(p: View!, p1: View!, p2: Int)
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
removeViews(p: Int, p1: Int)
Unit
Unit
Boolean
Unit
Boolean
requestFocus(p: Int, p1: Rect!)
Boolean
Unit
Boolean
Unit
Unit
Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit
Unit

This function is deprecated.

Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit

This function is deprecated.

Unit
Unit
Unit
Unit
Unit
Boolean
ActionMode!
Unit
Unit
Unit
Unit

Constants

COLOR_AUTO

const val COLOR_AUTO = 2: Int

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

COLOR_DARK

const val COLOR_DARK = 0: Int

The dark color scheme of the sign-in button.

COLOR_LIGHT

const val COLOR_LIGHT = 1: Int

The light color scheme of the sign-in button.

SIZE_ICON_ONLY

const val SIZE_ICON_ONLY = 2: Int

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

SIZE_STANDARD

const val SIZE_STANDARD = 0: Int

The standard size of the Google sign-in button.

SIZE_WIDE

const val SIZE_WIDE = 1: Int

The wide size of the Google sign-in button.

Public constructors

SignInButton

SignInButton(context: Context!)

SignInButton

SignInButton(context: Context!, attrs: AttributeSet?)

SignInButton

SignInButton(context: Context!, attrs: AttributeSet?, defStyle: Int)

Public functions

onClick

fun onClick(view: View!): Unit

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 ColorScheme

setEnabled

fun setEnabled(enabled: Boolean): Unit

setOnClickListener

fun setOnClickListener(listener: View.OnClickListener?): Unit

setScopes

fun setScopes(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.

Parameters
scopes: Array<Scope!>!

A scope array.

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 ButtonSize

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 ButtonSize

@SignInButton.ColorScheme colorScheme: Int

The color scheme to use for the button. See ColorScheme

setStyle

@InlineMe(replacement = "this.setStyle(buttonSize, colorScheme)")
fun setStyle(
    @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 ButtonSize

@SignInButton.ColorScheme colorScheme: Int

The color scheme to use for the button. See ColorScheme

scopes: Array<Scope!>!

The scopes your app will use to sign in.