public class Flex extends Object implements Layout
forceNewTrack
is used.
Flex grow if set on an item it will grow to fill the remaining space on the
track. The available space will be distributed among items respective to
their grow value (larger value means more space).setFlexGrow
.
setRowPadding
and
setColumnPadding
can be used
to modify the space between the rows and columns or the items on a track.Modifier and Type | Field and Description |
---|---|
static int |
FLEX_ALIGN_CENTER
simply center
|
static int |
FLEX_ALIGN_END
means right on a horizontally and bottom vertically
|
static int |
FLEX_ALIGN_SPACE_AROUND
items are evenly distributed in the track with equal space around them.
|
static int |
FLEX_ALIGN_SPACE_BETWEEN
items are evenly distributed in the track: first item is on the start
line, last item on the end line.
|
static int |
FLEX_ALIGN_SPACE_EVENLY
items are distributed so that the spacing between any two items (and the
space to the edges) is equal.
|
static int |
FLEX_ALIGN_START
means left on a horizontally and top vertically
|
static int |
FLEX_FLOW_TYPE_COLUMN
Place the children in a column (track) without wrapping
|
static int |
FLEX_FLOW_TYPE_COLUMN_WRAP
Place the children in a column (track) with wrapping
|
static int |
FLEX_FLOW_TYPE_ROW
Place the children in a row (track) without wrapping
|
static int |
FLEX_FLOW_TYPE_ROW_WRAP
Place the children in a row (track) with wrapping
|
Constructor and Description |
---|
Flex() |
Modifier and Type | Method and Description |
---|---|
int |
getCrossAlign()
Returns Flex align in cross direction
|
int |
getFlowType()
Returns Flex Flow Type of the flex layout.
|
int |
getMainAlign()
Returns Flex align in main direction
|
int |
getTrackCrossAlign()
Returns Flex align in cross direction for tracks
|
void |
setCrossAlign(int align)
Sets Flex align in cross direction
|
void |
setFlowType(int type)
Sets Flex Flow Type.
|
void |
setMainAlign(int align)
Sets Flex align in main direction
|
void |
setTrackCrossAlign(int align)
Sets Flex align in cross direction for tracks
|
public static final int FLEX_FLOW_TYPE_ROW
public static final int FLEX_FLOW_TYPE_COLUMN
public static final int FLEX_FLOW_TYPE_ROW_WRAP
public static final int FLEX_FLOW_TYPE_COLUMN_WRAP
public static final int FLEX_ALIGN_START
public static final int FLEX_ALIGN_END
public static final int FLEX_ALIGN_CENTER
public static final int FLEX_ALIGN_SPACE_EVENLY
public static final int FLEX_ALIGN_SPACE_AROUND
public static final int FLEX_ALIGN_SPACE_BETWEEN
public void setFlowType(int type)
type
- FLEX_FLOW_TYPE_ROW
or FLEX_FLOW_TYPE_COLUMN
or FLEX_FLOW_TYPE_ROW_WRAP
or
FLEX_FLOW_TYPE_COLUMN_WRAP
public int getFlowType()
public void setMainAlign(int align)
align
- FLEX_ALIGN_START
or FLEX_ALIGN_END
or
FLEX_ALIGN_CENTER
or FLEX_ALIGN_SPACE_EVENLY
or FLEX_ALIGN_SPACE_AROUND
or
FLEX_ALIGN_SPACE_BETWEEN
public int getMainAlign()
public void setCrossAlign(int align)
align
- FLEX_ALIGN_START
or FLEX_ALIGN_END
or
FLEX_ALIGN_CENTER
public int getCrossAlign()
public void setTrackCrossAlign(int align)
align
- FLEX_ALIGN_START
or FLEX_ALIGN_END
or
FLEX_ALIGN_CENTER
or FLEX_ALIGN_SPACE_EVENLY
or FLEX_ALIGN_SPACE_AROUND
or
FLEX_ALIGN_SPACE_BETWEEN
public int getTrackCrossAlign()