Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[android] fix MauiSplashScreen on Android 12+ #8394

Merged

Conversation

jonathanpeppers
Copy link
Member

@jonathanpeppers jonathanpeppers commented Jun 28, 2022

Fixes #7404
Context: https://developer.android.com/guide/topics/ui/splash-screen#set-theme

Reviewing a lot of the feedback around splash screens, I tried:

  1. Rename splash.svg to splash2.svg
  2. Change the .NET splash logo from white to blank.

I found these changes worked fine on Android < 12, but I did not see
my changes on Android 12+!

This was more troubling when I changed the MauiSplashScreen Color
to white:

image

After some review, it looks like we need to define:

<item name="android:windowSplashScreenBackground">@color/maui_splash_color</item>
<item name="android:windowSplashScreenAnimatedIcon">@drawable/maui_splash</item>

With these changes in place, the splash screen is working for me in
Android 12+, I tested a new project and changed the color of the .NET logo:

image

I believe we implemented MauiSplashScreen while Android 12 was still
in beta, so we just didn't notice this behavior. We also were sharing
the same .svg file for the app icon and splash screen previously,
which may have confused or hidden this issue.

Fixes: dotnet#7404
Context: https://developer.android.com/guide/topics/ui/splash-screen#set-theme

Reviewing a lot of the feedback around splash screens, I tried:

1. Rename `splash.svg` to `splash2.svg`
2. Change the .NET splash logo from white to blank.

I found these changes worked fine on Android < 12, but I did not see
my changes on Android 12+!

This was more troubling when I changed the `MauiSplashScreen` `Color`
to white.

After some review, it looks like we need to define:

    <item name="android:windowSplashScreenBackground">@color/maui_splash_color</item>
    <item name="android:windowSplashScreenAnimatedIcon">@drawable/maui_splash</item>

With these changes in place, the splash screen is working for me in
Android 12+.

I believe we implemented `MauiSplashScreen` while Android 12 was still
in beta, so we just didn't notice this behavior. We also were sharing
the same `.svg` file for the app icon and splash screen previously,
which may have confused or hidden this issue.
@Eilon Eilon added the area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer label Jun 29, 2022
@sykesconsulting
Copy link

sykesconsulting commented Feb 21, 2023

Where is the styles.xml file located on my local machine? I'm new to .net maui and can't seem to find it.

@suchithm
Copy link

suchithm commented Apr 5, 2023

Same issue, Will this display full screen image in splash screen? @jonathanpeppers
By anyways we can avoid cliping the image to smaller circle in center?

@mattleibow
Copy link
Member

This is the new feature of Android 12+. No more full screens. Maybe they will revert in Android 14, who knows. Maybe the only way is to file a bug with the Android SDK.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 20, 2023
@samhouts samhouts added the fixed-in-6.0.419 Look for this fix in 6.0.419! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer fixed-in-6.0.419 Look for this fix in 6.0.419! platform/android 🤖
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants