Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Google+ SignInButton. How to set size attribute in xml

Here is a basic Google+ Android Sign-In button in XML:

<com.google.android.gms.common.SignInButton
    android:id="@+id/sign_in_button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

In the class documentation it states that you can specify the size of the button as ICON_ONLY, STANDARD AND WIDE.

How do you do this using xml?

like image 616
Eurig Jones Avatar asked May 28 '13 12:05

Eurig Jones


2 Answers

Here is how to do it in XML.

<com.google.android.gms.common.SignInButton
        android:id="@+id/sign_in_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:buttonSize="wide"
        app:colorScheme="dark"/>

buttonSize => ("wide", "standard, "icon_only"), colorScheme = > ("light", "dark")

like image 129
jsc0 Avatar answered Nov 20 '22 02:11

jsc0


Here's a list of the methods on SignInButton around size and style:

https://developer.android.com/reference/com/google/android/gms/common/SignInButton.html

I'm not aware of any way to do this in XML.

like image 2
Shygar Avatar answered Nov 20 '22 01:11

Shygar