Skip to content

LottieBackgroundColor preference color parsing error in Android #804

@xavierserrai

Description

@xavierserrai

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions