How to show new Google plus one new design

86 views Asked by At

I am using the Google plus api to show the +1 button on my app. I am building against the latest version of Google play services(8.3) and testing on Nexus 9(updated to marshmallow and 8.3.01 Google play services)

But it still shows the old design of the +1 button.Old google plus button

How do I display the new design. enter image description here

Code I am using in the layout file :

<com.google.android.gms.plus.PlusOneButton android:id="@+id/plus_one_button"
            xmlns:plus="http://schemas.android.com/apk/lib/com.google.android.gms.plus"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="8dp"
            android:layout_marginRight="8dp"
            android:focusable="true"
            android:minHeight="24dp"
            plus:annotation="inline"
            plus:size="medium" />
1

There are 1 answers

2
Actiwitty On

Can you check your activity to ensure you have initialized it this way:

 private static final int PLUS_ONE_REQUEST_CODE = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mPlusClient = new PlusClient(this, this, this);
    mPlusOneButton = (PlusOneButton) findViewById(R.id.plus_one_button);
}

protected void onResume() {
    super.onResume();
    // Refresh the state of the +1 button each time the activity receives focus.
    mPlusOneButton.initialize(URL, PLUS_ONE_REQUEST_CODE);
}

Where: - URL is the address of the Google page to be +1'd

  • PLUS_ONE_REQUEST_CODE is the request code to use when opening the +1 activity. This value must be an unsigned 16 bit integer.

Plus I am assuming you have done all of this https://developers.google.com/+/mobile/android/getting-started before you got here because you are seeing the required result.