FirebaseUI-Android icon indicating copy to clipboard operation
FirebaseUI-Android copied to clipboard

Android 15 edge-to-edge enforcement

Open ArcherEmiya05 opened this issue 1 year ago • 12 comments

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: AVD/Emulator
  • Android OS version: 15
  • Google Play Services version: N/A
  • Firebase/Play Services SDK version: N/A
  • FirebaseUI version: 8.0.2

Step 3: Describe the problem:

UI is broken in Android 15 due to the new edge-to-edge enforcement.

Steps to reproduce:

  1. Use Firebase Android UI Auth
  2. Use Phone Auth provider
  3. Run the project

Observed Results:

Screenshot_1733432497

Expected Results:

Adapt edge-to-edge or fix the UI to make it look like the way it used to on older Android versions/

Relevant Code:

A temporary solution to this is to opt-out from edge-to-edge by setting the below style attribute and apply the theme using AuthUI.SignInIntentBuilder.setTheme

 <!-- Firebase UI theme -->
  <style name="Theme.App.FirebaseAuthUI">

      <!-- For some reason, Firebase UI use this as textColorLink -->
      <item name="colorPrimary">@color/mdc_colorAccent</item>

      <!-- Use by Toolbar title color -->
      <!-- Use by Outlined text field color (unfocused) -->
      <!-- Use by OTP dashes color -->
      <!-- Use by Button disabled color -->
      <item name="colorOnSurface">@color/mdc_colorPrimary_White</item>

      <!-- TextInputLayout and button shape -->
      <item name="shapeAppearanceSmallComponent">@style/ShapeAppearance.MDC.SmallComponent</item> <!-- TODO FirebaseUI still uses MDC 2, remove this once they migrated to MDC 3 -->
      <item name="shapeAppearanceCornerExtraSmall">@style/ShapeAppearance.MDC.SmallComponent</item>

      <item name="android:windowOptOutEdgeToEdgeEnforcement" tools:targetApi="35">true</item> <!-- TODO FirebaseUI does not yet support edge-to-edge enforcement of Android 15, remove this once they adapted -->

  </style>
Intent signInIntent = 
    AuthUI.getInstance(this).createSignInIntentBuilder()
        // ...
        .setTheme(R.style.AppTheme)
        .build())

ArcherEmiya05 avatar Dec 05 '24 21:12 ArcherEmiya05

@ArcherEmiya05 thanks for reporting!

We're working on this in #2187 and we'll include it as part of the next release. In the meantime your workaround should do the trick. 👍

thatfiredev avatar Mar 17 '25 21:03 thatfiredev

Hi, is there any plan to release a new version with the patch related to edge to edge enforcement since windowOptOutEdgeToEdgeEnforcement will no longer work when app runs on Android 16 and above?

ArcherEmiya05 avatar Jul 20 '25 02:07 ArcherEmiya05

In Android 16, windowOptOutEdgeToEdgeEnforcement does not work. This is blocking us from updating our app to Android 16, which we urgently need to do. The issue has been present for a long time, but it still hasn’t been addressed. Please prioritize fixing this in Firebase Auth UI.

mnk98 avatar Sep 03 '25 10:09 mnk98

@thatfiredev any update on this?

ArcherEmiya05 avatar Sep 25 '25 21:09 ArcherEmiya05

Using these properties for the firebase theme seems to work around the issue on Android 16:

        <item name="android:fitsSystemWindows">true</item>
        <item name="android:windowDrawsSystemBarBackgrounds">true</item>

rocketraman avatar Oct 22 '25 05:10 rocketraman

@rocketraman If we use this

 <item name="android:fitsSystemWindows">true</item>
        <item name="android:windowDrawsSystemBarBackgrounds">true</item>

It loses the padding of buttons and the text field.

mnk98 avatar Oct 22 '25 10:10 mnk98

Hey everyone, We have just released v9.1.1 of the library which should address this issue. :)

thatfiredev avatar Oct 24 '25 11:10 thatfiredev

Hey everyone, We have just released v9.1.1 of the library which should address this issue. :)

This fix is incomplete or incorrect at all, it doesn't provide backward compatibility and doesn't follow the documentation for handling edge-to-edge. Additionally use padding instead of margin for better result.

Not working on older Android version (versions prior to 15) Screenshot_1761380346

Statusbar content has no contrast thus battery percentage and other icons are no longer visible. image

For those who need to make a release or update of their app now but was blocked by this issue. A workaround is to rollback using Firebase UI 8.0.2 and set targetSdk of your app to 35 so you can still use windowOptOutEdgeToEdgeEnforcement, assuming you don't rely on new features of API/SDK 36.

ArcherEmiya05 avatar Oct 25 '25 08:10 ArcherEmiya05

The 9.1.1 release is fixing edge-to-edge on api levels 34, 35 and 36 but not on api level 33 like on the Pixel 7 Pro emulator on which I captured the following screenshot.

Screenshot of Pixel 7 Pro api level 33 demonstrating the edge-to-edge issue.

nverinaud avatar Oct 28 '25 08:10 nverinaud

Yes, that new version is not compatible with the older version of the OS.

mnk98 avatar Oct 28 '25 11:10 mnk98

@ArcherEmiya05 @nverinaud @mnk98 Thanks for letting us know! We'll take a look once again

thatfiredev avatar Oct 28 '25 12:10 thatfiredev

Hello,

Thank you for taking the time to submit this bug.

We are happy to let you know that a resolution is already planned and on the roadmap for our upcoming new version.

We are actively working on the new SDK and will be sure to fix this bug once we have a public beta or a release candidate that includes this functionality. Please watch the main repository for the latest release.

In the meantime, we will keep this bug open for tracking.

demolaf avatar Nov 17 '25 20:11 demolaf