I want to add a widget for LVGL,how to do

now, I have already written the code for this widget,How do I add it to LVGL


Do you mean to contribute with your code?

If your please describe your widget in more detail.

yes, I want to Contribute code for lvgl

This widget (called naviview)functions like tileview, but has the following advantages:

  1. insert and delete elements dynamically
  2. relationships between elements can be dynamically modified
  3. elements can circular scrolling
  4. late feature extension is easy

Why am I writing this widget:

  1. tileview widget have weaker features
    1. how to insert and delete elements dynamically
    2. how to dynamically change relationships between elements.
  2. tileview not circular scrolling
  3. tileview late feature extension is troublesome

The implementation details are as follows:

It consists of two parts:

  1. naviitem:Information about wrapping elements.Details seelv_naviitem_t
  2. naviview_ext:Information about elements control.Details seelv_naviview_ext_t
/*Data of naviview item*/
typedef struct _naviitem_handler{
    lv_obj_t *obj;
    struct _naviitem_handler *top;
    struct _naviitem_handler *bottom;
    struct _naviitem_handler *left;
    struct _naviitem_handler *right;

/*Data of naviview*/
typedef struct{
    lv_naviitem_t *current;
    uint16_t anim_time;
    struct {
        uint8_t enabled  : 1;
        uint8_t flashing : 1;
    } edge_flash;

The diagram is as follows:

The current demo is shown below

1 Like


Hi, great! beautiful.

The basic features of the drag pattern are also implemented

I want to add the widget to LVGL,Why don’t you talk to me。@lvgl :frowning_face:

i think… in holiday!!

1 Like

Unfortunately @kisvegabor can’t always afford the time to check forum posts each day. He should respond to you within the next few days though.

Could you send a pull request to the LVGL repo to get the process started? It should go to the dev branch as it’s a new feature.

That‘s so cool, i want to use it. :star_struck:

I’m so sorry for the late replay, @guoweilkd. Unfortunately, I have no time to develop LVGL, run discussions on GitHub and be active here at the same time. :frowning: Besides I was on holiday too :slight_smile:

So, your approach looks good and clear. As @embeddedt suggested, please send a PR on GitHub to see the details. I promise that I’ll replay much faster. :slight_smile:

That looks really cool. I love the 2d scrolling. It reminds me of the Playstation4 menu bar. Is it possible to display 3 menu items while scrolling the middle one?

As more people make widgets it would be cool to have a plugin/add-on directory on the site where people can download additional widgets. It will help build the community and make it easier to find/share widgets without making the core library get bloated.

yes, I agree with you.And I think it needs to be prioritized.
In this respect, we should learn from the rtThread package.https://github.com/RT-Thread/
Everyone can contribute packages to LVGL, and the user can configure whether to use the widget via Menuconfig

At some point we can turn the repo I propose here into downloadable widgets.

@guoweilkd What happened to the implementation?

I also need circular scrolling.