Skip to content

Add skip button as custom sign-in layout optionΒ #2148

Open
@MirecXP

Description

@MirecXP

Welcome to FirebaseUI and thanks for submitting an issue!

Please take a look at open issues, as well as resolved issues, to see if your issue is either already being addressed, or has been solved by someone else.

If not, please feel free to fill in the following info so we can help faster!

Step 1: Are you in the right place?

Yes.

Step 2: Describe your environment

  • Android device: any
  • Android OS version: any
  • Google Play Services version: any
  • Firebase/Play Services SDK version: any
  • FirebaseUI version: any

Step 3: Describe the problem:

The AuthUI login can be started as part of an onboarding flow. To simplify the UX, we do not want to add a separate onboarding screen for the user to decide whether they want to log in or not. So having a skip button available directly on the sign-in screen would help a lot.
The sign in screen can be cancelled by navigating back, but this is not suitable if the sign-in screen is part of some flow.

Steps to reproduce:

  1. Create custom sign-in layout (with optional skip/close/cancel button)
  2. Create sign-in intent using custom layout
  3. Launch sign-in activity using signInIntent

Observed Results:

It is not possible to cancel the launched sign-in activity with a custom button.

Expected Results:

I can use a custom button to cancel the sign in, e.g. Continue without login and I do not need a separate screen for that.

Relevant Code:

       val customSignInLayout: AuthMethodPickerLayout = AuthMethodPickerLayout.Builder(R.layout.onboarding_login_layout)
          .setGoogleButtonId(R.id.google_signin_button)
          .setAppleButtonId(R.id.apple_signin_button)
          .setTosAndPrivacyPolicyId(R.id.tos_link)
          .setSkipButtonId(R.id.skip_signin_button) // <-- this would be very useful
          .build()

      var signInIntent = AuthUI.getInstance()
          .createSignInIntentBuilder()
          .setAvailableProviders(providers)
          .setIsSmartLockEnabled(false)
          .setAlwaysShowSignInMethodScreen(true)
          .setLogo(R.mipmap.ic_launcher)
          .setTosAndPrivacyPolicyUrls(termsUrl, privacyUrl)
          .enableAnonymousUsersAutoUpgrade()
          .setAuthMethodPickerLayout(customSignInLayout)

      launcher.launch(signInIntent.build())  ```

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions