OHOS::UIList
Overview
Related Modules:
Description:
Represents a scrollable list which is used with the adapter AbstractAdapter to implement scrolling, inertial scrolling, automatic alignment, and invoking of a callback when a child view is selected at the preset position as this list scrolls.
You need to override AbstractAdapter to implement functions for setting and saving data, obtaining data quantity, and creating child views. UIList is used when there is a large number of child views with a fixed format. This list automatically reclaims the child views removed out of the current view as it scrolls so that as many as child views can be displayed with a lower memory consumption.
Since:
1.0
Version:
1.0
Summary
Public Member Functions
UIList () |
A constructor used to create a UIList instance in the vertical direction. |
UIList (uint8_t direction) |
A constructor used to create a UIList instance in the specified direction. |
~UIList () |
A destructor used to delete the UIList instance. |
GetViewType () const override |
|
OnDragEvent (const DragEvent &event) override |
|
OnDragEndEvent (const DragEvent &event) override |
|
OnPressEvent (const PressEvent &event) override |
|
SetAdapter (AbstractAdapter adapter) |
Sets the adapter for this list. The content of this list is initialized when the adapter is set. |
MoveChildByOffset (int16_t x, int16_t y) override |
|
Scrolls to change the index of the first row or column of the current view. |
|
ScrollBy (int16_t distance) |
|
SetStartIndex (uint16_t index) |
|
GetStartIndex () const |
Obtains the start index of this list. The default value is 0. |
SetLoopState (bool state) |
Sets the loop state for this list, in which a loop scroll is possible since the top and bottom of the list are connected together. |
GetLoopState () const |
|
SetSelectPosition (uint16_t position) |
Sets the position where a child view is selected as this list scrolls. |
Obtains the child view being selected at the preset position. |
|
SetScrollStateListener (ListScrollListener scrollListener) |
Sets the listener that contains a callback to be invoked when a child view is selected as this list scrolls. |
RefreshList () |
Refreshes this list. The number of child views in the current view is fixed and the positions of those reserved child views as this list scrolls remain unchanged. |
EnableAutoAlign (bool state) |
Sets the automatic alignment state for this list. When a scroll stops, a child view is selected and its position is automatically aligned with the preset position. |
RemoveAll () override |
|
A constructor used to create a UIAbstractScroll instance. |
|
A destructor used to delete the UIAbstractScroll instance. |
|
GetDirection () const |
|
SetScrollBlankSize (uint16_t size) |
|
SetMaxScrollDistance (uint16_t distance) |
Sets the maximum scroll distance after a finger lifts the screen. |
SetReboundSize (uint16_t size) |
Sets the rebound size, which is the distance a knob moves after being released when it reaches the end of a scrollbar. |
GetMaxScrollDistance () const |
Obtains the maximum scroll distance after a finger lifts the screen. |
SetDragFunc (EasingFunc func) |
Sets the easing function that specifies a scroll animation after a finger lifts the screen. |
SetThrowDrag (bool throwDrag) |
Sets whether to continue scrolling after a finger lifts the screen. |
SetDragACCLevel (uint16_t value) |
|
GetDragACCLevel () const |
|
SetSwipeACCLevel (uint16_t value) |
Sets the compensation distance after a finger lifts the screen. |
GetSwipeACCLevel () const |
Obtains the compensation distance after a finger lifts the screen. |
UIViewGroup () |
A default constructor used to create a UIViewGroup instance. |
~UIViewGroup () |
A destructor used to delete the UIViewGroup instance. |
GetViewType () const override |
|
GetTargetView (const Point &point, UIView **last) override |
Obtains the target child view that is visible and can respond to touch events based on given coordinates. |
GetChildrenHead () const |
|
GetChildrenTail () const |
|
SetDisallowIntercept (bool flag) |
Sets whether this view group is intercepted upon touch events. |
GetChildById (const char id) const override |
|
SetAutoSize (bool state) |
Sets whether the size of this view group is adaptive to that of all child views. |
UIView () |
A default constructor used to create an UIView instance. |
UIView (const char id) |
A constructor used to create an UIView instance. |
~UIView () |
A destructor used to delete the UIView instance. |
Called before a view is drawn. This function is used to check whether the parent view of this view needs to be redrawn so as to optimize the drawing process. |
|
OnPostDraw (const Rect &invalidatedArea) |
|
ReMeasure () |
|
Invalidate () |
|
InvalidateRect (const Rect &invalidatedArea) |
|
OnLongPressEvent (const LongPressEvent &event) |
|
OnDragStartEvent (const DragEvent &event) |
|
OnClickEvent (const ClickEvent &event) |
|
OnReleaseEvent (const ReleaseEvent &event) |
|
OnCancelEvent (const CancelEvent &event) |
|
SetOnDragListener (OnDragListener onDragListener) |
|
SetOnClickListener (OnClickListener onClickListener) |
|
SetOnLongPressListener (OnLongPressListener onLongPressListener) |
|
SetOnTouchListener (OnTouchListener onTouchListener) |
|
GetParent () const |
|
SetNextSibling (UIView sibling) |
|
GetNextSibling () const |
|
SetVisible (bool visible) |
|
IsVisible () const |
|
SetTouchable (bool touch) |
|
IsTouchable () const |
|
SetDraggable (bool draggable) |
|
IsDraggable () const |
|
SetDragParentInstead (bool dragParentInstead) |
Sets whether to transfer the drag event to the parent view for processing when the view is being dragged. |
IsDragParentInstead () const |
Obtains whether the view transfers a drag event to the parent view for processing. |
GetRect () const |
Obtains the absolute rectangle area of the view. When the view has deformation such as rotation, the rectangle area is the intersection set of the absolute rectangle area and deformation matrix. |
GetVisibleRect () const |
|
GetMaskedRect () const |
Obtains the valid absolute rectangle area of the view. The valid area refers to the area where the view can be displayed. Generally, the valid area is the same as the visible view area, but they may be different in the grid layout. |
GetOrigRect () const |
|
virtual Rect Obtains the content of the absolute rectangle area of the view. This area excludes padding. |
|
GetRelativeRect () const |
Obtains the rectangular area of the view relative to the parent view, that is, the rectangular area relative to the coordinates of the parent view. |
ResizeVisibleArea (int16_t x, int16_t y, int16_t width, int16_t height) |
Adjusts the size of the visible area. This operation may affect the final display size. |
SetWidth (int16_t width) |
|
GetWidth () |
|
SetHeight (int16_t height) |
|
GetHeight () |
|
Resize (int16_t width, int16_t height) |
|
SetX (int16_t x) |
|
GetX () const |
|
SetY (int16_t y) |
|
GetY () const |
|
SetPosition (int16_t x, int16_t y) |
|
SetPosition (int16_t x, int16_t y, int16_t width, int16_t height) |
|
IsViewGroup () const |
|
SetIntercept (bool isIntercept) |
Sets whether to intercept the drag event. If intercepted, the view does not transfer the drag event to the parent view after local processing. |
SetTransformMap (const TransformMap &transMap) |
|
SetViewId (const char id) |
|
GetViewId () const |
|
SetViewIndex (int16_t index) |
|
GetViewIndex () const |
|
LayoutChildren (bool neeInvalidate=false) |
Lays out all child views according to the preset arrangement mode. |
LayoutCenterOfParent (int16_t xOffSet=0, int16_t yOffset=0) |
|
LayoutLeftOfParent (int16_t offset=0) |
|
LayoutRightOfParent (int16_t offset=0) |
|
LayoutTopOfParent (int16_t offset=0) |
|
LayoutBottomOfParent (int16_t offset=0) |
|
AlignLeftToSibling (const char id, int16_t offset=0) |
|
AlignRightToSibling (const char id, int16_t offset=0) |
|
AlignTopToSibling (const char id, int16_t offset=0) |
|
AlignBottomToSibling (const char id, int16_t offset=0) |
|
AlignHorCenterToSibling (const char id, int16_t offset=0) |
Aligns the view with the center of a sibling view in the x-axis. |
AlignVerCenterToSibling (const char id, int16_t offset=0) |
Aligns the view with the center of a sibling view in the y-axis. |
LayoutLeftToSibling (const char id, int16_t offset=0) |
|
LayoutRightToSibling (const char id, int16_t offset=0) |
|
LayoutTopToSibling (const char id, int16_t offset=0) |
|
LayoutBottomToSibling (const char id, int16_t offset=0) |
|
SetStyle (uint8_t key, int64_t value) |
|
GetStyle (uint8_t key) const |
|
GetStyleConst () const |
const Style & Obtains the view style. This function applies to scenarios where the style does not need to be modified, which saves memory. |
operator new (size_t size) |
|
operator delete (void p) |
Additional Inherited Members
GetAllChildRelativeRect () const |
Obtains the rectangle area of a new view group after being adaptive to the size of all child views. |
Performs operations needed after a child view is added or removed. |
|
Indicates the pointer to the first child view of this view group. |
|
Indicates the pointer to the last child view of this view group. |
|
Specifies whether this view group is intercepted upon touch events. |
|
Specifies whether the size of this view group is adaptive to that of all child views. |