I have View and one CircleShape , which should show toast in this View. And I use it in main Activity. This is my interface
interface OnClickListenerInterfa
A more simpler solution by using lambda.
Inside CircleShape.kt, declare a lambda function.
var listener: (()->Unit)? = null ... // When you want to invoke the listener listener?.invoke()
Inside your Activity
mCircleShape.listener = { // Do something when you observed a call }