feat(gif): add API to pause/resume gif timer (#4854)
Signed-off-by: wangxuedong <wangxuedong@xiaomi.com>
This commit is contained in:
@@ -106,6 +106,18 @@ void lv_gif_restart(lv_obj_t * obj)
|
|||||||
lv_timer_reset(gifobj->timer);
|
lv_timer_reset(gifobj->timer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void lv_gif_pause(lv_obj_t * obj)
|
||||||
|
{
|
||||||
|
lv_gif_t * gifobj = (lv_gif_t *) obj;
|
||||||
|
lv_timer_pause(gifobj->timer);
|
||||||
|
}
|
||||||
|
|
||||||
|
void lv_gif_resume(lv_obj_t * obj)
|
||||||
|
{
|
||||||
|
lv_gif_t * gifobj = (lv_gif_t *) obj;
|
||||||
|
lv_timer_resume(gifobj->timer);
|
||||||
|
}
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* STATIC FUNCTIONS
|
* STATIC FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
|
|||||||
@@ -41,9 +41,38 @@ extern const lv_obj_class_t lv_gif_class;
|
|||||||
* GLOBAL PROTOTYPES
|
* GLOBAL PROTOTYPES
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a gif object
|
||||||
|
* @param parent pointer to an object, it will be the parent of the new gif.
|
||||||
|
* @return pointer to the gif obj
|
||||||
|
*/
|
||||||
lv_obj_t * lv_gif_create(lv_obj_t * parent);
|
lv_obj_t * lv_gif_create(lv_obj_t * parent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the gif data to display on the object
|
||||||
|
* @param obj pointer to a gif object
|
||||||
|
* @param src 1) pointer to an ::lv_image_dsc_t descriptor (which contains gif raw data) or
|
||||||
|
* 2) path to a gif file (e.g. "S:/dir/anim.gif")
|
||||||
|
*/
|
||||||
void lv_gif_set_src(lv_obj_t * obj, const void * src);
|
void lv_gif_set_src(lv_obj_t * obj, const void * src);
|
||||||
void lv_gif_restart(lv_obj_t * gif);
|
|
||||||
|
/**
|
||||||
|
* Restart a gif animation.
|
||||||
|
* @param obj pointer to a gif obj
|
||||||
|
*/
|
||||||
|
void lv_gif_restart(lv_obj_t * obj);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pause a gif animation.
|
||||||
|
* @param obj pointer to a gif obj
|
||||||
|
*/
|
||||||
|
void lv_gif_pause(lv_obj_t * obj);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resume a gif animation.
|
||||||
|
* @param obj pointer to a gif obj
|
||||||
|
*/
|
||||||
|
void lv_gif_resume(lv_obj_t * obj);
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* MACROS
|
* MACROS
|
||||||
|
|||||||
Reference in New Issue
Block a user