LVGL v8 Multlist Example
Source path: SiFli-SDK/example/multimedia/lvgl/lvgl_v8_multlist
Overview
This example demonstrates how the lvsf_multlist widget can be organized and used in a practical application, with a focus on the following capabilities:
Application entry, page registration, and subpage navigation based on
gui_app_fwkLayout and focus control of
lvsf_multlistin vertical and horizontal list scenariosLooping page-flip effects of
lvsf_multlistin full-page scrolling scenariosCustom card animation effects through a
transform callbackDynamic text conversation lists built with
lv_txtimg
This example is not a minimal single-widget demo. Instead, it is a complete demo framework with a main entry page, menu page, functional subpages, resource caching, and return navigation. It can be used as a reference project for building lvsf_multlist-based interfaces.
Supported Boards
sf32lb52-lcd_n16r8
sf32lb52-lchspi-ulp
Hardware Requirements
Before running this example, prepare:
A supported development board for this example (supported platforms).
A display.
Build and download:
Supported boards:
Boards after the 55x series, such as 58x, 56x, and 52x
The board project is located in the project directory. You can build a project for a specific board by passing the board option.
For example, to build a project for HDK 563, run
scons --board=eh-lb563For downloading, use
download.batin the build directory. For example, to flash the generated 563 project, run.\build_eh-lb563\download.batto download it through J-LinkSpecial note: for the SF32LB52x/SF32LB56x series, an additional
uart_download.batwill be generated. You can run this script and enter the UART port number to perform the download
Simulator Configuration
The simulator project is located in the simulator directory.
Use
sconsto build it. TheSiFli-SDK/msvc_setup.batfile needs to be adjusted to match the MSVC environment on your machineYou can also use
scons --target=vs2017to generate the MSVC project fileproject.vcxprojand build it with Visual Studio Note: if you are not using VS2017, for example VS2022, Visual Studio may prompt you to upgrade the MSVC SDK when loading the project. After the upgrade, the project can be used normally
Runtime Description
Startup Flow
The startup flow is as follows:
Call
gui_app_init()to initialize the application frameworkCall
gui_app_run(DEMO_MULTLIST_MAIN_ID)to enter the Multlist demo main entry
Therefore, the runtime entry of this example is not a single lv_example_xxx() function. It is a group of pages managed by gui_app_fwk.
Page Structure
The example can be divided into two levels:
Main entry page Description:
demo_multlist_main.ccreates a launcher card. Tapping it opens the Multlist main menuMultlist main menu page Description:
demo_multlist.ccreates a verticallvsf_multlistmenu and jumps to different function pages throughgui_app_run_subpage()
The main menu currently contains the following sub-functions:
horizontal listvertical listhorizontal pagevertical pagehorizontal animationvertical animationIntercom list
Design Logic Framework
The overall design of this example can be understood as a three-layer structure: application framework layer, page layer, and resource layer.
Application framework layer Description: Registers pages into
gui_app_fwkthroughAPPLICATION_REGISTER_*andAPP_PAGE_REGISTER, and handles start, resume, pause, stop, and back navigation in a unified wayPage implementation layer Description: Each subpage focuses only on its own
on_start / on_resume / on_pause / on_stoplifecycle and the correspondinglvsf_multlistconfigurationResource and cache layer Description:
demo_multlist_cards.cmanages image sources, card size calculation, and snapshot caching so that card resources can be reused by list pages and animation pages
Description of Each Functional Page
List page
demo_multlist_list.cDescription: Demonstrates a regular list style. The page first generates thumbnail cards throughdemo_multlist_card_cache_init(), then createslvsf_multlist, and finally fills 100 list items according to horizontal or vertical modePage-flip page
demo_multlist_page.cDescription: Demonstrates horizontal or vertical paging with full-screen images and enablesLV_MULTLIST_FLAG_LOOPto implement cyclic page flippingAnimation page
demo_multlist_anim.cDescription: Useslv_multlist_set_tranform_cb()to customize element scaling, opacity, and layer ordering, providing a stronger visual animation effectDialogue page
demo_multlist_dialog.cDescription: Combineslv_txtimgandlvsf_multlistto implement a chat/intercom-style message flow, supporting both new messages and appending text to the last message
Resource Organization
Instead of using raw images directly, this example abstracts card resources into a unified snapshot cache:
Original image resources are provided by
demo_list_0 ~ demo_list_3demo_multlist_cards.cdynamically calculates list card sizes and animation card sizes according to screen sizePages use cached
lv_img_dsc_tsnapshots instead of creating temporary objects repeatedly
Recommended Reference Scenarios
This example is suitable as a reference template for the following interface types:
Launcher pages or function entry lists
Card flows, cover flows, horizontal or vertical menus
Full-page carousels or paged browsing interfaces
Focused browsing interfaces with transition animations
Chat history or intercom-style dynamic text lists
Troubleshooting
If you have any technical questions, please submit an issue on GitHub.