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

feat(android): Android 12 Splash Screen API #1011

Merged
merged 28 commits into from
Jul 21, 2022

Conversation

ItsChaceD
Copy link
Contributor

@ItsChaceD ItsChaceD commented May 31, 2022

This PR adds support for the optional usage of the Android 12 Splash Screen API.

  • This will affect all devices running SDK Version 31+ (required)
  • Supports Fade Out Animation and Animated Icons
  • Backwards compatible with SDK < 31 if opted-in to using new API.

closes #459
closes #561

Copy link
Member

@jcesarmobile jcesarmobile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a few comments.

Also I think there is something wrong with the README, there are some style changes that shouldn't be there.
If I run npm run build it undoes most of the changes, can you run it too and see if it undoes the changes?

@jcesarmobile jcesarmobile changed the base branch from capacitor-4 to main July 6, 2022 15:49
Copy link
Member

@jcesarmobile jcesarmobile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a few comments.

Also, all the configuration options that won't work on the new splash should include a note that says something like "Does't work in Android 12+ devices or if using Android 12 Splash Screen API" or similar messaging.

Copy link
Member

@jcesarmobile jcesarmobile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When using this configuration:

"plugins": {
    "SplashScreen": {
	  "launchAutoHide": true,
	  "launchShowDuration": 7000
    }
}

Then when I call Show with auto hide or Show and then Hide after a timeout, the splash never disappears.

Adding onPreDrawListener = null; on line 142 seems to fix the issue, but there might be another way.

@jcesarmobile jcesarmobile merged commit 79185ad into main Jul 21, 2022
@jcesarmobile jcesarmobile deleted the splash-screen/android-12-api branch July 21, 2022 17:48
@moradopablo
Copy link

moradopablo commented Oct 21, 2024

Hi, I have a question: to avoid the stretched image in Android 11 (#459), the only solution would be to modify the style.xml file in the Android project? Thank you very much in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate to Splash Screen API ↕️ Splash Screen image is stretched.
5 participants