Class ConstraintWidgetContainer


  • public class ConstraintWidgetContainer
    extends WidgetContainer
    A container of ConstraintWidget that can layout its children
    • Field Detail

      • mMetrics

        public Metrics mMetrics
      • mHorizontalChainsSize

        public int mHorizontalChainsSize
      • mVerticalChainsSize

        public int mVerticalChainsSize
      • mGroupsWrapOptimized

        public boolean mGroupsWrapOptimized
      • mHorizontalWrapOptimized

        public boolean mHorizontalWrapOptimized
      • mVerticalWrapOptimized

        public boolean mVerticalWrapOptimized
      • mWrapFixedWidth

        public int mWrapFixedWidth
      • mWrapFixedHeight

        public int mWrapFixedHeight
      • mSkipSolver

        public boolean mSkipSolver
    • Constructor Detail

      • ConstraintWidgetContainer

        public ConstraintWidgetContainer()
        Default constructor
      • ConstraintWidgetContainer

        public ConstraintWidgetContainer​(int x,
                                         int y,
                                         int width,
                                         int height)
        Constructor
        Parameters:
        x - x position
        y - y position
        width - width of the layout
        height - height of the layout
      • ConstraintWidgetContainer

        public ConstraintWidgetContainer​(int width,
                                         int height)
        Constructor
        Parameters:
        width - width of the layout
        height - height of the layout
      • ConstraintWidgetContainer

        public ConstraintWidgetContainer​(java.lang.String debugName,
                                         int width,
                                         int height)
    • Method Detail

      • invalidateGraph

        public void invalidateGraph()
        Invalidate the graph of constraints
      • invalidateMeasures

        public void invalidateMeasures()
        Invalidate the widgets measures
      • directMeasure

        public boolean directMeasure​(boolean optimizeWrap)
      • directMeasureSetup

        public boolean directMeasureSetup​(boolean optimizeWrap)
      • directMeasureWithOrientation

        public boolean directMeasureWithOrientation​(boolean optimizeWrap,
                                                    int orientation)
      • defineTerminalWidgets

        public void defineTerminalWidgets()
      • measure

        public long measure​(int optimizationLevel,
                            int widthMode,
                            int widthSize,
                            int heightMode,
                            int heightSize,
                            int lastMeasureWidth,
                            int lastMeasureHeight,
                            int paddingX,
                            int paddingY)
        Measure the layout
      • updateHierarchy

        public void updateHierarchy()
      • fillMetrics

        public void fillMetrics​(Metrics metrics)
      • setOptimizationLevel

        public void setOptimizationLevel​(int value)
        Resolves the system directly when possible
        Parameters:
        value - optimization level
      • getOptimizationLevel

        public int getOptimizationLevel()
        Returns the current optimization level
      • optimizeFor

        public boolean optimizeFor​(int feature)
        Returns true if the given feature should be optimized
      • getType

        public java.lang.String getType()
        Specify the xml type for the container
        Overrides:
        getType in class ConstraintWidget
        Returns:
        type (null if not set)
      • isWidthMeasuredTooSmall

        public boolean isWidthMeasuredTooSmall()
        Return true if the width given is too small for the content laid out
      • isHeightMeasuredTooSmall

        public boolean isHeightMeasuredTooSmall()
        Return true if the height given is too small for the content laid out
      • addHorizontalWrapMinVariable

        public void addHorizontalWrapMinVariable​(ConstraintAnchor left)
      • addHorizontalWrapMaxVariable

        public void addHorizontalWrapMaxVariable​(ConstraintAnchor right)
      • addChildrenToSolver

        public boolean addChildrenToSolver​(LinearSystem system)
        Add this widget to the solver
        Parameters:
        system - the solver we want to add the widget to
      • updateChildrenFromSolver

        public boolean updateChildrenFromSolver​(LinearSystem system,
                                                boolean[] flags)
        Update the frame of the layout and its children from the solver
        Parameters:
        system - the solver we get the values from.
      • updateFromRuns

        public void updateFromRuns​(boolean updateHorizontal,
                                   boolean updateVertical)
        Overrides:
        updateFromRuns in class ConstraintWidget
      • setPadding

        public void setPadding​(int left,
                               int top,
                               int right,
                               int bottom)
        Set the padding on this container. It will apply to the position of the children.
        Parameters:
        left - left padding
        top - top padding
        right - right padding
        bottom - bottom padding
      • setRtl

        public void setRtl​(boolean isRtl)
        Set the rtl status. This has implications for Chains.
        Parameters:
        isRtl - true if we are in RTL.
      • isRtl

        public boolean isRtl()
        Returns the rtl status.
        Returns:
        true if in RTL, false otherwise.
      • handlesInternalConstraints

        public boolean handlesInternalConstraints()
        Indicates if the container knows how to layout its content on its own
        Returns:
        true if the container does the layout, false otherwise
      • getVerticalGuidelines

        public java.util.ArrayList<Guideline> getVerticalGuidelines()
        Accessor to the vertical guidelines contained in the table.
        Returns:
        array of guidelines
      • getHorizontalGuidelines

        public java.util.ArrayList<Guideline> getHorizontalGuidelines()
        Accessor to the horizontal guidelines contained in the table.
        Returns:
        array of guidelines
      • setPass

        public void setPass​(int pass)
        Keep track of the # of passes