Posts

Showing posts with the label Google Plus

Can I Edit The Text Of Sign In Button On Google?

Image
Answer : 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; } } } Here is the easiest way that I used: TextView textView = (TextView) signInButton.getChildAt(0); textView.setText("your_text_xyz"); Problem: Other answers have mentioned a workaround. The underlying implementation of the button may change any time which would cause the code to break. I felt uncomfortable trying to use the hacks. For a clean solution, you would think that setting android:text on the com.google.android.gms.common.SignInButton in your layout file would do the trick. However it turns...