Skip to content

Instantly share code, notes, and snippets.

@RofieSagara
Created November 10, 2022 08:25
Show Gist options
  • Save RofieSagara/04fa66c57ac9299997918de153366925 to your computer and use it in GitHub Desktop.
Save RofieSagara/04fa66c57ac9299997918de153366925 to your computer and use it in GitHub Desktop.
Google login button Blue Android Compose
@Composable
fun GoogleButton(modifier: Modifier = Modifier, text: String = "Sign in with Google", onClick: ()->Unit) {
Row(
modifier = modifier
.background(color = Color(0xFF4285F4))
.height(40.dp)
.clickable { onClick.invoke() }
.padding(1.dp),
horizontalArrangement = Arrangement.Center,
verticalAlignment = Alignment.CenterVertically
) {
Box(modifier = Modifier
.fillMaxHeight()
.aspectRatio(1f / 1f)
.background(color = Color.White), contentAlignment = Alignment.Center) {
Image(
modifier = Modifier
.size(18.dp),
painter = painterResource(id = R.drawable.icons_google),
contentDescription = ""
)
}
Spacer(modifier = Modifier.width(24.dp))
Text(text = text, style = Typography.labelLarge.copy(color = Color.White))
Spacer(modifier = Modifier.width(8.dp))
}
}
@RofieSagara
Copy link
Author

Use this link for download Google Icon

@RofieSagara
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment