1 Star 0 Fork 5.3K

笛荡 / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
ohos-uiimageanimatorview.md 84.89 KB
AI 代码解读
一键复制 编辑 原始数据 按行查看 历史
wenjun 提交于 2020-09-08 10:08 . add OpenHarmony 1.0 baseline

OHOS::UIImageAnimatorView

Overview

Related Modules:

Graphic

Description:

Represents an image animator.

Images are switched at a specified interval to form an animator.

Since:

1.0

Version:

1.0

Summary

Data Structures

Data Structure Name

Description

AnimatorStopListener

Represents a listener that contains a callback to be invoked when this animator stops.

Public Member Functions

Public Member Function Name

Description

UIImageAnimatorView ()

A constructor used to create a UIImageAnimatorView instance.

~UIImageAnimatorView ()

virtual

A destructor used to delete the UIImageAnimatorView instance.

GetViewType () const override

UIViewType

Obtains the view type.

SetImageAnimatorSrc (const char *imageSrc, uint8_t imageNum, uint16_t timeOfUpdate)

void

Sets the images and speed for this animator.

SetImageAnimatorSrc (const char *imageSrc, uint8_t imageNum)

void

Sets the images for this animator.

SetTimeOfUpdate (uint16_t timeOfUpdate)

void

Sets the speed for this animator.

GetTimeOfUpdate () const

uint16_t

Obtains the speed of this animator.

SetTimeOfPause (uint16_t timeOfPause)

void

Sets the interval between two playbacks of an infinitely repeated animator.

GetTimeOfPause () const

uint16_t

Obtains the interval between two playbacks of an infinitely repeated animator.

GetImageAnimatorSrc () const

const ImageAnimatorInfo *

Obtains the image array of this frame animator.

GetImageAnimatorImageNum () const

uint8_t

Obtains the number of images.

SetSizeFixed (bool fixed)

void

Sets whether the image size is fixed to the view size.

IsSizeFixed () const

bool

Checks whether the image size is fixed to the view size.

SetRepeat (bool repeat)

void

Sets whether to play this animator for infinite times.

IsRepeat () const

bool

Checks whether this animator is played for infinite times.

SetRepeatTimes (uint32_t times)

void

Sets the playback times for this animator.

GetRepeatTimes () const

uint32_t

Obtains the playback times.

GetState () const

uint8_t

Obtains the current state of this animator.

SetReverse (bool reverse)

void

Sets the playback sequence for this animator.

IsReverse () const

bool

Obtains the playback sequence of this animator.

Start ()

void

Starts this animator.

Stop (bool needReset=true)

void

Stops this animator.

Pause ()

void

Pauses this animator at the current image.

Resume ()

void

Resumes this animator from the current image.

SetAnimatorStopListener (AnimatorStopListener *listener)

void

Sets the listener for the stop of this animator.

UIImageView ()

A default constructor used to create a UIImageView instance.

~UIImageView ()

virtual

A destructor used to delete the UIImageView instance.

GetViewType () const override

UIViewType

Obtains the view type.

GetWidth () override

int16_t

Obtains the width of this image view.

GetHeight () override

int16_t

Obtains the height of this image view.

OnPreDraw (const Rect &invalidatedArea) override

bool

Checks whether this image view needs to be covered to optimize the drawing process.

OnDraw (const Rect &invalidatedArea) override

void

Draws this image view.

SetSrc (const char *src)

void

Sets the image path.

SetSrc (const ImageInfo *src)

void

Sets the image information.

SetAutoEnable (bool enable)

void

Sets whether the image view size needs to be adaptive to the image size.

SetBlurLevel (BlurLevel level)

void

Sets the blur level for this image when it is rotated or scaled.

GetBlurLevel () const

BlurLevel

Obtains the blur level of this image when it is rotated or scaled.

SetTransformAlgorithm (TransformAlgorithm algorithm)

void

Sets the algorithm used for image rotation and scaling.

