ListGridLayoutManagerpublic class ListLinearLayoutManager extends ListLayoutManager
ListLayoutManager and implements the linear layout of the ListComponent.| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
HORIZONTAL |
Indicates that the components are arranged horizontally in the
ListComponent. |
static int |
INVALID_OFFSET |
Indicates an invalid offset.
|
static int |
VERTICAL |
Indicates that the components are arranged vertically in the
ListComponent. |
| 构造器 | 说明 |
|---|---|
ListLinearLayoutManager() |
Default constructor used to create a
ListLinearLayoutManager object. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
protected void |
createNativePtr() |
|
int |
findFirstCompletelyVisibleComponentPosition() |
Obtains the position of the first completely visible component in the provider.
|
int |
findFirstVisibleComponentPosition() |
Obtains the position of the first visible component in the provider.
|
int |
findLastCompletelyVisibleChildComponentPosition() |
Obtains the position of the last completely visible component in the provider.
|
int |
findLastVisibleChildComponentPosition() |
Obtains the position of the last visible component in the provider.
|
int |
getFirstTimePreloadNum() |
Obtains the number of components to be preloaded.
|
int |
getLayoutOrientation() |
Obtains the layout orientation.
|
boolean |
getLoadFromEnd() |
Checks whether the components need to be loaded from the bottom.
|
float |
getMaxScale() |
Obtains the maximum scale factor.
|
float |
getMinScale() |
Obtains the minimum scale factor.
|
boolean |
getReverseLayoutChild() |
Checks whether the components need to be laid out in the reverse direction.
|
float |
getScaleInterpolator() |
Obtains the interpolator.
|
boolean |
isSmoothScrollbarAllowed() |
Checks whether the smooth scroll bar is enabled.
|
void |
scrollToPositionWithDelta(int position,
int delta) |
Scrolls the
ListComponent to the specified position in the provider based on a given distance. |
void |
setFirstTimePreloadNum(int itemCount) |
Sets the number of components to be preloaded.
|
void |
setLayoutOrientation(int orientation) |
Sets the layout orientation.
|
void |
setLoadFromEnd(boolean loadFromEnd) |
Sets whether to load the components from the bottom.
|
void |
setMaxScale(float maxScale) |
Sets the maximum scale factor.
|
void |
setMinScale(float minScale) |
Sets the minimum scale factor.
|
void |
setReverseLayoutChild(boolean reverseLayout) |
Sets whether to lay out the components in the reverse direction.
|
void |
setScaleInterpolator(float interpolator) |
Sets an interpolator.
|
void |
setSmoothScrollbarAllowed(boolean enabled) |
Sets whether to enable the smooth scroll bar.
|
allowScrollHorizontally, allowScrollVertically, getOrientation, isPreloadWorkerEnabled, isScrollingSmoothly, setOrientation, setPreloadWorkerEnabledpublic static final int HORIZONTAL
ListComponent.public static final int INVALID_OFFSET
public static final int VERTICAL
ListComponent.public ListLinearLayoutManager()
ListLinearLayoutManager object.protected void createNativePtr()
public void setLayoutOrientation(int orientation)
The default orientation is Component.VERTICAL.
orientation - Indicates the layout orientation to set.
The value Component.HORIZONTAL means that the components are arranged
horizontally, and Component.VERTICAL means that they are arranged
horizontally.public int getLayoutOrientation()
Component.HORIZONTAL if the components are arranged horizontally;
returns Component.VERTICAL if they are arranged vertically.public int findFirstVisibleComponentPosition()
ohos.agp.components.ListComponent#LIST_NO_POSITION if
there is no visible component.public int findFirstCompletelyVisibleComponentPosition()
ohos.agp.components.ListComponent#LIST_NO_POSITION if there is no completely visible
component.public int findLastVisibleChildComponentPosition()
ohos.agp.components.ListComponent#LIST_NO_POSITION if there is no visible component.public int findLastCompletelyVisibleChildComponentPosition()
ohos.agp.components.ListComponent#LIST_NO_POSITION if there is no completely visible
component.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.public void setSmoothScrollbarAllowed(boolean enabled)
When child components in the ListComponent have different height values, the scroll bar height does
not change dynamically if the smooth scroll bar is enabled. If the smooth scroll bar is disabled, the scroll bar
height changes dynamically with the height of the child components.
enabled - Specifies whether to enable the smooth scroll bar. The value true means to enable the
smooth scroll bar, and false means the opposite.public boolean isSmoothScrollbarAllowed()
By default, the smooth scroll bar is enabled.
true if the smooth scroll bar is enabled; returns false otherwise.public void setFirstTimePreloadNum(int itemCount)
itemCount - Indicates the number of components.public int getFirstTimePreloadNum()
public void setLoadFromEnd(boolean loadFromEnd)
loadFromEnd - Specifies whether to load the components from the bottom. The value true means to
load them from the bottom, and false means the opposite.public boolean getLoadFromEnd()
true if the components need to be loaded from the bottom; returns false
otherwise.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 setMaxScale(float maxScale)
maxScale - Indicates the maximum scale factor to set.public float getMaxScale()
public void setMinScale(float minScale)
minScale - Indicates the minimum scale factor to set.public float getMinScale()
public void setScaleInterpolator(float interpolator)
interpolator - Indicates the interpolator to set.public float getScaleInterpolator()