Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change TileView Scroll animation speed #6239

Closed
jgauchia opened this issue May 18, 2024 · 3 comments
Closed

Change TileView Scroll animation speed #6239

jgauchia opened this issue May 18, 2024 · 3 comments

Comments

@jgauchia
Copy link
Contributor

LVGL version

v9.1.0

What happened?

As described in this post scroll animation speed of a tileview is fixed by "define" constant in lv_obj_scroll.c

#define SCROLL_ANIM_TIME_MIN    200    /*ms*/
#define SCROLL_ANIM_TIME_MAX    400    /*ms*/

There are any "possibility" to add a public method or similar in order to change the scroll animation time?

Thank you!

How to reproduce?

No response

@kisvegabor
Copy link
Member

Hi,

You can do this to modify the scroll animation:

void anim_start_event_cb(lv_event_t * e)
{
	lv_anim_t * a = lv_event_get_param(e);
	if(a) a->duration = 2000;
}

...

    lv_obj_t * tv = lv_tileview_create(lv_screen_active());
    lv_obj_add_event_cb(tv, anim_start_event_cb, LV_EVENT_SCROLL_BEGIN, NULL);

@jgauchia
Copy link
Contributor Author

Hi,

You can do this to modify the scroll animation:

void anim_start_event_cb(lv_event_t * e)
{
	lv_anim_t * a = lv_event_get_param(e);
	if(a) a->duration = 2000;
}

...

    lv_obj_t * tv = lv_tileview_create(lv_screen_active());
    lv_obj_add_event_cb(tv, anim_start_event_cb, LV_EVENT_SCROLL_BEGIN, NULL);

Hi!

Thank you!

@kisvegabor
Copy link
Member

You are welcome!

I'm closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants