[prebuild config] Created android splash plugin #3576
[prebuild config] Created android splash plugin #3576
Conversation
packages/prebuild-config/src/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.ts
Outdated
Show resolved
Hide resolved
packages/prebuild-config/src/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.ts
Outdated
Show resolved
Hide resolved
.../prebuild-config/src/plugins/unversioned/expo-splash-screen/withAndroidSplashMainActivity.ts
Outdated
Show resolved
Hide resolved
if (config.androidStatusBar?.backgroundColor) { | ||
if (backgroundColor.toLowerCase() !== config.androidStatusBar?.backgroundColor.toLowerCase()) { | ||
if (backgroundColor !== config.androidStatusBar?.backgroundColor.toLowerCase()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like the backgroundColor
is from app config, do we ensure this is in lowercase?
besides, the backgroundColor
is verified by schema /^#|(#)\\d{6}$/
https://github.com/expo/universe/blob/266e38e4b1edb23cd9c7297c3219814c490f7937/server/www/xdl-schemas/UNVERSIONED-schema.json#L46
i am getting a little confused from this regexp, though i know is from a historical code.
/^#|(#)\\d{6}$/.test('#HelloWorld') === true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the validation matters too much here (or for this PR). Android allows lots of different types of colors in the colors.xml
file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that makes sense, thanks for the classification.
.../prebuild-config/src/plugins/unversioned/expo-splash-screen/withAndroidSplashMainActivity.ts
Show resolved
Hide resolved
if (config.android?.splash) { | ||
const splash = config.android?.splash; | ||
return { | ||
// TODO: Does this not support `image`? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it kinda does, i believe, but if you provide an image that is too large it could crash the app on low end devices
Why
expo/configure-splash-screen
and use static mods for introspection. Resolves ENG-79How
android.colorsNight
to handleandroid/app/src/main/res/values-night/colors.xml
Added pseudo support for undocumented props:
Test images:
splash.zip
Test Plan