Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Google plus login button style

I need the long style button for google+ signin in android.

According to the Branding guidelines here there are different styles for the button like long, medium, short etc

I am getting the medium style button with help of the sample app, But I want the long style button.

here is my button `

   <com.google.android.gms.common.SignInButton
        android:id="@+id/sign_in_button"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="5dp"
        android:visibility="visible" />

`

like image 924
iFunDroid Avatar asked Jan 10 '14 11:01

iFunDroid


People also ask

How do I customize my Google login button?

To create a Google Sign-In button with custom settings, add an element to contain the sign-in button to your sign-in page, write a function that calls signin2. render() with your style and scope settings, and include the https://apis.google.com/js/platform.js script with the query string onload=YOUR_RENDER_FUNCTION .


1 Answers

As the website described there are 3 sized button

  1. Icon only = SignInButton.SIZE_ICON_ONLY
  2. Normal button = SignInButton.SIZE_STANDARD
  3. Wide button = SignInButton.SIZE_WIDE

You can use it like this.

gSignInButton = (SignInButton) findViewById(R.id.sign_in_button);
gSignInButton.setOnClickListener(this);
gSignInButton.setEnabled(true);
gSignInButton.setSize(SignInButton.SIZE_WIDE);// wide button style
like image 196
Sagar V. Avatar answered Oct 03 '22 15:10

Sagar V.