Class GridEngine
- java.lang.Object
-
- androidx.constraintlayout.core.utils.GridEngine
-
public class GridEngine extends java.lang.ObjectGridEngine class contains the main logic of the Grid Helper
-
-
Field Summary
Fields Modifier and Type Field Description static intHORIZONTALstatic intVERTICAL
-
Constructor Summary
Constructors Constructor Description GridEngine()GridEngine(int rows, int columns)GridEngine(int rows, int columns, int numWidgets)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intbottomOfWidget(int i)Get the boxView for the widget i to add a constraint on the bottomintleftOfWidget(int i)Get the boxView for the widget i to add a constraint on the leftintrightOfWidget(int i)Get the boxView for the widget i to add a constraint on the rightvoidsetColumns(int columns)set new columns valuevoidsetNumWidgets(int num)Set new NumWidgets valuevoidsetOrientation(int orientation)set new orientation valuevoidsetRows(int rows)set new rows valuevoidsetSkips(java.lang.String skips)set new skips valuevoidsetSpans(java.lang.CharSequence spans)set new spans valuevoidsetup()Set up the Grid engine.inttopOfWidget(int i)Get the boxView for the widget i to add a constraint on the top
-
-
-
Field Detail
-
VERTICAL
public static final int VERTICAL
- See Also:
- Constant Field Values
-
HORIZONTAL
public static final int HORIZONTAL
- See Also:
- Constant Field Values
-
-
Method Detail
-
setup
public void setup()
Set up the Grid engine.
-
setSpans
public void setSpans(java.lang.CharSequence spans)
set new spans value- Parameters:
spans- new spans value
-
setSkips
public void setSkips(java.lang.String skips)
set new skips value- Parameters:
skips- new spans value
-
setOrientation
public void setOrientation(int orientation)
set new orientation value- Parameters:
orientation- new orientation value
-
setNumWidgets
public void setNumWidgets(int num)
Set new NumWidgets value- Parameters:
num- how many widgets to be arranged in Grid
-
setRows
public void setRows(int rows)
set new rows value- Parameters:
rows- new rows value
-
setColumns
public void setColumns(int columns)
set new columns value- Parameters:
columns- new rows value
-
leftOfWidget
public int leftOfWidget(int i)
Get the boxView for the widget i to add a constraint on the left- Parameters:
i- the widget that has the order as i in the constraint_reference_ids- Returns:
- the boxView to add a constraint on the left
-
topOfWidget
public int topOfWidget(int i)
Get the boxView for the widget i to add a constraint on the top- Parameters:
i- the widget that has the order as i in the constraint_reference_ids- Returns:
- the boxView to add a constraint on the top
-
rightOfWidget
public int rightOfWidget(int i)
Get the boxView for the widget i to add a constraint on the right- Parameters:
i- the widget that has the order as i in the constraint_reference_ids- Returns:
- the boxView to add a constraint on the right
-
bottomOfWidget
public int bottomOfWidget(int i)
Get the boxView for the widget i to add a constraint on the bottom- Parameters:
i- the widget that has the order as i in the constraint_reference_ids- Returns:
- the boxView to add a constraint on the bottom
-
-