Is there a way to do something like this:
view.setOnClickListener { Log.e("","Hello") }
view.setOnClickListener { Log.e("","World") }
While letting both Log to show.
I have buttons on custom views with some universal actions to execute on click which I initialize them in constructor, now I want to setup some additional behaviors based on situations outside of class. And I notice doing things like above will simply overwrite the onClickListener.
What I can think of is to maybe store Array of Unit in the object and let view execute elements of it as on clicked. Then use accessor to append function to the array.
Is there a more simple way to keep existing actions and append new actions at the end?