Support 'transparent' as a acceptable color. - Java react-native-bootsplash

Feature request

Support passing color transparent when generating assets. It can be replaced as @android/transparent color on android. Not sure about IOS.

Why it is needed

It can greatly help with automatic light/dark mode situation.

Possible implementation

when transparent is supplied. Replace it with

<resources>
    <color name="bootsplash_background">@android:color/transparent</color>
</resources>

NOT SURE ABOUT IOS.

Code sample

Asked Oct 13 '21 13:10
avatar kuasha420
kuasha420

5 Answer:

@kuasha420 Hi. This doesn't seems useful. What is the use-case?

1
Answered May 30 '21 at 19:10
avatar  of zoontek
zoontek

@zoontek Hi,

This is useful in with Theme.AppCompat.DayNight.NoActionBar, where the system background changes automatically based on the System Theme. If the bootsplash background is transparent. then it will be white on light theme and a darkish color on dark theme. I can send in a gif once I am home.

Cheers.

1
Answered May 30 '21 at 23:46
avatar  of kuasha420
kuasha420

This is a rather specific use case, I prefer not to implement such edge cases (and document them!) and let the developer update its styles.xml after bootstraping.

1
Answered May 31 '21 at 07:33
avatar  of zoontek
zoontek

Understood. Although I don't think it's an edge case as automatic dark/light theme support on bootsplash is somewhat requested feature. Would you consider accepting a PR for it?

Cheers

1
Answered May 31 '21 at 08:31
avatar  of kuasha420
kuasha420

I wouldn't consider it an edge case either, I think this would be worth adding in the future.

Even just adding some instructions on adding a dark/light mode into the documentation would go a long way

1
Answered Jun 02 '21 at 02:22
avatar  of AlfieJones
AlfieJones