hello lovely people:) I would like to extend stati...
# announcements
s
hello lovely people:) I would like to extend static method of Java (Android) Color class, something like:
Copy code
fun Color.parseNullableColor(colorString: String?): Int? {
    val colorString = colorString ?: return null
    try {
        return Color.parseColor(colorString)
    } catch (e: IllegalArgumentException) {
        return null
    }
}
Seems it’s not possible? https://stackoverflow.com/questions/28210188/static-extension-methods-in-kotlin Thanks!
e
This is one of the items in the (currently running) JB Kotlin features survey. https://blog.jetbrains.com/kotlin/2021/06/kotlin-features-survey-edition-2/#companion-objects
👍 1
s
thanks for the info!
funny how Kotlin has some things nicer than Swift and vice versa (syntactially)