GetTransformAlgorithm () const

TransformAlgorithm

Obtains the algorithm used for image rotation and scaling.

GetPath () const

const char *

Obtains the image path.

GetImageInfo () const

const ImageInfo *

Obtains image information.

GetSrcType () const

uint8_t

Obtains the image type.

UIView ()

A default constructor used to create an UIView instance.

UIView (const char *id)

A constructor used to create an UIView instance.

~UIView ()

virtual

A destructor used to delete the UIView instance.

OnPostDraw (const Rect &invalidatedArea)

virtual void

Called after a view is drawn.

Invalidate ()

void

Refreshes the invalidated area of the view.

InvalidateRect (const Rect &invalidatedArea)

void

Refreshes a view in a specified invalidated area.

OnLongPressEvent (const LongPressEvent &event)

virtual bool

Called when the view is long pressed.

OnDragStartEvent (const DragEvent &event)

virtual bool

Called when the view starts to drag.

OnDragEvent (const DragEvent &event)

virtual bool

Called when the view is being dragged.

OnDragEndEvent (const DragEvent &event)

virtual bool

Called when the view stops dragging.

OnClickEvent (const ClickEvent &event)

virtual void

Called when the view is clicked.

OnPressEvent (const PressEvent &event)

virtual void

Called when the view is pressed.

OnReleaseEvent (const ReleaseEvent &event)

virtual void

Called when the view is released.

OnCancelEvent (const CancelEvent &event)

virtual void

Called when a click event on the view is canceled.

SetOnDragListener (OnDragListener *onDragListener)

void

Sets a drag event listener for the view.

GetOnDragListener ()

OnDragListener *&

Obtains the drag event listener for the view.

SetOnClickListener (OnClickListener *onClickListener)

void

Sets a click event listener for the view.

GetOnClickListener ()

OnClickListener *&

Obtains the click event listener for the view.

SetOnLongPressListener (OnLongPressListener *onLongPressListener)

void

Sets a long-press event listener for the view.

GetOnLongPressListener ()

OnLongPressListener *&

Obtains the long-press event listener for the view.

SetOnTouchListener (OnTouchListener *onTouchListener)

void

Sets a touch event listener for the view.

GetTouchListener ()

OnTouchListener *&

Obtains the touch event listener for the view.

GetTargetView (const Point &point, UIView **last)

virtual void

Obtains the top-level view based on specified coordinates.

SetParent (UIView *parent)

void

Sets the parent view for the view.

GetParent () const

UIView *

Obtains the parent view of the view.

SetNextSibling (UIView *sibling)

void

Sets the next sibling view for the view.

GetNextSibling () const

UIView *

Obtains the next sibling view of the view.

SetVisible (bool visible)

virtual void

Sets whether the view is visible.

IsVisible () const

bool

Checks whether the view is visible.

SetTouchable (bool touch)

void

Sets whether the view is touchable.

IsTouchable () const

bool

Checks whether the view is touchable.

SetDraggable (bool draggable)

void

Sets whether the view is draggable.

IsDraggable () const

bool

Checks whether the view is draggable.

SetDragParentInstead (bool dragParentInstead)

void

Sets whether to transfer the drag event to the parent view for processing when the view is being dragged.

IsDragParentInstead () const

bool

Obtains whether the view transfers a drag event to the parent view for processing.

GetRect () const

Rect

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

Rect

Obtains the visible absolute rectangle area of the view.

GetMaskedRect () const

Rect

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

Rect

Obtains the absolute rectangle area of the view.

GetContentRect ()

virtual Rect

Obtains the content of the absolute rectangle area of the view. This area excludes padding.

GetRelativeRect () const

Rect

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)

void

Adjusts the size of the visible area. This operation may affect the final display size.

SetWidth (int16_t width)

virtual void

Sets the width for the view.

SetHeight (int16_t height)

virtual void

Sets the height for the view.

Resize (int16_t width, int16_t height)

