public class ListStaggeredGridLayoutManager extends ListLayoutManager
ListLayoutManager and implements the masonry layout of the ListComponent.| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
GAP_HANDLING_MOVE_ITEMS_BETWEEN_SPANS |
Indicates the rule for processing the gap between components in the
ListComponent. |
static int |
GAP_HANDLING_NONE |
Indicates no processing on the gap.
|
static int |
HORIZONTAL |
Indicates that the components are arranged horizontally in the
ListComponent. |
static int |
VERTICAL |
Indicates that the components are arranged vertically in the
ListComponent. |
| 构造器 | 说明 |
|---|---|
ListStaggeredGridLayoutManager() |
Default constructor used to create a
ListStaggeredGridLayoutManager instance. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
protected void |
createNativePtr() |
|
int |
getGapProcessingStrategy() |
Obtains the gap processing strategy of this
ListStaggeredGridLayoutManager instance. |
int |
getLaneCount() |
Obtains the number of lanes in the layout.
|
int |
getLayoutOrientation() |
Obtains the layout orientation.
|
boolean |
getReverseLayoutChild() |
Checks whether the components need to be laid out in the reverse direction.
|
void |
scrollToPositionWithDelta(int position,
int delta) |
Scrolls the
ListComponent to the specified position in the provider based on a given distance. |
int[] |
searchFirstFullyShowItemPositions(int[] into) |
Obtains the position of the first completely visible component in each lane in the provider.
|
int[] |
searchFirstShowItemPositions(int[] into) |
Obtains the position of the first visible component in each lane in the provider.
|
int[] |
searchLastFullyShowItemPositions(int[] into) |
Obtains the position of the last completely visible component in each lane in the provider.
|
int[] |
searchLastShowItemPositions(int[] into) |
Obtains the position of the last visible component in each lane in the provider.
|
void |
setGapProcessingStrategy(int gapProcessingStrategy) |
Sets a gap processing strategy for this
ListStaggeredGridLayoutManager instance. |
void |
setLaneCount(int laneCount) |
Sets the number of lanes for the layout.
|
void |
setLayoutOrientation(int orientation) |
Sets the layout orientation.
|
void |
setReverseLayoutChild(boolean reverseLayout) |
Sets whether to lay out the components in the reverse direction.
|
allowScrollHorizontally, allowScrollVertically, getOrientation, isPreloadWorkerEnabled, isScrollingSmoothly, setOrientation, setPreloadWorkerEnabledpublic static final int GAP_HANDLING_MOVE_ITEMS_BETWEEN_SPANS
ListComponent.
The rule is as follows:
[before]
_BC
DDD
[after]
BCD
DD_public static final int GAP_HANDLING_NONE
public static final int HORIZONTAL
ListComponent.public static final int VERTICAL
ListComponent.public ListStaggeredGridLayoutManager()
ListStaggeredGridLayoutManager instance.public void setGapProcessingStrategy(int gapProcessingStrategy)
ListStaggeredGridLayoutManager instance.gapStrategy - Indicates the gap processing strategy to set, which can be
GAP_HANDLING_MOVE_ITEMS_BETWEEN_SPANS or GAP_HANDLING_NONE.public int getGapProcessingStrategy()
ListStaggeredGridLayoutManager instance.public int[] searchLastShowItemPositions(int[] into)
into - Indicates the array for storing the positions. If this parameter is set to null, the
ListLayoutManager will create an array.public int[] searchLastFullyShowItemPositions(int[] into)
into - Indicates the array for storing the positions. If this parameter is set to null, the
ListLayoutManager will create an array.public int[] searchFirstShowItemPositions(int[] into)
into - Indicates the array for storing the positions. If this parameter is set to null, the
ListLayoutManager will create an array.public int[] searchFirstFullyShowItemPositions(int[] into)
into - Indicates the array for storing the positions. If this parameter is set to null, the
ListLayoutManager will create an array.public void setLaneCount(int laneCount)
laneCount - Indicates the number of lanes to set.public int getLaneCount()
public void setReverseLayoutChild(boolean reverseLayout)
reverseLayout - Specifies whether to lay out the components in the reverse direction. The value
true means to lay out the components in the reverse direction, and false means the
opposite.public boolean getReverseLayoutChild()
true if the components need to be laid out in the reverse direction; returns
false otherwise.public void setLayoutOrientation(int orientation)
orientation - Indicates the layout orientation to set, which can be HORIZONTAL or
VERTICAL.public int getLayoutOrientation()
HORIZONTAL or VERTICAL.public void scrollToPositionWithDelta(int position,
int delta)
ListComponent to the specified position in the provider based on a given distance.position - Indicates the position to scroll to.delta - Indicates the distance (in pixels) between the component's start edge and the start edge of the
ListComponent.protected void createNativePtr()