Skip to content

Instantly share code, notes, and snippets.

@EmmanuelGuther
Created February 19, 2020 07:50
Show Gist options
  • Save EmmanuelGuther/bb3447c149e0bb87b0b823c058d516e3 to your computer and use it in GitHub Desktop.
Save EmmanuelGuther/bb3447c149e0bb87b0b823c058d516e3 to your computer and use it in GitHub Desktop.
Add listener to all views in constraintlayout group
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