I don't need it, but I'm using this to maintain co...
# announcements
f
I don't need it, but I'm using this to maintain compatibility with the previous utils, written in java (method was dpToPx then)
g
you could just add a forwarding method:
Copy code
fun Int.dpToPx() = px()
Actually this seems to work for me:
Copy code
@JvmName("dpToPx")
fun Int.px(): Int = this * 2 // replace w/ your impl
call it from java:
Copy code
MetricUtils.dpToPx(22);
f
I know, that's not the issue. I'm just using an extension property instead of function here to avoid
()
in Kotlin
g
i see.. not sure then. Personally prefer the
()
f
even with extension function instead of property, the original issue remains, is it possible to rename the parameter
$receiver
that's visible in java?
g
my apologies i completely misunderstood the question
f
no problem, thanks for having a look anyway 🙂
k
This isn't possible yet, here's the issue about it: https://youtrack.jetbrains.com/issue/KT-19739
f
Okay, thanks! 🙂