mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-28 13:36:27 +08:00
feat(rlottie) add LVGL-Rlottie interface as 3rd party lib (#2700)
This commit is contained in:
committed by
GitHub
parent
49c069fe89
commit
03fff13f62
@@ -19,6 +19,7 @@ extern "C" {
|
||||
#include "sjpg/lv_example_sjpg.h"
|
||||
#include "qrcode/lv_example_qrcode.h"
|
||||
#include "freetype/lv_example_freetype.h"
|
||||
#include "rlottie/lv_example_rlottie.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
Load a Lottie animation from raw data
|
||||
"""""""""""""""""""""""""""""""""""""
|
||||
|
||||
.. lv_example:: libs/rlottie/lv_example_rlottie_1
|
||||
:language: c
|
||||
|
||||
Load a Lottie animation from a file
|
||||
"""""""""""""""""""""""""""""""""""
|
||||
|
||||
.. lv_example:: libs/rlottie/lv_example_rlottie_2
|
||||
:language: c
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* @file lv_example_rlottie.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_EXAMPLE_RLOTTIE_H
|
||||
#define LV_EXAMPLE_RLOTTIE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
void lv_example_rlottie_1(void);
|
||||
void lv_example_rlottie_2(void);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif /*LV_EXAMPLE_SJPG_H*/
|
||||
@@ -0,0 +1,14 @@
|
||||
#include "../../lv_examples.h"
|
||||
#if LV_USE_RLOTTIE && LV_BUILD_EXAMPLES
|
||||
|
||||
/**
|
||||
* Load an lottie animation from flash
|
||||
*/
|
||||
void lv_example_rlottie_1(void)
|
||||
{
|
||||
extern const uint8_t lv_example_rlottie_approve[];
|
||||
lv_obj_t * lottie = lv_rlottie_create_from_raw(lv_scr_act(), 100, 100, (const void *)lv_example_rlottie_approve);
|
||||
lv_obj_center(lottie);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,15 @@
|
||||
#include "../../lv_examples.h"
|
||||
#if LV_USE_RLOTTIE && LV_BUILD_EXAMPLES
|
||||
|
||||
/**
|
||||
* Load an lottie animation from file
|
||||
*/
|
||||
void lv_example_rlottie_2(void)
|
||||
{
|
||||
/*The rlottie library uses STDIO file API, so there is no drievr letter for LVGL*/
|
||||
lv_obj_t * lottie = lv_rlottie_create_from_file(lv_scr_act(), 100, 100,
|
||||
"lvgl/examples/libs/rlottie/lv_example_rlottie_approve.json");
|
||||
lv_obj_center(lottie);
|
||||
}
|
||||
|
||||
#endif
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user