android Google plus login customization

android, google-plus

Solution

I found two ways:

1) Fight it with a custom button:

<Button
    android:id="@+id/btnGooglePlus"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center_horizontal"
    android:background="@drawable/common_signin_btn_text_dark"
    android:text="@string/common_signin_button_text_long"
    android:textColor="@android:color/white"
    android:textAllCaps="false"
    android:textSize="15sp"
    android:paddingEnd="16dp"
    android:paddingStart="62dp"/>

2) Don't fight it (too much):

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

mGooglePlusSignInButton = (SignInButton) findViewById(R.id.btnGooglePlus);
mGooglePlusSignInButton.setSize(SignInButton.SIZE_WIDE);
setGooglePlusTextAllCaps(mGooglePlusSignInButton, false);

public static void setGooglePlusTextAllCaps(SignInButton signInButton, boolean allCaps)
{
    for (int i = 0; i < signInButton.getChildCount(); i++)
    {
        View v = signInButton.getChildAt(i);

        if (v instanceof TextView)
        {
            TextView tv = (TextView) v;
            tv.setAllCaps(allCaps);
            return;
        }
    }
}

The main trick seems to be the "mGooglePlusSignInButton.setSize(SignInButton.SIZE_WIDE);" method.

Problem

I'm creating a Android application and right now i'm implementing the social networks login. Facebook button is fine, but the google+ button is in a different language of the facebook one. Also, it only says "sign in", and i would like to have it to say "sign in with google" I'm new to the android programation, and saw that i need to make a custom button, but dont know how to do it(where to start it, how to call it) and make it look like google plus one. Could anyone give me a little bit of help? Thanks

Original source