Yubico / yubikit-android

Yubico Mobile Android SDK - YubiKit
Apache License 2.0
102 stars 38 forks source link

Color resources should be prefixed #74

Closed ajarl closed 1 year ago

ajarl commented 1 year ago

Android libraries should use prefixes for all resources to avoid conflicts with resources defined in consuming apps. See https://developer.android.com/studio/projects/android-library#Considerations

In this case, our app had defined @color/text_color_primary which ended up overridden from the Yubikit library, thus giving us the wrong text color. It could also happen in reverse (that colors defined in the Yubikit library get overridden from the consuming app, possibly producing unreadable UIs) depending on the app's configuration.

In addition, as library developers you may consider including a public.xml to define which resources should be public or not (i.e. maybe consumers of your library shouldn't see @color/yubikit_text_color_primary).

AdamVe commented 1 year ago

Thank you for raising the issue and the provided PR, we will include it in yubikit asap. I have also created a new issue #76 for your suggestion of adding public.xml 👍🏻.