Group

public class Group
extends View

java.lang.Object
   ↳ android.view.View
     ↳ android.support.constraint.Group


Added in 1.1

This class controls the visibility of a set of referenced widgets. Widgets are referenced by being added to a comma separated list of ids, e.g:

     <android.support.constraint.Group
              android:id="@+id/group"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:visibility="visible"
              app:constraint_referenced_ids="button4,button9" />
     
     

The visibility of the group will be applied to the referenced widgets. It's a convenient way to easily hide/show a set of widgets without having to maintain this set programmatically.

Multiple groups

Multiple groups can reference the same widgets -- in that case, the XML declaration order will define the final visibility state (the group declared last will have the last word).

Summary

Inherited constants

Inherited fields

Public constructors

Group(Context context)
Group(Context context, AttributeSet attrs)
Group(Context context, AttributeSet attrs, int defStyleAttr)

Public methods

int[] getReferencedIds()

Helpers typically reference a collection of ids

void setReferencedIds(int[] ids)

Helpers typically reference a collection of ids

void updatePostConstraints(ConstraintLayout constainer)

Protected methods

View[] getViews(ConstraintLayout layout)

Inherited methods

Public constructors

Group

public Group (Context context)

Parameters
context Context

Group

public Group (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

Group

public Group (Context context, 
                AttributeSet attrs, 
                int defStyleAttr)

Parameters
context Context

attrs AttributeSet

defStyleAttr int

Public methods

getReferencedIds

public int[] getReferencedIds ()

Helpers typically reference a collection of ids

Returns
int[] ids referenced

setReferencedIds

public void setReferencedIds (int[] ids)

Helpers typically reference a collection of ids

Parameters
ids int

Returns
void ids referenced

updatePostConstraints

public void updatePostConstraints (ConstraintLayout constainer)

Parameters
constainer ConstraintLayout

Protected methods

getViews

protected View[] getViews (ConstraintLayout layout)

Parameters
layout ConstraintLayout

Returns
View[]