stevdza-san / OneTapCompose

This library allow you to easily integrate One-Tap Sign in with Google(Credential Manager) in your project with Jetpack Compose. It keeps away all the boilerplate code.
Apache License 2.0
171 stars 15 forks source link

Implement OneTapSignInWithGoogleButton #17

Closed shubhamsinghshubham777 closed 5 months ago

shubhamsinghshubham777 commented 5 months ago

This PR implements an even easier way for the end users to consume this library by introducing a One Tap Google Sign In button based on Google's official sign-in button design guidelines.

There are 3 theme variants:

  1. Light
  2. Dark
  3. Neutral

The button uses default values for all params except the clientId which makes it very easy for the end user to get started with our button while providing him with a more authentic Sign-in experience.

For example, getting started with this button is as easy as writing just this:

@Composable
fun AuthScreen() {
    OneTapSignInWithGoogleButton(
        clientId = "YOUR_CLIENT_ID"
    )
}

No need to write OneTapSignInWithGoogle and manage its state anymore if you don't want to.

Previews

Screenshot 2023-12-07 at 1 03 37 AM

Please note that these Compose previews won't work properly (i.e. be shown in the preview window) until #16 is merged

shubhamsinghshubham777 commented 5 months ago

@stevdza-san Could you please have a look at this?

stevdza-san commented 5 months ago

Thanks for the PR, I'll take a look at it in the next week and decide if I would proceed with it. 😊

shubhamsinghshubham777 commented 5 months ago

@stevdza-san Did you get a chance to have a look at both PRs?

stevdza-san commented 5 months ago

Great updates @shubhamsinghshubham777 👍 In the new release I'll just update the tag to be the same on both sides, so that we can have a consistence.

shubhamsinghshubham777 commented 5 months ago

Great updates @shubhamsinghshubham777 👍 In the new release I'll just update the tag to be the same on both sides, so that we can have a consistence.

That's awesome! Thank you @stevdza-san 👏

shubhamsinghshubham777 commented 5 months ago

Do you need a hand with the README as well? I'd be happy to contribute.

stevdza-san commented 5 months ago

@shubhamsinghshubham777 Sure, feel free to add an additional section for the Google button.