In Kotlin, is there a way to reference the listener instance when using this short notation for anonymous classes? In this case this
refers to outer context (e.
val animation = object : Animation() {
override fun applyTransformation(interpolatedTime: Float, t: Transformation) {
val layoutParam: RelativeLayout.LayoutParams? = playerView.layoutParams as RelativeLayout.LayoutParams?
layoutParam?.topMargin = convertDpToPixel(position, this@SurahActivity).toInt()
playerView.layoutParams = layoutParam
}
}