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

Improve Android 12+ splash images #10604

Open
mattleibow opened this issue Oct 11, 2022 · 8 comments
Open

Improve Android 12+ splash images #10604

mattleibow opened this issue Oct 11, 2022 · 8 comments
Labels
area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer platform/android 🤖 proposal/open
Milestone

Comments

@mattleibow
Copy link
Member

Description

The current behavior is that the splash screen is clipped on Android 12+. Previously, Android would just display the image as-is and you would have to do all the work yourself.

In Android 12, things got smarter and now the image is clipped inside a circle and you could potentially have a different foreground/background layer like the adaptive icons.

https://developer.android.com/develop/ui/views/launch/splash-screen

Public API Changes

None.

Intended Use-Case

We could leverage the same properties of <MauiIcon> and do splash screens better. We can use the same logic to make adaptive icons, but just in the drawable folder and not generate the xml. Then the splash screen uses that drawable pair to make a nicer icon.

@mattleibow
Copy link
Member Author

Another area is to also look at not generating larger images than can be used. Prior to Android 12, the image was the full available space. In 12+ the image is "108dp" but also not really...

I found that if I tried to actually make 108dp (mdpi) images it scaled up. In fact, no matter what size image, it always looks blurry... I am wondering if the adaptive xml is loading smaller images and then scaling up because according to de docs (https://developer.android.com/develop/ui/views/launch/splash-screen#splash-screen-animate-reqs):

The icon area must be 432 dp (in other words, four times 108 dp of the area of an unmasked adaptive icon).

But generating an image of 432dp results in a terrible image - either massive clip or super scaled.

@janseris
Copy link

janseris commented Oct 11, 2022

If image is not square it is clipped and not zoomed to fit into the circle
E. g. wide image with company logo with 8 letters is clipped by the circle so that only middle 3 letters are visible on Android 12.

Splash screen

Screenshot_20221011-165243~2

Original

Screenshot_20221011-165147~2

@PureWeen PureWeen added area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer platform/android 🤖 labels Oct 11, 2022
@PureWeen PureWeen added this to the Backlog milestone Oct 11, 2022
@ghost
Copy link

ghost commented Oct 11, 2022

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@mattleibow
Copy link
Member Author

@janseris what version of maui are you using? I think this was fixed in the version that went out with .NET 7 RC 1. The image is now shrunk to fit inside the circle.

@janseris
Copy link

janseris commented Oct 11, 2022

@mattleibow latest nonpreview. NET 6 which comes with latest VS (17.3.5 I think because we use MAUI in production)

@harima34
Copy link

Did is possible to make the splash icon not fit the square area ? I wanted to maque a rectangle instead of square, but to my rectagle image is streaching to fit the square area.

@mattleibow
Copy link
Member Author

In the case of Android 12+, not that I can see. Android is locking down the stuff so maybe you can see something here?

https://developer.android.com/develop/ui/views/launch/splash-screen

@fgiacomelli
Copy link

Hello, I just tryed with VS 17.5.0 preview 2, because I read that the problem of the round image on Android >= 12 was solved, but on my test I continue to see my splash icon, that is a rectangle, filled and stretched in a circle.
I think it's related to the #9886, that is marked as solved.
I'm deploying on Android 12, target version net 7.0.

In which version can we expect it will be fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer platform/android 🤖 proposal/open
Projects
None yet
Development

No branches or pull requests

5 participants