The Android Developer Challenge is back! Submit your idea before December 2.

Group

public class Group
extends View

java.lang.Object
   ↳ 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

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 loadParameters(ConstraintSet.Constraint constraint, HelperWidget child, ConstraintLayout.LayoutParams layoutParams, mapIdToWidget)
void resolveRtl(ConstraintWidget widget, boolean isRtl)
void setReferencedIds(int[] ids)

Helpers typically reference a collection of ids

void updatePostConstraints(ConstraintLayout constainer)
void updatePreLayout(ConstraintWidgetContainer container, Helper helper, map)

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

loadParameters

public void loadParameters (ConstraintSet.Constraint constraint, 
                HelperWidget child, 
                ConstraintLayout.LayoutParams layoutParams, 
                 mapIdToWidget)

Parameters
constraint ConstraintSet.Constraint

child HelperWidget

layoutParams ConstraintLayout.LayoutParams

mapIdToWidget

resolveRtl

public void resolveRtl (ConstraintWidget widget, 
                boolean isRtl)

Parameters
widget ConstraintWidget

isRtl boolean

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

updatePreLayout

public void updatePreLayout (ConstraintWidgetContainer container, 
                Helper helper, 
                 map)

Parameters
container ConstraintWidgetContainer

helper Helper

map

Protected methods

getViews

protected View[] getViews (ConstraintLayout layout)

Parameters
layout ConstraintLayout

Returns
View[]