Repository navigation
Conversation
BootTheme's windowBackground wrapped the app's splash.png in an <inset> drawable, which scales the bitmap independently on both axes to fill the window. Any splash image whose aspect ratio differs from the screen got distorted: square icons turned into rectangles and text was squashed. This regressed when we moved to react-native-bootsplash (#711 had removed the same windowBackground earlier). Draw the splash with a small CenterCropDrawable instead: it scales the image uniformly to cover the window and centers it, matching the iOS launch screen (scaleAspectFill). A white layer underneath shows through transparent pixels, also matching iOS. The drawable is inflated by class name from XML, so it gets a ProGuard keep rule. Written in Java because the app module applies the Compose compiler plugin without a Compose runtime, which breaks compileKotlin as soon as the module contains a Kotlin source. MOO-2469 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 12, 2026
This branch has not been deployed
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.
Description
MOO-2469: on Android, the splash screen is stretched to the screen size. Square icons turn into rectangles and text gets squashed whenever the splash image's aspect ratio differs from the device's. A customer reported this after building with the template. Make it Native had the same bug and was fixed in mendix/make-it-native#264 / #267. This PR ports that fix.
Root cause
BootTheme(used byRNBootSplash.init) setsandroid:windowBackgroundto@drawable/splash_screen, which is an<inset>around@drawable/splash. An inset drawable scales its bitmap independently on both axes to fill the window, so the image is distorted on any screen with a different aspect ratio.This is a regression. #711 removed the same
windowBackgroundin 2023 because it distorted the splash, and the oldlaunch_screen.xmlusedscaleType="centerCrop". The move to react-native-bootsplash put the inset back onBootTheme.iOS isn't affected:
LaunchScreen.storyboardusesscaleAspectFill.Fix
splashscreen/CenterCropDrawable.java: scalesandroid:srcevenly to cover the bounds and centers it (center-crop, the same as iOSscaleAspectFill). The image's aspect ratio is always preserved. On screens shaped differently from the image, the overflowing edges are cropped instead of the image being stretched.drawable/bootsplash.xml: an opaque layer list, with a white background (same as the iOS launch screen) under the center-cropped@drawable/splash.styles.xml:BootThemenow uses@drawable/bootsplash. The unuseddrawable/splash_screen.xmlis removed.proguard-rules.pro: keep rule for the drawable, because it is inflated by class name from XML. Minification is off by default, but customers can enable it.splash.png(the file the build replaces with the customer's image) is unchanged, so existing apps pick up the fix without changes.The drawable is Java rather than Kotlin because the app module applies
org.jetbrains.kotlin.plugin.composewithout a Compose runtime. Adding any.ktfile to the module makescompileKotlinfail withIncompatibleComposeRuntimeVersionException. That's left out of scope here.Checklist
This PR contains
Important Notes
What should be covered while testing?
Tested on an emulator (1080×2424, 420 dpi) with an app generated from template 19.1.8 (Mendix 11.12):
splash.png): no longer stretched. The on-screen result matches a calculated exact center-crop (scale 0.946, about 10.4% cropped on each side, top and bottom fully visible).Please also check:
enableProguardInReleaseBuilds = true: the splash still shows, so the keep rule works.Extra comments (optional)
Ported to
masterin #1368 and torelease/17.x.x(Mendix 11.6) in #1369.🤖 Generated with Claude Code