timbru31 / cordova-plugin-lottie-splashscreen

🐣 🎬 📱 Apache Cordova plugin to show Lottie animations as the splash screen with Airbnb's Lottie wrapper
https://www.npmjs.com/package/cordova-plugin-lottie-splashscreen
MIT License
128 stars 49 forks source link

LottieBackgroundColor preference color parsing error in Android #804

Open xavierserrai opened 3 weeks ago

xavierserrai commented 3 weeks ago

Bug report

LottieBackgroundColor preference color is not parsed properly in Android.

What steps will reproduce the problem?

Set a color in LottieBackgroundColor preference.

Expected output

The color you set in LottieBackgroundColor should be the one that you see as a lottie background color when running the app, specially in the blank space left by the status bar on startup.

What do you see instead?

This is a two layer problem. First of all Apache Cordova xml parser, XmlPull (https://www.xmlpull.org/) parses hexadecimal tags in a weird way, removing leading zeroes or adding ff characters in front of hex numbers when they are in RRGGBB format. After that, src/android/ColorHelper.kt tries to fix that but fails in doing so.

My solution was to use regular Color.parse function which seems to solve the problem.

Version information

cordova-android 13.0.0