07-20-2023, 03:22 PM
Basically I'd like to attach a single OnClickListener to multiple views inside a ConstraintLayout.
Before migrating to the ConstraintLayout the views where inside one layout onto which I could add a listener. Now they are on the same layer with other views right under the ConstraintLayout.
I tried adding the views to a `android.support.constraint.Group` and added a OnClickListener to it programmatically.
group.setOnClickListener {
Log.d("OnClick", "groupClickListener triggered")
}
However this does not seem to work as of the ConstraintLayout version `1.1.0-beta2`
Have I done something wrong, is there a way to achieve this behaviour or do I need to attach the listener to each of the single views?
Before migrating to the ConstraintLayout the views where inside one layout onto which I could add a listener. Now they are on the same layer with other views right under the ConstraintLayout.
I tried adding the views to a `android.support.constraint.Group` and added a OnClickListener to it programmatically.
group.setOnClickListener {
Log.d("OnClick", "groupClickListener triggered")
}
However this does not seem to work as of the ConstraintLayout version `1.1.0-beta2`
Have I done something wrong, is there a way to achieve this behaviour or do I need to attach the listener to each of the single views?