mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-23 07:46:36 +08:00
docs(examples): add @title/@brief doc tags to examples (#9967)
Arduino Lint / lint (push) Has been cancelled
Build Examples with C++ Compiler / build-examples (push) Has been cancelled
MicroPython CI / Build esp32 port (push) Has been cancelled
MicroPython CI / Build rp2 port (push) Has been cancelled
MicroPython CI / Build stm32 port (push) Has been cancelled
MicroPython CI / Build unix port (push) Has been cancelled
C/C++ CI / Build OPTIONS_16BIT - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_24BIT - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_FULL_32BIT - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_NORMAL_8BIT - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_SDL - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_16BIT - cl - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_16BIT - gcc - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_24BIT - cl - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_24BIT - gcc - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_FULL_32BIT - cl - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_FULL_32BIT - gcc - Windows (push) Has been cancelled
C/C++ CI / Build ESP IDF ESP32S3 (push) Has been cancelled
C/C++ CI / Run tests with 32bit build (push) Has been cancelled
C/C++ CI / Run tests with 64bit build (push) Has been cancelled
BOM Check / bom-check (push) Has been cancelled
Verify that lv_conf_internal.h matches repository state / verify-conf-internal (push) Has been cancelled
Verify GDB constants are up-to-date / verify-gdb-consts (push) Has been cancelled
Verify the widget property name / verify-property-name (push) Has been cancelled
Verify code formatting / verify-formatting (push) Has been cancelled
Compare file templates with file names / template-check (push) Has been cancelled
Build docs / build-and-deploy (push) Has been cancelled
Test API JSON generator / Test API JSON (push) Has been cancelled
Install LVGL using CMake / build-examples (push) Has been cancelled
Check Makefile / Build using Makefile (push) Has been cancelled
Check Makefile for UEFI / Build using Makefile for UEFI (push) Has been cancelled
Emulated Performance Test / ARM Emulated Benchmark - Script Check (scripts/perf/tests/benchmark_results_comment/test.sh) (push) Has been cancelled
Emulated Performance Test / ARM Emulated Benchmark - Script Check (scripts/perf/tests/filter_docker_logs/test.sh) (push) Has been cancelled
Emulated Performance Test / ARM Emulated Benchmark - Script Check (scripts/perf/tests/serialize_results/test.sh) (push) Has been cancelled
Hardware Performance Test / Hardware Performance Benchmark (push) Has been cancelled
Hardware Performance Test / HW Benchmark - Save PR Number (push) Has been cancelled
Performance Tests CI / Perf Tests OPTIONS_TEST_PERF_32B - Ubuntu (push) Has been cancelled
Performance Tests CI / Perf Tests OPTIONS_TEST_PERF_64B - Ubuntu (push) Has been cancelled
Port repo release update / run-release-branch-updater (push) Has been cancelled
Verify Font License / verify-font-license (push) Has been cancelled
Verify Kconfig / verify-kconfig (push) Has been cancelled
Emulated Performance Test / ARM Emulated Benchmark 32b - lv_conf_perf32b (push) Has been cancelled
Emulated Performance Test / ARM Emulated Benchmark 64b - lv_conf_perf64b (push) Has been cancelled
Emulated Performance Test / ARM Emulated Benchmark - Save PR Number (push) Has been cancelled
Close stale issues and PRs / stale (push) Has been cancelled
Arduino Lint / lint (push) Has been cancelled
Build Examples with C++ Compiler / build-examples (push) Has been cancelled
MicroPython CI / Build esp32 port (push) Has been cancelled
MicroPython CI / Build rp2 port (push) Has been cancelled
MicroPython CI / Build stm32 port (push) Has been cancelled
MicroPython CI / Build unix port (push) Has been cancelled
C/C++ CI / Build OPTIONS_16BIT - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_24BIT - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_FULL_32BIT - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_NORMAL_8BIT - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_SDL - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_16BIT - cl - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_16BIT - gcc - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_24BIT - cl - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_24BIT - gcc - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_FULL_32BIT - cl - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_FULL_32BIT - gcc - Windows (push) Has been cancelled
C/C++ CI / Build ESP IDF ESP32S3 (push) Has been cancelled
C/C++ CI / Run tests with 32bit build (push) Has been cancelled
C/C++ CI / Run tests with 64bit build (push) Has been cancelled
BOM Check / bom-check (push) Has been cancelled
Verify that lv_conf_internal.h matches repository state / verify-conf-internal (push) Has been cancelled
Verify GDB constants are up-to-date / verify-gdb-consts (push) Has been cancelled
Verify the widget property name / verify-property-name (push) Has been cancelled
Verify code formatting / verify-formatting (push) Has been cancelled
Compare file templates with file names / template-check (push) Has been cancelled
Build docs / build-and-deploy (push) Has been cancelled
Test API JSON generator / Test API JSON (push) Has been cancelled
Install LVGL using CMake / build-examples (push) Has been cancelled
Check Makefile / Build using Makefile (push) Has been cancelled
Check Makefile for UEFI / Build using Makefile for UEFI (push) Has been cancelled
Emulated Performance Test / ARM Emulated Benchmark - Script Check (scripts/perf/tests/benchmark_results_comment/test.sh) (push) Has been cancelled
Emulated Performance Test / ARM Emulated Benchmark - Script Check (scripts/perf/tests/filter_docker_logs/test.sh) (push) Has been cancelled
Emulated Performance Test / ARM Emulated Benchmark - Script Check (scripts/perf/tests/serialize_results/test.sh) (push) Has been cancelled
Hardware Performance Test / Hardware Performance Benchmark (push) Has been cancelled
Hardware Performance Test / HW Benchmark - Save PR Number (push) Has been cancelled
Performance Tests CI / Perf Tests OPTIONS_TEST_PERF_32B - Ubuntu (push) Has been cancelled
Performance Tests CI / Perf Tests OPTIONS_TEST_PERF_64B - Ubuntu (push) Has been cancelled
Port repo release update / run-release-branch-updater (push) Has been cancelled
Verify Font License / verify-font-license (push) Has been cancelled
Verify Kconfig / verify-kconfig (push) Has been cancelled
Emulated Performance Test / ARM Emulated Benchmark 32b - lv_conf_perf32b (push) Has been cancelled
Emulated Performance Test / ARM Emulated Benchmark 64b - lv_conf_perf64b (push) Has been cancelled
Emulated Performance Test / ARM Emulated Benchmark - Save PR Number (push) Has been cancelled
Close stale issues and PRs / stale (push) Has been cancelled
This commit is contained in:
committed by
GitHub
parent
672e8f5afc
commit
670a057898
@@ -35,7 +35,14 @@ static void sw_event_cb(lv_event_t * e)
|
||||
}
|
||||
|
||||
/**
|
||||
* Start animation on an event
|
||||
* @title Start animation on an event
|
||||
* @brief Animate a label's x position when a switch's state changes.
|
||||
*
|
||||
* A label and a switch (initially checked) are placed on the active screen.
|
||||
* The switch's `LV_EVENT_VALUE_CHANGED` callback configures and starts an
|
||||
* `lv_anim_t`: when checked, the label animates to x=100 with
|
||||
* `lv_anim_path_overshoot`; when unchecked, it animates to `-width` with
|
||||
* `lv_anim_path_ease_in`. Both animations run for 500 ms.
|
||||
*/
|
||||
void lv_example_anim_1(void)
|
||||
{
|
||||
|
||||
@@ -13,7 +13,12 @@ static void event_cb(lv_event_t * e)
|
||||
}
|
||||
|
||||
/**
|
||||
* Add click event to a button
|
||||
* @title Click event on a button
|
||||
* @brief Update a button's label with an incrementing counter on each click.
|
||||
*
|
||||
* A button with a child label is placed on the active screen. An
|
||||
* `LV_EVENT_CLICKED` callback retrieves the button, updates its label with
|
||||
* a static incrementing counter, and logs `Clicked`.
|
||||
*/
|
||||
void lv_example_event_click(void)
|
||||
{
|
||||
|
||||
@@ -19,6 +19,17 @@ static void streak_event_cb(lv_event_t * e)
|
||||
lv_label_set_text(label, text);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title Click streaks (single, double, triple)
|
||||
* @brief React to single, double, and triple click events plus the short-click streak count.
|
||||
*
|
||||
* A button is registered with four event callbacks: `LV_EVENT_SHORT_CLICKED`
|
||||
* reads `lv_indev_get_short_click_streak()` and writes the count to a
|
||||
* separate label; `LV_EVENT_SINGLE_CLICKED`, `LV_EVENT_DOUBLE_CLICKED`, and
|
||||
* `LV_EVENT_TRIPLE_CLICKED` each set the button's label to a matching string.
|
||||
*
|
||||
* @hide_in_docs
|
||||
*/
|
||||
void lv_example_event_streak(void)
|
||||
{
|
||||
lv_obj_t * info_label = lv_label_create(lv_screen_active());
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
#if LV_BUILD_EXAMPLES && LV_USE_LABEL
|
||||
|
||||
/**
|
||||
* Basic example to create a "Hello world" label
|
||||
* @title Hello world label
|
||||
* @brief Set the screen background color and place a centered label.
|
||||
*
|
||||
* Sets the active screen's background color, creates a label with the text
|
||||
* `Hello world`, sets the screen's text color to white, and centers the
|
||||
* label on the screen.
|
||||
*/
|
||||
void lv_example_get_started_1(void)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,13 @@
|
||||
#if LV_USE_FLEX && LV_BUILD_EXAMPLES
|
||||
|
||||
/**
|
||||
* A simple row and a column layout with flexbox
|
||||
* @title Flex row and column basics
|
||||
* @brief A row container and a column container, each filled with buttons.
|
||||
*
|
||||
* Two containers are created on the active screen: one with
|
||||
* `LV_FLEX_FLOW_ROW` and one with `LV_FLEX_FLOW_COLUMN`. Each is populated
|
||||
* with ten buttons. Row items use a fixed 100 px width and full container
|
||||
* height; column items use full container width with `LV_SIZE_CONTENT` height.
|
||||
*/
|
||||
void lv_example_flex_1(void)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,13 @@
|
||||
#if LV_USE_GRID && LV_BUILD_EXAMPLES
|
||||
|
||||
/**
|
||||
* Demonstrate grid's "free unit"
|
||||
* @title Grid free units (FR)
|
||||
* @brief Distribute leftover space between grid tracks using FR units.
|
||||
*
|
||||
* A 300x220 container uses three columns (60 px, FR(1), FR(2)) and three
|
||||
* rows (50 px, FR(1), 50 px). Nine child objects fill the cells with
|
||||
* `LV_GRID_ALIGN_STRETCH`. Pixel tracks take their fixed size first; the
|
||||
* remaining space is divided between FR tracks in proportion to their weights.
|
||||
*/
|
||||
void lv_example_grid_3(void)
|
||||
{
|
||||
|
||||
@@ -13,6 +13,16 @@ static void event_handler(lv_event_t * e)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @title Button basics
|
||||
* @brief A momentary button and a checkable toggle button sharing one event handler.
|
||||
*
|
||||
* Two buttons are created on the active screen. Both register `event_handler`,
|
||||
* which logs `Clicked` on `LV_EVENT_CLICKED` and `Toggled` on
|
||||
* `LV_EVENT_VALUE_CHANGED`. The first button has `LV_OBJ_FLAG_PRESS_LOCK`
|
||||
* removed; the second has `LV_OBJ_FLAG_CHECKABLE` set so it stays checked
|
||||
* when pressed and emits `LV_EVENT_VALUE_CHANGED` on toggle.
|
||||
*/
|
||||
void lv_example_button_1(void)
|
||||
{
|
||||
lv_obj_t * label;
|
||||
|
||||
Reference in New Issue
Block a user