I am integrating my application with google plus. I have installed google play services and signed in to my account. Also I could publish and plus one for what ever I want.
I can't change the text of the sign in button.
<com.google.android.gms.common.SignInButton android:id="@+id/share_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:text="Share on Google+" /> First, I tried adding this line to the xml
android:text="Share on Google+" Secondly, I tried to set the text programmatically, however it didn't work.
Any help would be appreciated.
If it is not possible, is there any way so I can use the same google sign in button on another button?
Or based on whether it is a sign-in or sign-up flow, you want to switch between “Sign in with Google” and “Sign up with Google” text. As you might already know, to set the text on an Android Button , you can use android:text="{string}" attribute in your layout XML.
Add a Sign In With Google button to your site to enable users to sign-up or sign-in to your web app. Use either HTML or JavaScript to render the button and attributes to customize the button shape, size, text, and theme.
Add Google Sign-In to Your Web App console. log("ID: " + profile. getId()); // Don't send this directly to your server!
Here is the easiest way that I used:
TextView textView = (TextView) signInButton.getChildAt(0); textView.setText("your_text_xyz");
Here is the technique that I used:
protected void setGooglePlusButtonText(SignInButton signInButton, String buttonText) { // Find the TextView that is inside of the SignInButton and set its text for (int i = 0; i < signInButton.getChildCount(); i++) { View v = signInButton.getChildAt(i); if (v instanceof TextView) { TextView tv = (TextView) v; tv.setText(buttonText); return; } } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With