re: How to change the text and theme of Google's Sign-In button on Android? VIEW POST

FULL DISCUSSION
 

Hi Shobhit. Can you tell me how to change the textSize since this attribute is having no effect.

 

Hi Karan

Thanks for your comment. There is a reason for that. Google's com.google.android.gms.common.SignInButton button also doesn't provide any attribute called android:textSize. This is because they don't want you to change the size of the text based on their design guidelines.

If you check their branding guidelines here: developers.google.com/identity/bra..., they mention that "You can scale the button as needed for different devices and screen sizes, but you must preserve the aspect ratio so that the Google logo is not stretched". i.e You can use android:scaleX and android:scaleY attributes with in order to scale the button. This maintains the aspect ratio as well.

If you see the padding section on the same page, it shows an image which shows a static font size of 14sp as shown below:

i.e Font Size

That's why in the library also I've just used the suggested size in order to standardize it based on guidelines and don't consider the textSize even if it is set on the custom button. If adding scaling still doesn't solve what you are looking for, please feel free to open a pull request or an issue on the Github repository .

Thanks!

code of conduct - report abuse