Jul 21, 2017 · 1 min read
I think consuming api is nicer as Kaushik Gopal says. The result is not the same.
animation.setAnimationListener {
onAnimationEnd {
// do something
}
}vs
animation.setAnimationListener(object: AnimationListener by EmptyAnimationListener { override fun onAnimationEnd(animation: Animation) { }})
Optional callback class may also be generated with a plugin in Android Studio. (If someone try to write a plugin for it. :-) ) So, the time of hacking part can be reduced.
