Created
February 19, 2020 07:50
-
-
Save EmmanuelGuther/bb3447c149e0bb87b0b823c058d516e3 to your computer and use it in GitHub Desktop.
Add listener to all views in constraintlayout group
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun Group.addOnClickListener(listener: (view: View) -> Unit) { | |
referencedIds.forEach { id -> | |
rootView.findViewById<View>(id).setOnClickListener(listener) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment