Better splash screens: iOS SVG + continuous native Android splash#159
Open
unlocdavid wants to merge 1 commit into
Open
Better splash screens: iOS SVG + continuous native Android splash#159unlocdavid wants to merge 1 commit into
unlocdavid wants to merge 1 commit into
Conversation
Accept splash.svg on iOS as a native vector LaunchImage, and hold Android's system splash until the WebView is ready to eliminate the phase-1→phase-2 jump when configured. iOS: - Support public/splash.svg (+ splash-dark.svg) as a vector asset (preserves-vector-representation); falls back to the PNG path. Android: - Add androidx.core:core-splashscreen; installSplashScreen() + setKeepOnScreenCondition hold the system splash in native style. - Generate Theme.AndroidPHP.Splash and point the app theme at it. - New android.splash config: style (image|native), background, background_night. - System splash shows the app launcher icon in both styles; image style keeps the full-bleed Compose overlay, native relies on the held system splash (API 31+, overlay fallback below 31). - Apply splash style/icon/background at build time so changes take effect on rebuild, and set the post-splash windowBackground to the splash color to avoid a white flash on handoff. - Guarantee an @drawable/splash drawable (placeholder + app-icon/PNG fallback) so resource linking never fails.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Full disclosure: This PR is made with Claude Opus
I had some issues with splash screens. On Android the splash was fuzzy in some cases, maybe because of my UI scaling. And the native Android splash and NativePHP splash generated visual noise on boot.
I investigated if SVG would be an option, but it seems to only be reliable for iOS. So this PR adds support for
splash.svgandsplash-dark.svgonly on iOS. If an SVG is found, it takes precedence over PNGs.On Android 12+ there is a native splash screen of the app icon in a circle on a colored background. After the first loading of the app it jumped to the NativePHP configured PNG splash which waits for PHP etc. boots. This PR adds the option to hold the native splash and don't show the PNG. This solves two problems:
nativein the config eliminates the jump.Below is the description generated by Claude:
Summary
Two splash-screen improvements:
splash.svg(no rasterizer).unbranded-system-splash → custom-overlay jump, with a new config to choose the style.
Android splash input remains PNG-only (an SVG→VectorDrawable path was explored and dropped as too unreliable).
iOS
public/splash.svg(+ optionalsplash-dark.svg) is written intoLaunchImage.imagesetas a vector asset (
preserves-vector-representation). Invalid/missing SVG falls back tothe existing PNG pipeline.
Android
androidx.core:core-splashscreen;installSplashScreen()+setKeepOnScreenConditionhold the system splash through boot innativestyle.Theme.AndroidPHP.Splashand point the app theme at it.android.splashconfig:style(imagedefault |native),background,background_night(env:NATIVEPHP_ANDROID_SPLASH_*).imagekeeps thefull-bleed Compose overlay;
nativerelies on the held system splash on API 31+, withthe overlay as the fallback below 31.
effect on rebuild (not just install).
windowBackgroundtracks the splash color to avoid a white flash on handoff.@drawable/splashdrawable is always guaranteed (shipped placeholder + app-icon/PNGfallback) so resource linking never fails.
Config
Old configs without this block fall back to image mode with white/black defaults.