virtual void

Adjusts the size of the view.

SetX (int16_t x)

virtual void

Sets the x-coordinate for the view.

GetX () const

int16_t

Obtains the x-coordinate for the view.

SetY (int16_t y)

virtual void

Sets the y-coordinate for the view.

GetY () const

int16_t

Obtains the y-coordinate for the view.

SetPosition (int16_t x, int16_t y)

virtual void

Sets the position for the view.

SetPosition (int16_t x, int16_t y, int16_t width, int16_t height)

virtual void

Adjusts the position and size of the view.

IsViewGroup () const

bool

Checks whether the view is a container view.

SetIntercept (bool isIntercept)

void

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)

void

Sets the affine transformation matrix.

GetTransformMap ()

TransformMap &

Obtains an affine transformation matrix.

GetChildById (const char *id) const

virtual UIView *

Obtains the child view of a specified ID.

SetViewId (const char *id)

void

Sets the view ID.

GetViewId () const

const char *

Obtains the view ID.

SetViewIndex (int16_t index)

void

Sets the view index.

GetViewIndex () const

int16_t

Obtains the view index.

LayoutChildren (bool neeInvalidate=false)

virtual void

Lays out all child views according to the preset arrangement mode.

LayoutCenterOfParent (int16_t xOffSet=0, int16_t yOffset=0)

void

Lays out the view in the center of the parent view.

LayoutLeftOfParent (int16_t offset=0)

void

Lays out the view on the left of the parent view.

LayoutRightOfParent (int16_t offset=0)

void

Lays out the view on the right of the parent view.

LayoutTopOfParent (int16_t offset=0)

void

Lays out the view on the top of the parent view.

LayoutBottomOfParent (int16_t offset=0)

void

Lays out the view on the bottom of the parent view.

AlignLeftToSibling (const char *id, int16_t offset=0)

void

Aligns the view with the left of a sibling view.

AlignRightToSibling (const char *id, int16_t offset=0)

void

Aligns the view with the right of a sibling view.

AlignTopToSibling (const char *id, int16_t offset=0)

void

Aligns the view with the top of a sibling view.

AlignBottomToSibling (const char *id, int16_t offset=0)

void

Aligns the view with the bottom of a sibling view.

AlignHorCenterToSibling (const char *id, int16_t offset=0)

void

Aligns the view with the center of a sibling view in the x-axis.

AlignVerCenterToSibling (const char *id, int16_t offset=0)

void

Aligns the view with the center of a sibling view in the y-axis.

LayoutLeftToSibling (const char *id, int16_t offset=0)

void

Lays out the view on the left of a sibling view.

LayoutRightToSibling (const char *id, int16_t offset=0)

void

Lays out the view on the right of a sibling view.

LayoutTopToSibling (const char *id, int16_t offset=0)

void

Lays out the view on the above of a sibling view.

LayoutBottomToSibling (const char *id, int16_t offset=0)

void

Lays out the view on the below of a sibling view.

SetStyle (Style &style)

virtual void

Sets the view style.

SetStyle (uint8_t key, int64_t value)

virtual void

Sets a style.

GetStyle (uint8_t key) const

virtual int64_t

Obtains the value of a style.

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)

void *

Overrides the new function.

operator delete (void *p)

void

Overrides the delete function.

Additional Inherited Members

Additional Inherited Member Name

Description

imageWidth_

Represents the width of this image.

imageHeight_

Represents the height of this image.

autoEnable_

Specifies whether automatic adaptation is enabled.

needRefresh_

Specifies whether a refresh is needed.

colorFormat_: 4

Represents the color format of this image.

blurLevel_: 2

Represents the blur level of this image when it is rotated or scaled.

algorithm_: 1

Represents the algorithm used for image rotation and scaling.

1
https://gitee.com/SolarBird/docs.git
git@gitee.com:SolarBird/docs.git
SolarBird
docs
docs
master

搜索帮助