Inspectopedia Help

Should pass resolved color instead of resource id

Should pass resolved color instead of resource id

Methods that take a color in the form of an integer should be passed an RGB triple, not the actual color resource id. You must call getResources().getColor(resource) to resolve the actual color value first.

Similarly, methods that take a dimension integer should be passed an actual dimension (call getResources().getDimension(resource)

Issue id: ResourceAsColor

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for Android 2023.3, Qodana for JVM 2023.3

Plugin:

Android, 2022.3.1 Beta 2

Last modified: 13 July 2023