ComponentParentpublic class ListComponent extends ComponentContainer
| 限定符和类型 | 类 | 说明 |
|---|---|---|
static interface |
ListComponent.BounceBackListener |
Implements listening for changes in the rebound status, including rebound start, rebound in progress, and
rebound end.
|
static interface |
ListComponent.CachePolicyListener |
Implements listening for adding components to the
ListComponentPool. |
static class |
ListComponent.ListLayoutConfig |
Inherits from
ComponentContainer.LayoutConfig and provides methods to enable a component in the
ListComponent to access the corresponding ComponentOwner. |
static interface |
ListComponent.OnComponentBoundStatusChangeListener |
Implements listening for status changes of the
ListComponent. |
static class |
ListComponent.OnFlingListener |
Implements listening for a fling.
|
static class |
ListComponent.ReboundEffectParams |
Provides parameters to implement the rebound effect.
|
Component.BindStateChangedListener, Component.CanAcceptScrollListener, Component.ClickedListener, Component.ComponentStateChangedListener, Component.ContourRefreshedListener, Component.DefSpeechEventListener, Component.DoubleClickedListener, Component.DragFeedbackProvider, Component.DraggedListener, Component.DrawTask, Component.EditEventListener, Component.EstimateSizeListener, Component.EstimateSpec, Component.FadeEffectEnum, Component.FocusChangedListener, Component.ForwardHoverListener, Component.ForwardTouchListener, Component.GestureType, Component.HoverEventListener, Component.KeyEventListener, Component.LayoutDirection, Component.LayoutRefreshedListener, Component.LongClickedListener, Component.MeasureSpec, Component.MouseEventListener, Component.MousePointerStyleListener, Component.OnDragListener, Component.RotationEventListener, Component.ScaledListener, Component.ScrolledListener, Component.ShadowDevice, Component.ShadowMode, Component.ShadowSize, Component.SpeechEventListener, Component.TouchEventListener, Component.UnconsumedKeyEventListener, Component.VoiceEventComponentContainer.ArrangeListener, ComponentContainer.LayoutConfig| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
HORIZONTAL |
Indicates that the components are arranged horizontally in the
ListComponent. |
static long |
INVALID_ID |
Indicates an invalid component ID in the
ListComponent. |
static int |
INVALID_POSITION |
Indicates an invalid component position in the
ListComponent. |
static int |
INVALID_TYPE |
Indicates an invalid component type in the
ListComponent. |
static int |
ITEM_TYPE_NO_SCALE_MASK |
Indicates that no scale will be used.
|
static int |
ITEM_TYPE_NO_STICK_MASK |
Indicates that no stick will be used.
|
static int |
LIST_SCROLL_STATE_DRAGGING |
Indicates that the
ListComponent is being dragged. |
static int |
LIST_SCROLL_STATE_IDLE |
Indicates that the
ListComponent is in the idle state. |
static int |
LIST_SCROLL_STATE_SETTLING |
Indicates that the
ListComponent is being swiped. |
static int |
UNDEFINED_DURATION |
Indicates that the scroll duration is not defined.
|
static int |
VERTICAL |
Indicates that the components are arranged vertically in the
ListComponent. |
ACCESSIBILITY_ADAPTABLE, ACCESSIBILITY_DISABLE, ACCESSIBILITY_ENABLE, AXIS_X, AXIS_Y, CONTOUR_BACKGROUND, CONTOUR_BORDER, CONTOUR_PADDING_BORDER, DEFAULT_SCALE, DRAG_DOWN, DRAG_HORIZONTAL, DRAG_HORIZONTAL_VERTICAL, DRAG_LEFT, DRAG_RIGHT, DRAG_UP, DRAG_VERTICAL, EVENT_TYPE_COMPONENT_ACCESSIBILITY_FOCUSED, EVENT_TYPE_COMPONENT_ACCESSIBILITY_FOCUSED_CLEAR, EVENT_TYPE_COMPONENT_CLICKED, EVENT_TYPE_COMPONENT_FOCUSED, EVENT_TYPE_COMPONENT_LONG_CLICKED, EVENT_TYPE_COMPONENT_SCROLLED, EVENT_TYPE_COMPONENT_SELECTED, EVENT_TYPE_COMPONENT_TEXT_UPDATE, EVENT_TYPE_NOTICE, EVENT_TYPE_NOTIFICATION_STATE_UPDATE, EVENT_TYPE_TOAST_SHOW, EVENT_TYPE_WINDOW_STATE_UPDATE, FOCUS_ADAPTABLE, FOCUS_DISABLE, FOCUS_ENABLE, FOCUS_NEXT, FOCUS_PREVIOUS, FOCUS_SIDE_BOTTOM, FOCUS_SIDE_LEFT, FOCUS_SIDE_RIGHT, FOCUS_SIDE_TOP, HIDE, ID_DEFAULT, INHERITED_MODE, INVISIBLE, mBackgroundElement, mCanvasForTaskOverContent, mCanvasForTaskUnderContent, mComponentParent, mContext, mDrawTaskOverContent, mDrawTaskUnderContent, mEstimateSizeListener, mForegroundElement, mForwardHoverListener, mHoverEventListener, mKeyEventListener, mMouseEventListener, mPosition, mRotationEventListener, mShadowElement, mUnconsumedKeyEventListener, OVAL_MODE, OVAL_SCROLL_BAR_MODE, POSITION_X_INDEX, POSITION_Y_INDEX, RECT_MODE, RECT_SCROLL_BAR_MODE, SCROLL_AUTO_STAGE, SCROLL_IDLE_STAGE, SCROLL_NORMAL_STAGE, UNSPECIFIED_SCROLL_BAR_MODE, VISIBLEFOCUS_CHILDREN_FIRST, FOCUS_CHILDREN_HIDE, FOCUS_PARENT_FIRST, mArrangeListener| 构造器 | 说明 |
|---|---|
ListComponent(Context context) |
A constructor used to create a
ListComponent instance based on the default attribute set and style. |
ListComponent(Context context,
AttrSet attrSet) |
A constructor used to create a
ListComponent instance based on the specified attribute set and the
default style. |
ListComponent(Context context,
AttrSet attrSet,
String styleName) |
A constructor used to create a
ListComponent instance based on the specified attribute set and style. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
addBounceBackListener(ListComponent.BounceBackListener listener) |
Adds a listener for rebound state changes.
|
void |
addCachePolicyListener(ListComponent.CachePolicyListener listener) |
Adds a listener for the cache policy.
|
void |
addComponent(Component childComponent) |
Adds a component to the end of the queue by invoking
ComponentContainer.addComponent(ohos.agp.components.Component,int index) internally. |
void |
addComponent(Component childComponent,
int index) |
Adds a component to the specified position.
|
void |
addComponent(Component childComponent,
int width,
int height) |
Adds a component and sets its width and height.
|
void |
addComponent(Component childComponent,
int index,
ComponentContainer.LayoutConfig layoutConfig) |
Adds a component and sets its layout parameters and location.
|
void |
addComponent(Component childComponent,
ComponentContainer.LayoutConfig layoutConfig) |
Adds a component and sets its layout parameters.
|
void |
addListAdornment(ListAdornment adorn) |
Adds a
ListAdornment object at the end of this ListComponent. |
void |
addListAdornment(ListAdornment adorn,
int index) |
Adds a
ListAdornment object to the specified position of this ListComponent. |
void |
addOnComponentBoundStatusChangeListener(ListComponent.OnComponentBoundStatusChangeListener listener) |
Adds a listener that will be notified when a child component is bound to or unbound from this
ListComponent. |
void |
alignChildComponentXCoordinate(int dx) |
Sets a horizontal pixel offset for the boundaries of all child components in this
ListComponent. |
void |
alignChildComponentYCoordinate(int dy) |
Sets a vertical pixel offset for the boundaries of all child components in this
ListComponent. |
void |
clearBounceBackListeners() |
Removes all listeners for rebound state changes.
|
void |
clearOnComponentBoundStatusChangeListener() |
Removes all listeners that were notified when a child component is bound to or unbound from this
ListComponent. |
protected void |
createNativePtr() |
|
boolean |
fling(int speedX,
int speedY) |
Triggers a fling for this
ListComponent with the initial velocity in the horizontal and vertical
directions. |
void |
getAdornedBoundryIncludeMargin(Component component,
Rect outBounds) |
Obtains the boundary of a child component, including its adornments and margins.
|
long |
getChildComponentId(Component child) |
Obtains the ID of a child component in this
ListComponent. |
ComponentOwner |
getChildComponentOwner(Component child) |
Obtains the
ComponentOwner of a child component. |
int |
getChildCount() |
Obtains the quantity of child components.
|
int |
getChildLayoutPosition(Component component) |
Obtains the position of a child component in the provider after the latest layout calculation.
|
int |
getChildProviderPosition(Component component) |
Obtains the position of a child component in the provider.
|
Component |
getComponentAt(int position) |
Obtains a child component using an index.
|
ComponentOwner |
getComponentOwnerById(long id) |
Obtains the
ComponentOwner based on the child component ID. |
ItemAnimation |
getItemAnimation() |
Obtains the
ItemAnimation object, which is used to process the animations that take place when the
provider changes. |
ListAdornment |
getListAdornmentAt(int index) |
Obtains the
ListAdornment object with a given index of this ListComponent. |
int |
getListAdornmentCount() |
Obtains the number of
ListAdornment objects in this ListComponent. |
ListComponentPool |
getListCachedPool() |
Obtains the reclaim pool of this
ListComponent. |
ListLayoutManager |
getListLayoutManager() |
Obtains the
ListLayoutManager object used by this ListComponent. |
int |
getMaxFlingSpeed() |
Obtains the maximum velocity to trigger a fling.
|
int |
getMinFlingSpeed() |
Obtains the minimum velocity to trigger a fling.
|
Provider |
getProvider() |
Obtains the provider of this
ListComponent. |
boolean |
getReboundEffect() |
Checks whether the rebound effect is enabled.
|
ListComponent.ReboundEffectParams |
getReboundEffectParams() |
Obtains the rebound effect parameters in the form of a
ReboundEffectParams object. |
boolean |
getRecoverfocusAfterRefresh() |
Checks whether this
ListComponent keeps the same child component focused after a layout calculation. |
boolean |
hasIncomingProviderRefresh() |
Checks whether there is an update to the provider that has not been applied to the layout.
|
boolean |
isCalculatingLayout() |
Checks whether this
ListComponent is calculating the layout. |
boolean |
isListAnimating() |
Checks whether this
ListComponent is running animations. |
boolean |
isPostponeLayout() |
Checks whether layout requests of this
ListComponent are postponed. |
boolean |
isScrollingSmoothly() |
Checks whether this
ListComponent is being smoothly scrolled. |
boolean |
isSizeFixed() |
Checks whether the provider of this
ListComponent has a fixed size. |
void |
onBounceBackChange(int xOverScrolled,
int yOverScrolled) |
Called when the rebound is in progress.
|
void |
onBounceBackEnd(int xOverScrolled,
int yOverScrolled) |
Called when the rebound ends.
|
void |
onBounceBackStart(int xOverScrolled,
int yOverScrolled) |
Called when the rebound starts.
|
void |
onComponentBoundToWindow(Component child) |
Called when a child component is bound to this
ListComponent. |
void |
onComponentUnboundFromWindow(Component child) |
Called when a child component is unbound from this
ListComponent. |
void |
postLayout() |
Requests rearranging the layout of the component.
|
void |
postponeLayout(boolean isPostponeLayout) |
Sets whether to postpone layout requests of this
ListComponent. |
void |
refreshListAdornments() |
Proactively refreshes the
ListAdornment objects in this ListComponent. |
void |
removeAllComponents() |
Clears all components managed by
ComponentContainer. |
void |
removeBounceBackListener(ListComponent.BounceBackListener listener) |
Removes a listener for rebound state changes.
|
void |
removeCachePolicyListener(ListComponent.CachePolicyListener listener) |
Removes a listener for the cache policy.
|
void |
removeComponent(Component component) |
Removes a child component from the parent component.
|
void |
removeComponentAt(int index) |
Removes the component from a specified position in the component list.
|
void |
removeComponentById(int id) |
Removes a component based on its ID.
|
void |
removeComponents(int start,
int count) |
Removes all components from specified positions in a component list.
|
void |
removeListAdornment(ListAdornment decor) |
Removes a given
ListAdornment object from this ListComponent. |
void |
removeListAdornmentAt(int index) |
Removes the
ListAdornment object with a given index of this ListComponent. |
void |
removeOnComponentBoundStatusChangeListener(ListComponent.OnComponentBoundStatusChangeListener listener) |
Removes a listener that was notified when a child component is bound to or unbound from this
ListComponent. |
void |
scrollBy(int x,
int y) |
Scrolls this
ListComponent by a relative distance. |
void |
scrollByInSmoothMode(int dx,
int dy) |
Smoothly scrolls this
ListComponent by a relative distance. |
void |
scrollByInSmoothMode(int dx,
int dy,
Animator.TimelineCurve curve) |
Smoothly scrolls this
ListComponent by a relative distance based on a scrolling curve. |
void |
scrollTo(int x,
int y) |
Scrolls this
ListComponent to the specified horizontal and vertical coordinates. |
void |
scrollToPosition(int position) |
Scrolls this
ListComponent to a specific position. |
void |
scrollToPositionInSmoothMode(int position) |
Smoothly scrolls this
ListComponent to a specific position. |
Component |
searchChildComponentBelowPoint(float x,
float y) |
Searches for a child component based on the coordinates on the screen.
|
ComponentOwner |
searchComponentOwnerForLayoutPosition(int position) |
Searches for a
ComponentOwner in the latest layout based on the specified position. |
ComponentOwner |
searchComponentOwnerForProviderPosition(int position) |
Searches for the
ComponentOwner in the provider based on the specified position. |
Component |
searchParentComponentOfChild(Component component) |
Searches for the child component that contains the specified component (grandchild component).
|
ComponentOwner |
searchParentComponentOwnerOfChild(Component component) |
Searches for the
ComponentOwner of the child component that contains the specified component (grandchild
component). |
void |
setIsFixedSize(boolean isFixedSize) |
Sets whether the provider of this
ListComponent has a fixed size. |
void |
setItemAnimation(ItemAnimation animation) |
Sets an
ItemAnimation object for processing the animations that take place when the provider changes. |
void |
setLayoutManager(LayoutManager layoutManager) |
Sets a
LayoutManager instance, which is used to lay out relevant child components. |
void |
setListCachedPool(ListComponentPool pool) |
Sets a reclaim pool for this
ListComponent. |
void |
setListLayoutManager(ListLayoutManager layoutManager) |
Sets a
ListLayoutManager object for this ListComponent. |
void |
setOnFlingListener(ListComponent.OnFlingListener listener) |
Sets a
OnFlingListener for this ListComponent. |
void |
setProvider(Provider provider) |
Sets a provider for this
ListComponent. |
void |
setReboundEffect(boolean enabled) |
Sets whether to enable the rebound effect.
|
void |
setReboundEffectParams(int overscrollPercent,
float overscrollRate,
int remainVisiblePercent) |
Sets rebound effect parameters.
|
void |
setReboundEffectParams(ListComponent.ReboundEffectParams reboundEffectParams) |
Sets rebound effect parameters using a
ReboundEffectParams object. |
void |
setRecoverfocusAfterRefresh(boolean recoverFocusAfterRefresh) |
Sets whether this
ListComponent keeps the same child component focused after a layout calculation. |
void |
setRequestedCacheMax(int count) |
Sets the maximum number of off-screen components that can be cached.
|
void |
stopScroll() |
Stops the current scrolling.
|
void |
switchProvider(Provider provider,
boolean deleteAndReuseComponents) |
Replaces the provider of this
ListComponent with a new one. |
ComponentContainer.LayoutConfig |
verifyLayoutConfig(ComponentContainer.LayoutConfig config) |
Customizes a
ListLayoutConfig object so that the ComponentOwner has the metadata of the
ListLayoutManager. |
addDrawTask, addDrawTask, addScrolledListener, announceAccessibility, arrange, bindCornerMark, callOnClick, canScroll, clearFocus, createAnimatorProperty, disableFadeEffect, draw, enableCornerMark, enableFadeEffect, enableSaveState, enableScrollBar, estimateSize, executeDoubleClick, executeLongClick, findFocus, findNextFocusableComponent, findRequestNextFocus, getAccessibility, getAccessibilityDescription, getAlpha, getAltitude, getBackgroundElement, getBaseLine, getBottom, getBoundaryFadeEffectBottomRate, getBoundaryFadeEffectLeftRate, getBoundaryFadeEffectRightRate, getBoundaryFadeEffectTopRate, getCenterZoomFactor, getCentralScrollMode, getClickedListener, getClipEnabled, getComponentDescription, getComponentMinSize, getComponentParent, getComponentPosition, getComponentSize, getComponentStateChangedListener, getComponentTreeObserver, getContentEnable, getContentPosition, getContentPositionX, getContentPositionY, getContext, getContour, getContourRefreshedListener, getCornerMark, getDragAcceptAngle, getDraggedListener, getEditEventListener, getEstimatedHeight, getEstimatedWidth, getFadeEffectBoundaryWidth, getFadeEffectColor, getFocusable, getFocusBorderEnable, getFocusBorderPadding, getFocusBorderRadius, getFocusBorderWidth, getForegroundElement, getForegroundGravity, getForwardHoverListener, getForwardTouchListener, getGesturePriority, getHeight, getHorizontalPadding, getHorizontalPosition, getHoverEventListener, getId, getKeyEventListener, getLayoutConfig, getLayoutDirection, getLayoutDirectionResolved, getLayoutRefreshedListener, getLeft, getLocationOnScreen, getMarginBottom, getMarginLeft, getMarginRight, getMargins, getMarginsLeftAndRight, getMarginsTopAndBottom, getMarginTop, getMatrix, getMinHeight, getMinWidth, getMode, getModeResolved, getMouseEventListener, getMousePointerStyleListener, getName, getPadding, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getPivot, getPivotX, getPivotY, getResourceManager, getRight, getRotation, getRotationEventListener, getRotationSensitivity, getScale, getScaledListener, getScaleX, getScaleY, getScrollbarBackgroundColor, getScrollbarColor, getScrollbarFadingDelay, getScrollbarFadingDuration, getScrollBarMode, getScrollbarRadius, getScrollbarRoundRect, getScrollbarStartAngle, getScrollbarSweepAngle, getScrollbarThickness, getScrollState, getScrollValue, getSelfVisibleRect, getShadowColor, getSpeechEventListener, getTag, getTop, getTouchEventListener, getTransitionSymbol, getTranslation, getTranslationX, getTranslationY, getTranslationZ, getUserNextFocus, getVerticalPadding, getVerticalPosition, getVisibility, getVisibleRectOnScreen, getWidth, getWindowVisibleRect, hasFocus, hasFocusedEffect, hasOverlaps, hideFocusBorder, invalidate, isBoundaryFadeEffectEnable, isBoundToWindow, isClickable, isClipToContourEnabled, isComponentDisplayed, isEnabled, isFadeEffected, isFocusable, isFocused, isIdentityMatrix, isLongClickOn, isPressed, isRtl, isSaveStateEnabled, isScrollbarFadingOn, isScrollBarOn, isScrollbarOverlapEnabled, isSelected, isSoundEnable, isTouchFocusable, isVibrationEffectEnabled, notifyAccessibility, onAttributeConfigChanged, onRestoreState, onRtlChanged, onSaveState, performScale, playSound, refreshContour, release, removeBindStateChangedListener, removeScrolledListener, requestFocus, requestForceForwardTouchEvent, restoreComponentTreeState, saveComponentTreeState, setAccessibility, setAccessibilityDescription, setAlpha, setAltitude, setBackground, setBindStateChangedListener, setBottom, setBoundaryFadeEffectEnable, setCanAcceptScrollListener, setCenterZoomFactor, setCentralScrollMode, setClickable, setClickedListener, setClipEnabled, setClipToContourEnabled, setComponentDescription, setComponentMinSize, setComponentPosition, setComponentPosition, setComponentSize, setComponentStateChangedListener, setContentEnable, setContentPosition, setContentPositionX, setContentPositionY, setContour, setContourRefreshedListener, setDoubleClickedListener, setDragAcceptAngle, setDraggedListener, setEditEventListener, setEnabled, setEstimatedSize, setEstimateSizeListener, setFadeEffectBoundaryWidth, setFadeEffectColor, setFocusable, setFocusBorderEnable, setFocusBorderPadding, setFocusBorderRadius, setFocusBorderRadius, setFocusBorderWidth, setFocusChangedListener, setFocusedEffect, setForeground, setForegroundGravity, setForwardHoverListener, setForwardTouchListener, setGesturePriority, setHeight, setHorizontalPadding, setHorizontalPosition, setHoverEventListener, setId, setKeyEventListener, setLayoutConfig, setLayoutDirection, setLayoutRefreshedListener, setLeft, setLongClickable, setLongClickedListener, setMarginBottom, setMarginLeft, setMarginRight, setMarginsLeftAndRight, setMarginsTopAndBottom, setMarginTop, setMinHeight, setMinWidth, setMode, setMouseEventListener, setMousePointerStyleListener, setName, setOnDragListener, setPadding, setPaddingBottom, setPaddingLeft, setPaddingRelative, setPaddingRight, setPaddingTop, setPivot, setPivot, setPivotX, setPivotY, setPosition, setPositionX, setPositionY, setPressState, setRight, setRotation, setRotationEventListener, setRotationSensitivity, setScale, setScaledListener, setScaleX, setScaleY, setScrollbarBackgroundColor, setScrollbarColor, setScrollbarFadingDelay, setScrollbarFadingDuration, setScrollbarFadingEnabled, setScrollBarMode, setScrollbarOverlapEnabled, setScrollbarRadius, setScrollbarRoundRect, setScrollbarStartAngle, setScrollbarSweepAngle, setScrollbarThickness, setScrolledListener, setSelected, setShadowColor, setShadowStyle, setSoundEnable, setSpeechEventListener, setTag, setTop, setTouchEventListener, setTouchFocusable, setTransitionSymbol, setTranslation, setTranslationX, setTranslationY, setTranslationZ, setUnconsumedKeyEventListener, setUserNextFocus, setVerticalPadding, setVerticalPosition, setVibrationEffectEnabled, setVisibility, setWidth, showFocusBorder, simulateClick, simulateDrag, startDragAndDrop, subscribeVoiceEvents, unsubscribeVoiceEventscreateLayoutConfig, dispatchRestoreState, dispatchSaveState, findComponentById, findComponentHolderById, getAutoLayout, getChildIndex, getComponentTransition, getFocusOrder, getLayoutManager, informConfigurationChanged, isClipToChildBoundsEnabled, isClipToPaddingBoundsEnabled, isTouchEventSplitable, moveChildToFront, onDrag, setArrangeListener, setAutoLayout, setAutoLayout, setClipToChildBoundsEnabled, setClipToPaddingBoundsEnabled, setComponentTransition, setFocusOrder, setTouchEventSplitablegetComponentParentpublic static final int HORIZONTAL
ListComponent.public static final long INVALID_ID
ListComponent.public static final int INVALID_POSITION
ListComponent.public static final int INVALID_TYPE
ListComponent.public static final int ITEM_TYPE_NO_SCALE_MASK
#getItemViewType(),
常量字段值public static final int ITEM_TYPE_NO_STICK_MASK
#getItemViewType(),
常量字段值public static final int LIST_SCROLL_STATE_DRAGGING
ListComponent is being dragged.Component.getScrollState(),
常量字段值public static final int LIST_SCROLL_STATE_IDLE
ListComponent is in the idle state.Component.getScrollState(),
常量字段值public static final int LIST_SCROLL_STATE_SETTLING
ListComponent is being swiped.Component.getScrollState(),
常量字段值public static final int UNDEFINED_DURATION
public static final int VERTICAL
ListComponent.public ListComponent(Context context)
ListComponent instance based on the default attribute set and style.context - Indicates the application context.public ListComponent(Context context, AttrSet attrSet)
ListComponent instance based on the specified attribute set and the
default style.context - Indicates the application context.attrSet - Indicates the attribute set to use.public ListComponent(Context context, AttrSet attrSet, String styleName)
ListComponent instance based on the specified attribute set and style.context - Indicates the application context.attrSet - Indicates the attribute set to use.styleName - Indicates the name of the style to use.protected void createNativePtr()
public void addComponent(Component childComponent)
ComponentContainer.addComponent(ohos.agp.components.Component,int index) internally.addComponent 在类中 ComponentContainerchildComponent - Indicates the child component to add.UnsupportedOperationException - Method is not allowed in ListContainer.public void addComponent(Component childComponent, int width, int height)
addComponent 在类中 ComponentContainerchildComponent - Indicates the child component to add.width - Indicates the width of the child component, in pixels.height - Indicates the height of the child component, in pixels.UnsupportedOperationException - Method is not allowed in ListContainer.public void addComponent(Component childComponent, ComponentContainer.LayoutConfig layoutConfig)
addComponent 在类中 ComponentContainerchildComponent - Indicates the child component to add.layoutConfig - Indicates the layout parameters of the child component.UnsupportedOperationException - Method is not allowed in ListContainer.public void addComponent(Component childComponent, int index, ComponentContainer.LayoutConfig layoutConfig)
addComponent 在类中 ComponentContainerchildComponent - Indicates the child component to add.index - Indicates where to add the child component. The value -1 means to add the child
component to the end of the queue.layoutConfig - Indicates the layout parameters of the child component.UnsupportedOperationException - Method is not allowed in ListContainer.public void addComponent(Component childComponent, int index)
If no layout parameters are set for this child component, the default layout parameters of
ComponentContainer are used.
addComponent 在类中 ComponentContainerchildComponent - Indicates the child component to add.index - Indicates where to add the child component. The value -1 means to add the
component to the end. If a number greater than the value of getChildCount() is
provided, a runtime exception is returned.UnsupportedOperationException - Method is not allowed in ListContainer.public void removeComponent(Component component)
removeComponent 在接口中 ComponentParentremoveComponent 在类中 ComponentContainercomponent - Indicates the child component to remove.UnsupportedOperationException - Method is not allowed in ListContainer.public void removeComponentAt(int index)
removeComponentAt 在接口中 ComponentParentremoveComponentAt 在类中 ComponentContainerindex - Indicates the position index of the component to remove.UnsupportedOperationException - Method is not allowed in ListContainer.public void removeComponentById(int id)
removeComponentById 在类中 ComponentContainerid - Indicates the component ID.UnsupportedOperationException - Method is not allowed in ListContainer.public void removeComponents(int start,
int count)
removeComponents 在接口中 ComponentParentremoveComponents 在类中 ComponentContainerstart - Indicates the position index of the first removed component.count - Indicates the quantity of components to remove.UnsupportedOperationException - Method is not allowed in ListContainer.public void removeAllComponents()
ComponentContainer.removeAllComponents 在类中 ComponentContainerUnsupportedOperationException - Method is not allowed in ListContainer.public Component getComponentAt(int position)
ComponentContainer
ComponentContainer uses an internal list to store child component information. You can obtain specified
child components
using the index.
getComponentAt 在类中 ComponentContainerposition - Indicates the index of child components.public int getChildCount()
ComponentContainergetChildCount 在类中 ComponentContainerpublic void onComponentBoundToWindow(Component child)
ListComponent.child - Indicates the child component bound to the ListComponent.public void onComponentUnboundFromWindow(Component child)
ListComponent.child - Indicates the child component unbound from the ListComponent.public void setListLayoutManager(ListLayoutManager layoutManager)
ListLayoutManager object for this ListComponent.layoutManager - Indicates the ListLayoutManager object to set.public ListLayoutManager getListLayoutManager()
ListLayoutManager object used by this ListComponent.ListLayoutManager object.setListLayoutManager(ListLayoutManager)public void setProvider(Provider provider)
ListComponent.provider - Indicates the provider to set.public Provider getProvider()
ListComponent.null if no provider is set.setProvider(Provider)public void setIsFixedSize(boolean isFixedSize)
ListComponent has a fixed size. This method can be used to improve layout performance when the provider changes.
isFixedSize - Specifies whether the provider has a fixed size. The value true means that the
provider has a fixed size, indicating that the provider changes do not affect the size of the
ListComponent; the value false means the opposite.public boolean isSizeFixed()
ListComponent has a fixed size.true if the provider has a fixed size; returns false otherwise.public boolean isCalculatingLayout()
ListComponent is calculating the layout.true if the ListComponent is calculating the layout; returns false
otherwise.public void alignChildComponentYCoordinate(int dy)
ListComponent.dy - Indicates the vertical pixel offset to set.public void alignChildComponentXCoordinate(int dx)
ListComponent.dx - Indicates the horizontal pixel offset to set.public void switchProvider(Provider provider, boolean deleteAndReuseComponents)
ListComponent with a new one.
Before replacing a provider, you can use the deleteAndReuseComponents parameter to determine whether
to reclaim all the child components in the ListComponent.
provider - Indicates the new provider. The value null means that no provider will be set.deleteAndReuseComponents - Specifies whether to reclaim all the child components in the
ListComponent. The value true means to reclaim all the child components, and
false means the opposite.public void addOnComponentBoundStatusChangeListener(ListComponent.OnComponentBoundStatusChangeListener listener)
ListComponent.listener - Indicates the listener to add.public void clearOnComponentBoundStatusChangeListener()
ListComponent.public void removeOnComponentBoundStatusChangeListener(ListComponent.OnComponentBoundStatusChangeListener listener)
ListComponent.listener - Indicates the listener to remove.public int getChildProviderPosition(Component component)
component - Indicates the child component.-1 if component is
null.public int getChildLayoutPosition(Component component)
component - Indicates the child component.-1 if component is
null.public long getChildComponentId(Component child)
ListComponent.child - Indicates the child component.-1 if child is null.public ComponentOwner searchComponentOwnerForLayoutPosition(int position)
ComponentOwner in the latest layout based on the specified position.position - Indicates the position of the component in the provider.ComponentOwner if obtained; returns null otherwise.public ComponentOwner searchComponentOwnerForProviderPosition(int position)
ComponentOwner in the provider based on the specified position.position - Indicates the position of the component in the provider.ComponentOwner if obtained; returns null otherwise.public ComponentOwner getComponentOwnerById(long id)
ComponentOwner based on the child component ID.id - Indicates the child component ID.ComponentOwner if obtained; returns null otherwise.public Component searchChildComponentBelowPoint(float x, float y)
x - Indicates the horizontal coordinate, in pixels.y - Indicates the vertical coordinate, in pixels.null otherwise.public ComponentOwner getChildComponentOwner(Component child)
ComponentOwner of a child component.child - Indicates the child component to query.ComponentOwner if obtained;
returns null if child is null,
if no ComponentOwner is obtained,
or if an exception occurs.public Component searchParentComponentOfChild(Component component)
component - Indicates the grandchild component.null otherwise.public ComponentOwner searchParentComponentOwnerOfChild(Component component)
ComponentOwner of the child component that contains the specified component (grandchild
component).component - Indicates the grandchild component.ComponentOwner if obtained; returns null otherwise.public boolean hasIncomingProviderRefresh()
true if there is a provider update that is not applied to the layout; returns
false if the layout is the latest or if an exception occurs.public void addCachePolicyListener(ListComponent.CachePolicyListener listener)
listener - Indicates the listener to add.public void removeCachePolicyListener(ListComponent.CachePolicyListener listener)
listener - Indicates the listener to remove.public ListComponentPool getListCachedPool()
ListComponent.
If no reclaim pool is set for this ListComponent, this method creates one and returns it.
public void setListCachedPool(ListComponentPool pool)
ListComponent.pool - Indicates the reclaim pool to set. If this parameter is null, a new pool is created and
used.public void setRequestedCacheMax(int count)
count - Indicates the number of off-screen components to set.public void scrollToPositionInSmoothMode(int position)
ListComponent to a specific position.position - Indicates the position to scroll to.public boolean fling(int speedX,
int speedY)
ListComponent with the initial velocity in the horizontal and vertical
directions.speedX - Indicates the initial velocity in the horizontal direction, in pixels per second.speedY - Indicates the initial velocity in the vertical direction, in pixels per second.true if the fling starts;
returns false if the fling fails to start because of a low initial velocity,
if the LayoutManager does not support a fling,
or if an exception occurs.public int getMinFlingSpeed()
public int getMaxFlingSpeed()
public void scrollToPosition(int position)
ListComponent to a specific position.position - Indicates the position to scroll to.public void scrollTo(int x,
int y)
ListComponent to the specified horizontal and vertical coordinates.public void scrollBy(int x,
int y)
ListComponent by a relative distance.public void stopScroll()
public void scrollByInSmoothMode(int dx,
int dy)
ListComponent by a relative distance.dx - Indicates the horizontal distance to scroll by, in pixels.dy - Indicates the vertical distance to scroll by, in pixels.public void scrollByInSmoothMode(int dx,
int dy,
Animator.TimelineCurve curve)
ListComponent by a relative distance based on a scrolling curve.dx - Indicates the horizontal distance to scroll by, in pixels.dy - Indicates the vertical distance to scroll by, in pixels.curve - Indicates the scrolling curve.public void setItemAnimation(ItemAnimation animation)
ItemAnimation object for processing the animations that take place when the provider changes.
If this method is not called, the DefaultItemAnimation will be used.
animation - Indicates the ItemAnimation object to set. If this parameter is null, no
animation takes place when a child component in the ListComponent is changed.public ItemAnimation getItemAnimation()
ItemAnimation object, which is used to process the animations that take place when the
provider changes.ItemAnimation object if obtained; returns null if no object has been
assigned.public boolean isListAnimating()
ListComponent is running animations.true if the ListComponent is running animations; returns false
otherwise.public void addListAdornment(ListAdornment adorn, int index)
ListAdornment object to the specified position of this ListComponent.adorn - Indicates the ListAdornment object to add.index - Indicates the position at which the ListAdornment object will be added. If this parameter
is set to a negative value, the ListAdornment will be added at the end of the
ListComponent.public void addListAdornment(ListAdornment adorn)
ListAdornment object at the end of this ListComponent.adorn - Indicates the ListAdornment object to add.public ListAdornment getListAdornmentAt(int index)
ListAdornment object with a given index of this ListComponent.index - Indicates the index of the ListAdornment object to obtain.ListAdornment object.public int getListAdornmentCount()
ListAdornment objects in this ListComponent.ListAdornment objects.public void removeListAdornmentAt(int index)
ListAdornment object with a given index of this ListComponent.index - Indicates the index of the ListAdornment object to remove.public void removeListAdornment(ListAdornment decor)
ListAdornment object from this ListComponent.adorn - Indicates the ListAdornment object to remove.public void refreshListAdornments()
ListAdornment objects in this ListComponent.public void getAdornedBoundryIncludeMargin(Component component, Rect outBounds)
component - Indicates the child component.outBounds - Indicates the rectangle used to hold the boundary.public void postponeLayout(boolean isPostponeLayout)
ListComponent.
If the layout requests are postponed, layout and scrolling will be disabled for the ListComponent.
isPostponeLayout - Specifies whether to postpone layout requests. The value true means to postpone
the layout requests, and false means the opposite.public boolean isPostponeLayout()
ListComponent are postponed.true if the layout requests are postponed; returns false otherwise.public void setOnFlingListener(ListComponent.OnFlingListener listener)
OnFlingListener for this ListComponent. This listener is used to observe fling events of
the ListComponent.listener - Indicates the OnFlingListener to set.public void setRecoverfocusAfterRefresh(boolean recoverFocusAfterRefresh)
ListComponent keeps the same child component focused after a layout calculation.recoverFocusAfterRefresh - Specifies whether the ListComponent keeps the same child component
focused after a layout calculation. The value true means to keep the same child component
focused, and false means the opposite. The default value is true.public boolean getRecoverfocusAfterRefresh()
ListComponent keeps the same child component focused after a layout calculation.true if the ListComponent keeps the same child component focused after a layout
calculation; returns false otherwise.public void postLayout()
ComponentpostLayout 在接口中 ComponentParentpostLayout 在类中 Componentpublic void setReboundEffect(boolean enabled)
enabled - Specifies whether to enable the rebound effect. The value true means to enable the
rebound effect, and false means the opposite.public boolean getReboundEffect()
true if the rebound effect is enabled; returns false otherwise.public void setReboundEffectParams(int overscrollPercent,
float overscrollRate,
int remainVisiblePercent)
overscrollPercent - Indicates the overscroll percent. The default value is 40.overscrollRate - Indicates the overscroll rate. The default value is 0.6.remainVisiblePercent - Indicates the minimum percent of scrollable content that should remain visible
during overscrolling. The default value is 20.public void setReboundEffectParams(ListComponent.ReboundEffectParams reboundEffectParams)
ReboundEffectParams object.reboundEffectParams - Indicates a ReboundEffectParams object that holds the rebound effect
parameters.getReboundEffectParams(),
setReboundEffectParams(int, float, int)public ListComponent.ReboundEffectParams getReboundEffectParams()
ReboundEffectParams object.ReboundEffectParams object that holds the rebound effect parameters.setReboundEffectParams(ReboundEffectParams),
setReboundEffectParams(int, float, int)public void setLayoutManager(LayoutManager layoutManager)
ComponentContainerLayoutManager instance, which is used to lay out relevant child components.setLayoutManager 在类中 ComponentContainerlayoutManager - Indicates the layout manager to set.public boolean isScrollingSmoothly()
ListComponent is being smoothly scrolled.true if the ListComponent is being smoothly scrolled; returns false
otherwise.public ComponentContainer.LayoutConfig verifyLayoutConfig(ComponentContainer.LayoutConfig config)
ListLayoutConfig object so that the ComponentOwner has the metadata of the
ListLayoutManager.verifyLayoutConfig 在接口中 ComponentParentverifyLayoutConfig 在类中 ComponentContainerconfig - Indicates a group of layout parameters to be converted into a
ComponentContainer.LayoutConfig instance.ComponentContainer.LayoutConfig instance that holds the layout parameters.public void onBounceBackStart(int xOverScrolled,
int yOverScrolled)
xOverScrolled - Indicates the distance moved in the horizontal direction.yOverScrolled - Indicates the distance moved in the vertical direction.public void onBounceBackChange(int xOverScrolled,
int yOverScrolled)
xOverScrolled - Indicates the distance moved in the horizontal direction.yOverScrolled - Indicates the distance moved in the vertical direction.public void onBounceBackEnd(int xOverScrolled,
int yOverScrolled)
xOverScrolled - Indicates the distance moved in the horizontal direction.yOverScrolled - Indicates the distance moved in the vertical direction.public void addBounceBackListener(ListComponent.BounceBackListener listener)
listener - Indicates the listener to add.public void removeBounceBackListener(ListComponent.BounceBackListener listener)
listener - Indicates the listener to remove.public void clearBounceBackListeners()