Kotlin support for @ColorInt Java Annotation

Does Kotlin support java annotations such as @ColorIntbecause I cannot get it to work. I can annotate the color with @ColorInt, but not really get the control lines for this annotation.

Example

    fun setStatusBarColor(@ColorInt color){
        window.setStatusBarColor(color)
    }

When passing R.color.colorPrimary, the thread is not displayed. Must show lint with R.color.colorPrimaryand not show withresources.getColor(R.color.colorPrimary)

+4
source share
1 answer

Kotlin Java. Lint, , Java Kotlin, Android Studio Android- IntelliJ IDEA. Java, Kotlin Kotlin.

+8

Source: https://habr.com/ru/post/1650155/


All Articles