code stringlengths 1 1.05M | repo_name stringlengths 6 83 | path stringlengths 3 242 | language stringclasses 222
values | license stringclasses 20
values | size int64 1 1.05M |
|---|---|---|---|---|---|
#
# Demonstrate grid's "free unit"
#
# Column 1: fix width 60 px
# Column 2: 1 unit from the remaining free space
# Column 3: 2 unit from the remaining free space
col_dsc = [60, lv.grid_fr(1), lv.grid_fr(2), lv.GRID_TEMPLATE.LAST]
# Row 1: fix width 60 px
# Row 2: 1 unit from the remaining free space
# Row 3: fix wi... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/layouts/grid/lv_example_grid_3.py | Python | apache-2.0 | 908 |
#include "../../lv_examples.h"
#if LV_USE_GRID && LV_BUILD_EXAMPLES
/**
* Demonstrate track placement
*/
void lv_example_grid_4(void)
{
static lv_coord_t col_dsc[] = {60, 60, 60, LV_GRID_TEMPLATE_LAST};
static lv_coord_t row_dsc[] = {45, 45, 45, LV_GRID_TEMPLATE_LAST};
/*Add space between the columns a... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/layouts/grid/lv_example_grid_4.c | C | apache-2.0 | 1,222 |
#
# Demonstrate track placement
#
col_dsc = [60, 60, 60, lv.GRID_TEMPLATE.LAST]
row_dsc = [40, 40, 40, lv.GRID_TEMPLATE.LAST]
# Add space between the columns and move the rows to the bottom (end)
# Create a container with grid
cont = lv.obj(lv.scr_act())
cont.set_grid_align(lv.GRID_ALIGN.SPACE_BETWEEN, lv.GRID_ALIG... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/layouts/grid/lv_example_grid_4.py | Python | apache-2.0 | 797 |
#include "../../lv_examples.h"
#if LV_USE_GRID && LV_BUILD_EXAMPLES
static void row_gap_anim(void * obj, int32_t v)
{
lv_obj_set_style_pad_row(obj, v, 0);
}
static void column_gap_anim(void * obj, int32_t v)
{
lv_obj_set_style_pad_column(obj, v, 0);
}
/**
* Demonstrate column and row gap
*/
void lv_example... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/layouts/grid/lv_example_grid_5.c | C | apache-2.0 | 1,605 |
def row_gap_anim(obj, v):
obj.set_style_pad_row(v, 0)
def column_gap_anim(obj, v):
obj.set_style_pad_column(v, 0)
#
# Demonstrate column and row gap
#
# 60x60 cells
col_dsc = [60, 60, 60, lv.GRID_TEMPLATE.LAST]
row_dsc = [40, 40, 40, lv.GRID_TEMPLATE.LAST]
# Create a container with grid
cont = lv.obj(lv.scr... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/layouts/grid/lv_example_grid_5.py | Python | apache-2.0 | 1,286 |
#include "../../lv_examples.h"
#if LV_USE_GRID && LV_BUILD_EXAMPLES
/**
* Demonstrate RTL direction on grid
*/
void lv_example_grid_6(void)
{
static lv_coord_t col_dsc[] = {60, 60, 60, LV_GRID_TEMPLATE_LAST};
static lv_coord_t row_dsc[] = {45, 45, 45, LV_GRID_TEMPLATE_LAST};
/*Create a container with g... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/layouts/grid/lv_example_grid_6.c | C | apache-2.0 | 1,126 |
#
# Demonstrate RTL direction on grid
#
col_dsc = [60, 60, 60, lv.GRID_TEMPLATE.LAST]
row_dsc = [40, 40, 40, lv.GRID_TEMPLATE.LAST]
# Create a container with grid
cont = lv.obj(lv.scr_act())
cont.set_size(300, 220)
cont.center()
cont.set_style_base_dir(lv.BASE_DIR.RTL,0)
cont.set_grid_dsc_array(col_dsc, row_dsc)
for ... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/layouts/grid/lv_example_grid_6.py | Python | apache-2.0 | 710 |
/**
* @file lv_example_layout.h
*
*/
#ifndef LV_EXAMPLE_LAYOUT_H
#define LV_EXAMPLE_LAYOUT_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "flex/lv_example_flex.h"
#include "grid/lv_example_grid.h"
/*********************
* DEFINES
*********... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/layouts/lv_example_layout.h | C | apache-2.0 | 613 |
/**
* @file lv_example_bmp.h
*
*/
#ifndef LV_EXAMPLE_BMP_H
#define LV_EXAMPLE_BMP_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
********************... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/libs/bmp/lv_example_bmp.h | C | apache-2.0 | 562 |
#include "../../lv_examples.h"
#if LV_USE_BMP && LV_BUILD_EXAMPLES
/**
* Open a BMP file from a file
*/
void lv_example_bmp_1(void)
{
lv_obj_t * img = lv_img_create(lv_scr_act());
/* Assuming a File system is attached to letter 'A'
* E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */
lv_img_set_src(img, "... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/libs/bmp/lv_example_bmp_1.c | C | apache-2.0 | 401 |
/**
* @file lv_example_freetype.h
*
*/
#ifndef LV_EXAMPLE_FREETYPE_H
#define LV_EXAMPLE_FREETYPE_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
*****... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/libs/freetype/lv_example_freetype.h | C | apache-2.0 | 587 |
#include "../../lv_examples.h"
#if LV_USE_FREETYPE && LV_BUILD_EXAMPLES
/**
* Load a font with FreeType
*/
void lv_example_freetype_1(void)
{
/*Create a font*/
static lv_ft_info_t info;
/*FreeType uses C standard file system, so no driver letter is required.*/
info.name = "./lvgl/examples/libs/freety... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/libs/freetype/lv_example_freetype_1.c | C | apache-2.0 | 1,110 |
#include "../../../lvgl.h"
#ifndef LV_ATTRIBUTE_MEM_ALIGN
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#ifndef LV_ATTRIBUTE_IMG_BULB_GIF
#define LV_ATTRIBUTE_IMG_BULB_GIF
#endif
static const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_BULB_GIF uint8_t img_blub_gif_map[] = {
0x47, 0x49, 0x46, 0x38, 0... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/libs/gif/img_bulb_gif.c | C | apache-2.0 | 108,843 |
/**
* @file lv_example_gif.h
*
*/
#ifndef LV_EXAMPLE_GIF_H
#define LV_EXAMPLE_GIF_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
********************... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/libs/gif/lv_example_gif.h | C | apache-2.0 | 562 |
#include "../../lv_examples.h"
#if LV_USE_GIF && LV_BUILD_EXAMPLES
/**
* Open a GIF image from a file and a variable
*/
void lv_example_gif_1(void)
{
LV_IMG_DECLARE(img_bulb_gif);
lv_obj_t * img;
img = lv_gif_create(lv_scr_act());
lv_gif_set_src(img, &img_bulb_gif);
lv_obj_align(img, LV_ALIGN_LE... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/libs/gif/lv_example_gif_1.c | C | apache-2.0 | 607 |
/**
* @file lv_example_libs.h
*
*/
#ifndef LV_EXAMPLE_LIBS_H
#define LV_EXAMPLE_LIBS_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "bmp/lv_example_bmp.h"
#include "gif/lv_example_gif.h"
#include "png/lv_example_png.h"
#include "sjpg/lv_example_sj... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/libs/lv_example_libs.h | C | apache-2.0 | 787 |
#include "../../../lvgl.h"
#if LV_USE_PNG && LV_BUILD_EXAMPLES
#ifndef LV_ATTRIBUTE_MEM_ALIGN
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#ifndef LV_ATTRIBUTE_IMG_PNG_DECODER_TEST
#define LV_ATTRIBUTE_IMG_PNG_DECODER_TEST
#endif
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_PNG_DECODER_TEST uint8... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/libs/png/img_wing_png.c | C | apache-2.0 | 32,175 |
/**
* @file lv_example_png.h
*
*/
#ifndef LV_EXAMPLE_PNG_H
#define LV_EXAMPLE_PNG_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
********************... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/libs/png/lv_example_png.h | C | apache-2.0 | 562 |
#include "../../lv_examples.h"
#if LV_USE_PNG && LV_BUILD_EXAMPLES
/**
* Open a PNG image from a file and a variable
*/
void lv_example_png_1(void)
{
LV_IMG_DECLARE(img_wink_png);
lv_obj_t * img;
img = lv_img_create(lv_scr_act());
lv_img_set_src(img, &img_wink_png);
lv_obj_align(img, LV_ALIGN_LE... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/libs/png/lv_example_png_1.c | C | apache-2.0 | 607 |
/**
* @file lv_example_qrcode.h
*
*/
#ifndef LV_EXAMPLE_QRCODE_H
#define LV_EXAMPLE_QRCODE_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
***********... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/libs/qrcode/lv_example_qrcode.h | C | apache-2.0 | 577 |
#include "../../lv_examples.h"
#if LV_USE_QRCODE && LV_BUILD_EXAMPLES
/**
* Create a QR Code
*/
void lv_example_qrcode_1(void)
{
lv_color_t bg_color = lv_palette_lighten(LV_PALETTE_LIGHT_BLUE, 5);
lv_color_t fg_color = lv_palette_darken(LV_PALETTE_BLUE, 4);
lv_obj_t * qr = lv_qrcode_create(lv_scr_act(),... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/libs/qrcode/lv_example_qrcode_1.c | C | apache-2.0 | 628 |
/**
* @file lv_example_rlottie.h
*
*/
#ifndef LV_EXAMPLE_RLOTTIE_H
#define LV_EXAMPLE_RLOTTIE_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
********... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/libs/rlottie/lv_example_rlottie.h | C | apache-2.0 | 612 |
#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_appr... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/libs/rlottie/lv_example_rlottie_1.c | C | apache-2.0 | 593 |
#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,
... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/libs/rlottie/lv_example_rlottie_2.c | C | apache-2.0 | 657 |
/**
* @file lv_example_sjpg.h
*
*/
#ifndef LV_EXAMPLE_SJPG_H
#define LV_EXAMPLE_SJPG_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
*****************... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/libs/sjpg/lv_example_sjpg.h | C | apache-2.0 | 567 |
#include "../../lv_examples.h"
#if LV_USE_SJPG && LV_BUILD_EXAMPLES
/**
* Load an SJPG image
*/
void lv_example_sjpg_1(void)
{
lv_obj_t * wp;
wp = lv_img_create(lv_scr_act());
/* Assuming a File system is attached to letter 'A'
* E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */
lv_img_set_src(wp, "A:lvgl/exa... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/libs/sjpg/lv_example_sjpg_1.c | C | apache-2.0 | 366 |
/**
* @file lv_examples.h
*
*/
#ifndef LV_EXAMPLES_H
#define LV_EXAMPLES_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "../lvgl.h"
#include "styles/lv_example_style.h"
#include "get_started/lv_example_get_started.h"
#include "widgets/lv_example_... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/lv_examples.h | C | apache-2.0 | 924 |
/**
* @file lv_example_others.h
*
*/
#ifndef LV_EXAMPLE_OTHERS_H
#define LV_EXAMPLE_OTHERS_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "snapshot/lv_example_snapshot.h"
/*********************
* DEFINES
*********************/
/***********... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/others/lv_example_others.h | C | apache-2.0 | 581 |
/**
* @file lv_example_snapshot.h
*
*/
#ifndef LV_EX_SNAPSHOT_H
#define LV_EX_SNAPSHOT_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
***************... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/others/snapshot/lv_example_snapshot.h | C | apache-2.0 | 575 |
#include "../../lv_examples.h"
#if LV_USE_SNAPSHOT && LV_BUILD_EXAMPLES
static void event_cb(lv_event_t* e)
{
lv_obj_t * snapshot_obj = lv_event_get_user_data(e);
lv_obj_t * img = lv_event_get_target(e);
if(snapshot_obj) {
lv_img_dsc_t* snapshot = (void*)lv_img_get_src(snapshot_obj);
if(sn... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/others/snapshot/lv_example_snapshot_1.c | C | apache-2.0 | 2,057 |
import gc
import lvgl as lv
from imagetools import get_png_info, open_png
# Register PNG image decoder
decoder = lv.img.decoder_create()
decoder.info_cb = get_png_info
decoder.open_cb = open_png
# Measure memory usage
gc.enable()
gc.collect()
mem_free = gc.mem_free()
label = lv.label(lv.scr_act())
label.align(lv.ALI... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/others/snapshot/lv_example_snapshot_1.py | Python | apache-2.0 | 2,166 |
/**
* @file lv_port_disp_templ.c
*
*/
/*Copy this file as "lv_port_disp.c" and set this value to "1" to enable content*/
#if 0
/*********************
* INCLUDES
*********************/
#include "lv_port_disp_template.h"
#include "../../lvgl.h"
/*********************
* DEFINES
*********************/
... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/porting/lv_port_disp_template.c | C | apache-2.0 | 6,252 |
/**
* @file lv_port_disp_templ.h
*
*/
/*Copy this file as "lv_port_disp.h" and set this value to "1" to enable content*/
#if 0
#ifndef LV_PORT_DISP_TEMPL_H
#define LV_PORT_DISP_TEMPL_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lvgl/lvgl.h"
... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/porting/lv_port_disp_template.h | C | apache-2.0 | 698 |
/**
* @file lv_port_fs_templ.c
*
*/
/*Copy this file as "lv_port_fs.c" and set this value to "1" to enable content*/
#if 0
/*********************
* INCLUDES
*********************/
#include "lv_port_fs_template.h"
#include "../../lvgl.h"
/*********************
* DEFINES
*********************/
/****... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/porting/lv_port_fs_template.c | C | apache-2.0 | 7,889 |
/**
* @file lv_port_fs_templ.h
*
*/
/*Copy this file as "lv_port_fs.h" and set this value to "1" to enable content*/
#if 0
#ifndef LV_PORT_FS_TEMPL_H
#define LV_PORT_FS_TEMPL_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lvgl/lvgl.h"
/*******... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/porting/lv_port_fs_template.h | C | apache-2.0 | 688 |
/**
* @file lv_port_indev_templ.c
*
*/
/*Copy this file as "lv_port_indev.c" and set this value to "1" to enable content*/
#if 0
/*********************
* INCLUDES
*********************/
#include "lv_port_indev_template.h"
#include "../../lvgl.h"
/*********************
* DEFINES
********************... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/porting/lv_port_indev_template.c | C | apache-2.0 | 10,179 |
/**
* @file lv_port_indev_templ.h
*
*/
/*Copy this file as "lv_port_indev.h" and set this value to "1" to enable content*/
#if 0
#ifndef LV_PORT_INDEV_TEMPL_H
#define LV_PORT_INDEV_TEMPL_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lvgl/lvgl... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/porting/lv_port_indev_template.h | C | apache-2.0 | 704 |
/**
* @file lv_example_scroll.h
*
*/
#ifndef LV_EXAMPLE_SCROLL_H
#define LV_EXAMPLE_SCROLL_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
***********... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/scroll/lv_example_scroll.h | C | apache-2.0 | 738 |
#include "../lv_examples.h"
#if LV_BUILD_EXAMPLES
/**
* Demonstrate how scrolling appears automatically
*/
void lv_example_scroll_1(void)
{
/*Create an object with the new style*/
lv_obj_t * panel = lv_obj_create(lv_scr_act());
lv_obj_set_size(panel, 200, 200);
lv_obj_center(panel);
lv_obj_t * c... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/scroll/lv_example_scroll_1.c | C | apache-2.0 | 1,067 |
#
# Demonstrate how scrolling appears automatically
#
# Create an object with the new style
panel = lv.obj(lv.scr_act())
panel.set_size(200, 200)
panel.center()
child = lv.obj(panel)
child.set_pos(0, 0)
label = lv.label(child)
label.set_text("Zero")
label.center()
child = lv.obj(panel)
child.set_pos(-40, 100)
label =... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/scroll/lv_example_scroll_1.py | Python | apache-2.0 | 702 |
#include "../lv_examples.h"
#if LV_BUILD_EXAMPLES && LV_USE_FLEX
static void sw_event_cb(lv_event_t * e)
{
lv_event_code_t code = lv_event_get_code(e);
lv_obj_t * sw = lv_event_get_target(e);
if(code == LV_EVENT_VALUE_CHANGED) {
lv_obj_t * list = lv_event_get_user_data(e);
if(lv_obj_has_s... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/scroll/lv_example_scroll_2.c | C | apache-2.0 | 1,721 |
def sw_event_cb(e,panel):
code = e.get_code()
sw = e.get_target()
if code == lv.EVENT.VALUE_CHANGED:
if sw.has_state(lv.STATE.CHECKED):
panel.add_flag(lv.obj.FLAG.SCROLL_ONE)
else:
panel.clear_flag(lv.obj.FLAG.SCROLL_ONE)
#
# Show an example to scroll snap
#
pan... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/scroll/lv_example_scroll_2.py | Python | apache-2.0 | 1,105 |
#include "../lv_examples.h"
#if LV_BUILD_EXAMPLES && LV_USE_LIST
static uint32_t btn_cnt = 1;
static void float_btn_event_cb(lv_event_t * e)
{
lv_event_code_t code = lv_event_get_code(e);
lv_obj_t * float_btn = lv_event_get_target(e);
if(code == LV_EVENT_CLICKED) {
lv_obj_t * list = lv_event_get_... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/scroll/lv_example_scroll_3.c | C | apache-2.0 | 1,553 |
class ScrollExample_3():
def __init__(self):
self.btn_cnt = 1
#
# Create a list a with a floating button
#
list = lv.list(lv.scr_act())
list.set_size(280, 220)
list.center()
for btn_cnt in range(2):
list.add_btn(lv.SYMBOL.AUDIO,"Track {:d... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/scroll/lv_example_scroll_3.py | Python | apache-2.0 | 1,253 |
#include "../lv_examples.h"
#if LV_BUILD_EXAMPLES && LV_USE_LIST
/**
* Styling the scrollbars
*/
void lv_example_scroll_4(void)
{
lv_obj_t * obj = lv_obj_create(lv_scr_act());
lv_obj_set_size(obj, 200, 100);
lv_obj_center(obj);
lv_obj_t * label = lv_label_create(obj);
lv_label_set_text(label,
... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/scroll/lv_example_scroll_4.c | C | apache-2.0 | 2,970 |
#
# Styling the scrollbars
#
obj = lv.obj(lv.scr_act())
obj.set_size(200, 100)
obj.center()
label = lv.label(obj)
label.set_text(
"""
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Etiam dictum, tortor vestibulum lacinia laoreet, mi neque consectetur neque, vel mattis odio dolor egestas ligula.
Sed vestibulu... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/scroll/lv_example_scroll_4.py | Python | apache-2.0 | 2,162 |
#include "../lv_examples.h"
#if LV_BUILD_EXAMPLES && LV_FONT_DEJAVU_16_PERSIAN_HEBREW
/**
* Scrolling with Right To Left base direction
*/
void lv_example_scroll_5(void)
{
lv_obj_t * obj = lv_obj_create(lv_scr_act());
lv_obj_set_style_base_dir(obj, LV_BASE_DIR_RTL, 0);
lv_obj_set_size(obj, 200, 100);
... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/scroll/lv_example_scroll_5.c | C | apache-2.0 | 1,301 |
#
# Scrolling with Right To Left base direction
#
obj = lv.obj(lv.scr_act())
obj.set_style_base_dir(lv.BASE_DIR.RTL, 0)
obj.set_size(200, 100)
obj.center()
label = lv.label(obj)
label.set_text("میکروکُنترولر (به انگلیسی: Microcontroller) گونهای ریزپردازنده است که دارای حافظهٔ دسترسی تصادفی (RAM) و حافظهٔ فقطخواندنی ... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/scroll/lv_example_scroll_5.py | Python | apache-2.0 | 1,041 |
#include "../lv_examples.h"
#if LV_BUILD_EXAMPLES
static void scroll_event_cb(lv_event_t * e)
{
lv_obj_t * cont = lv_event_get_target(e);
lv_area_t cont_a;
lv_obj_get_coords(cont, &cont_a);
lv_coord_t cont_y_center = cont_a.y1 + lv_area_get_height(&cont_a) / 2;
lv_coord_t r = lv_obj_get_height(co... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/scroll/lv_example_scroll_6.c | C | apache-2.0 | 2,612 |
def scroll_event_cb(e):
cont = e.get_target()
cont_a = lv.area_t()
cont.get_coords(cont_a)
cont_y_center = cont_a.y1 + cont_a.get_height() // 2
r = cont.get_height() * 7 // 10
child_cnt = cont.get_child_cnt()
for i in range(child_cnt):
child = cont.get_child(i)
child_... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/scroll/lv_example_scroll_6.py | Python | apache-2.0 | 2,044 |
/**
* @file lv_example_style.h
*
*/
#ifndef LV_EXAMPLE_STYLE_H
#define LV_EXAMPLE_STYLE_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**************... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/styles/lv_example_style.h | C | apache-2.0 | 980 |
#include "../lv_examples.h"
#if LV_BUILD_EXAMPLES && LV_USE_IMG
/**
* Using the Size, Position and Padding style properties
*/
void lv_example_style_1(void)
{
static lv_style_t style;
lv_style_init(&style);
lv_style_set_radius(&style, 5);
/*Make a gradient*/
lv_style_set_width(&style, 150);... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/styles/lv_example_style_1.c | C | apache-2.0 | 759 |
#
# Using the Size, Position and Padding style properties
#
style = lv.style_t()
style.init()
style.set_radius(5)
# Make a gradient
style.set_width(150)
style.set_height(lv.SIZE.CONTENT)
style.set_pad_ver(20)
style.set_pad_left(5)
style.set_x(lv.pct(50))
style.set_y(80)
# Create an object with the new style
obj = l... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/styles/lv_example_style_1.py | Python | apache-2.0 | 413 |
#include "../lv_examples.h"
#if LV_BUILD_EXAMPLES && LV_USE_IMG
/**
* Creating a transition
*/
void lv_example_style_10(void)
{
static const lv_style_prop_t props[] = {LV_STYLE_BG_COLOR, LV_STYLE_BORDER_COLOR, LV_STYLE_BORDER_WIDTH, 0};
/* A default transition
* Make it fast (100ms) and start with some... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/styles/lv_example_style_10.c | C | apache-2.0 | 1,382 |
#
# Creating a transition
#
props = [lv.STYLE.BG_COLOR, lv.STYLE.BORDER_COLOR, lv.STYLE.BORDER_WIDTH, 0]
# A default transition
# Make it fast (100ms) and start with some delay (200 ms)
trans_def = lv.style_transition_dsc_t()
trans_def.init(props, lv.anim_t.path_linear, 100, 200, None)
# A special transition when ... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/styles/lv_example_style_10.py | Python | apache-2.0 | 946 |
#include "../lv_examples.h"
#if LV_BUILD_EXAMPLES && LV_USE_IMG
/**
* Using multiple styles
*/
void lv_example_style_11(void)
{
/*A base style*/
static lv_style_t style_base;
lv_style_init(&style_base);
lv_style_set_bg_color(&style_base, lv_palette_main(LV_PALETTE_LIGHT_BLUE));
lv_style_set_borde... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/styles/lv_example_style_11.c | C | apache-2.0 | 1,904 |
#
# Using multiple styles
#
# A base style
style_base = lv.style_t()
style_base.init()
style_base.set_bg_color(lv.palette_main(lv.PALETTE.LIGHT_BLUE))
style_base.set_border_color(lv.palette_darken(lv.PALETTE.LIGHT_BLUE, 3))
style_base.set_border_width(2)
style_base.set_radius(10)
style_base.set_shadow_width(10)
style... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/styles/lv_example_style_11.py | Python | apache-2.0 | 1,318 |
#include "../lv_examples.h"
#if LV_BUILD_EXAMPLES && LV_USE_IMG
/**
* Local styles
*/
void lv_example_style_12(void)
{
static lv_style_t style;
lv_style_init(&style);
lv_style_set_bg_color(&style, lv_palette_main(LV_PALETTE_GREEN));
lv_style_set_border_color(&style, lv_palette_lighten(LV_PALETTE_GREE... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/styles/lv_example_style_12.c | C | apache-2.0 | 627 |
#
# Local styles
#
style = lv.style_t()
style.init()
style.set_bg_color(lv.palette_main(lv.PALETTE.GREEN))
style.set_border_color(lv.palette_lighten(lv.PALETTE.GREEN, 3))
style.set_border_width(3)
obj = lv.obj(lv.scr_act())
obj.add_style(style, 0)
# Overwrite the background color locally
obj.set_style_bg_color(lv.pa... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/styles/lv_example_style_12.py | Python | apache-2.0 | 380 |
#include "../lv_examples.h"
#if LV_BUILD_EXAMPLES && LV_USE_IMG
/**
* Add styles to parts and states
*/
void lv_example_style_13(void)
{
static lv_style_t style_indic;
lv_style_init(&style_indic);
lv_style_set_bg_color(&style_indic, lv_palette_lighten(LV_PALETTE_RED, 3));
lv_style_set_bg_grad_color(&... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/styles/lv_example_style_13.c | C | apache-2.0 | 1,012 |
#
# Add styles to parts and states
#
style_indic = lv.style_t()
style_indic.init()
style_indic.set_bg_color(lv.palette_lighten(lv.PALETTE.RED, 3))
style_indic.set_bg_grad_color(lv.palette_main(lv.PALETTE.RED))
style_indic.set_bg_grad_dir(lv.GRAD_DIR.HOR)
style_indic_pr = lv.style_t()
style_indic_pr.init()
style_indic... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/styles/lv_example_style_13.py | Python | apache-2.0 | 677 |
#include "../lv_examples.h"
#if LV_BUILD_EXAMPLES && LV_USE_IMG
static lv_style_t style_btn;
/*Will be called when the styles of the base theme are already added
to add new styles*/
static void new_theme_apply_cb(lv_theme_t * th, lv_obj_t * obj)
{
LV_UNUSED(th);
if(lv_obj_check_type(obj, &lv_btn_class)) {... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/styles/lv_example_style_14.c | C | apache-2.0 | 1,614 |
# Will be called when the styles of the base theme are already added
# to add new styles
class NewTheme(lv.theme_t):
def __init__(self):
super().__init__()
# Initialize the styles
self.style_btn = lv.style_t()
self.style_btn.init()
self.style_btn.set_bg_color(lv.palette_mai... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/styles/lv_example_style_14.py | Python | apache-2.0 | 1,672 |
#include "../lv_examples.h"
#if LV_BUILD_EXAMPLES
/**
* Using the background style properties
*/
void lv_example_style_2(void)
{
static lv_style_t style;
lv_style_init(&style);
lv_style_set_radius(&style, 5);
/*Make a gradient*/
lv_style_set_bg_opa(&style, LV_OPA_COVER);
lv_style_set_bg_colo... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/styles/lv_example_style_2.c | C | apache-2.0 | 797 |
#
# Using the background style properties
#
style = lv.style_t()
style.init()
style.set_radius(5)
# Make a gradient
style.set_bg_opa(lv.OPA.COVER)
style.set_bg_color(lv.palette_lighten(lv.PALETTE.GREY, 1))
style.set_bg_grad_color(lv.palette_main(lv.PALETTE.BLUE))
style.set_bg_grad_dir(lv.GRAD_DIR.VER)
# Shift the gra... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/styles/lv_example_style_2.py | Python | apache-2.0 | 500 |
#include "../lv_examples.h"
#if LV_BUILD_EXAMPLES
/**
* Using the border style properties
*/
void lv_example_style_3(void)
{
static lv_style_t style;
lv_style_init(&style);
/*Set a background color and a radius*/
lv_style_set_radius(&style, 10);
lv_style_set_bg_opa(&style, LV_OPA_COVER);
lv_... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/styles/lv_example_style_3.c | C | apache-2.0 | 842 |
#
# Using the border style properties
#
style = lv.style_t()
style.init()
# Set a background color and a radius
style.set_radius(10)
style.set_bg_opa(lv.OPA.COVER)
style.set_bg_color(lv.palette_lighten(lv.PALETTE.GREY, 1))
# Add border to the bottom+right
style.set_border_color(lv.palette_main(lv.PALETTE.BLUE))
style... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/styles/lv_example_style_3.py | Python | apache-2.0 | 546 |
#include "../lv_examples.h"
#if LV_BUILD_EXAMPLES
/**
* Using the outline style properties
*/
void lv_example_style_4(void)
{
static lv_style_t style;
lv_style_init(&style);
/*Set a background color and a radius*/
lv_style_set_radius(&style, 5);
lv_style_set_bg_opa(&style, LV_OPA_COVER);
lv_... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/styles/lv_example_style_4.c | C | apache-2.0 | 735 |
#
# Using the outline style properties
#
style = lv.style_t()
style.init()
# Set a background color and a radius
style.set_radius(5)
style.set_bg_opa(lv.OPA.COVER)
style.set_bg_color(lv.palette_lighten(lv.PALETTE.GREY, 1))
# Add outline
style.set_outline_width(2)
style.set_outline_color(lv.palette_main(lv.PALETTE.BL... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/styles/lv_example_style_4.py | Python | apache-2.0 | 455 |
#include "../lv_examples.h"
#if LV_BUILD_EXAMPLES
/**
* Using the Shadow style properties
*/
void lv_example_style_5(void)
{
static lv_style_t style;
lv_style_init(&style);
/*Set a background color and a radius*/
lv_style_set_radius(&style, 5);
lv_style_set_bg_opa(&style, LV_OPA_COVER);
lv_s... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/styles/lv_example_style_5.c | C | apache-2.0 | 778 |
#
# Using the Shadow style properties
#
style = lv.style_t()
style.init()
# Set a background color and a radius
style.set_radius(5)
style.set_bg_opa(lv.OPA.COVER)
style.set_bg_color(lv.palette_lighten(lv.PALETTE.GREY, 1))
# Add a shadow
style.set_shadow_width(8)
style.set_shadow_color(lv.palette_main(lv.PALETTE.BLUE... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/styles/lv_example_style_5.py | Python | apache-2.0 | 481 |
#include "../lv_examples.h"
#if LV_BUILD_EXAMPLES && LV_USE_IMG
/**
* Using the Image style properties
*/
void lv_example_style_6(void)
{
static lv_style_t style;
lv_style_init(&style);
/*Set a background color and a radius*/
lv_style_set_radius(&style, 5);
lv_style_set_bg_opa(&style, LV_OPA_COV... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/styles/lv_example_style_6.c | C | apache-2.0 | 941 |
from imagetools import get_png_info, open_png
# Register PNG image decoder
decoder = lv.img.decoder_create()
decoder.info_cb = get_png_info
decoder.open_cb = open_png
# Create an image from the png file
try:
with open('../assets/img_cogwheel_argb.png','rb') as f:
png_data = f.read()
except:
print("Coul... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/styles/lv_example_style_6.py | Python | apache-2.0 | 1,034 |
#include "../lv_examples.h"
#if LV_BUILD_EXAMPLES && LV_USE_ARC
/**
* Using the Arc style properties
*/
void lv_example_style_7(void)
{
static lv_style_t style;
lv_style_init(&style);
lv_style_set_arc_color(&style, lv_palette_main(LV_PALETTE_RED));
lv_style_set_arc_width(&style, 4);
/*Create an... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/styles/lv_example_style_7.c | C | apache-2.0 | 471 |
#
# Using the Arc style properties
#
style = lv.style_t()
style.init()
style.set_arc_color(lv.palette_main(lv.PALETTE.RED))
style.set_arc_width(4)
# Create an object with the new style
obj = lv.arc(lv.scr_act())
obj.add_style(style, 0)
obj.center()
| YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/styles/lv_example_style_7.py | Python | apache-2.0 | 253 |
#include "../lv_examples.h"
#if LV_BUILD_EXAMPLES && LV_USE_LABEL
/**
* Using the text style properties
*/
void lv_example_style_8(void)
{
static lv_style_t style;
lv_style_init(&style);
lv_style_set_radius(&style, 5);
lv_style_set_bg_opa(&style, LV_OPA_COVER);
lv_style_set_bg_color(&style, lv_p... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/styles/lv_example_style_8.c | C | apache-2.0 | 986 |
#
# Using the text style properties
#
style = lv.style_t()
style.init()
style.set_radius(5)
style.set_bg_opa(lv.OPA.COVER)
style.set_bg_color(lv.palette_lighten(lv.PALETTE.GREY, 3))
style.set_border_width(2)
style.set_border_color(lv.palette_main(lv.PALETTE.BLUE))
style.set_pad_all(10)
style.set_text_color(lv.palett... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/styles/lv_example_style_8.py | Python | apache-2.0 | 609 |
#include "../lv_examples.h"
#if LV_BUILD_EXAMPLES && LV_USE_LINE
/**
* Using the line style properties
*/
void lv_example_style_9(void)
{
static lv_style_t style;
lv_style_init(&style);
lv_style_set_line_color(&style, lv_palette_main(LV_PALETTE_GREY));
lv_style_set_line_width(&style, 6);
lv_styl... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/styles/lv_example_style_9.c | C | apache-2.0 | 619 |
#
# Using the line style properties
#
style = lv.style_t()
style.init()
style.set_line_color(lv.palette_main(lv.PALETTE.GREY))
style.set_line_width(6)
style.set_line_rounded(True)
# Create an object with the new style
obj = lv.line(lv.scr_act())
obj.add_style(style, 0)
p = [ {"x":10, "y":30},
{"x":30, "y":5... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/styles/lv_example_style_9.py | Python | apache-2.0 | 387 |
#!/bin/sh
cat ../../header.py $1 > test.py
chmod +x test.py
./test.py
| YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/test_ex.sh | Shell | apache-2.0 | 70 |
#include "../../lv_examples.h"
#if LV_USE_ANIMIMG && LV_BUILD_EXAMPLES
LV_IMG_DECLARE(animimg001)
LV_IMG_DECLARE(animimg002)
LV_IMG_DECLARE(animimg003)
static const lv_img_dsc_t* anim_imgs[3] = {
&animimg001,
&animimg002,
&animimg003,
};
void lv_example_animimg_1(void)
{
lv_obj_t * animimg0 = lv_animi... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/widgets/animimg/lv_example_animimg_1.c | C | apache-2.0 | 594 |
from imagetools import get_png_info, open_png
# Register PNG image decoder
decoder = lv.img.decoder_create()
decoder.info_cb = get_png_info
decoder.open_cb = open_png
anim_imgs = [None]*3
# Create an image from the png file
try:
with open('../../assets/animimg001.png','rb') as f:
anim001_data = f.read()
e... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/widgets/animimg/lv_example_animimg_1.py | Python | apache-2.0 | 1,178 |
#include "../../lv_examples.h"
#if LV_USE_ARC && LV_BUILD_EXAMPLES
void lv_example_arc_1(void)
{
/*Create an Arc*/
lv_obj_t * arc = lv_arc_create(lv_scr_act());
lv_obj_set_size(arc, 150, 150);
lv_arc_set_rotation(arc, 135);
lv_arc_set_bg_angles(arc, 0, 270);
lv_arc_set_value(arc, 40);
lv_obj_center(arc)... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/widgets/arc/lv_example_arc_1.c | C | apache-2.0 | 332 |
# Create an Arc
arc = lv.arc(lv.scr_act())
arc.set_end_angle(200)
arc.set_size(150, 150)
arc.center()
| YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/widgets/arc/lv_example_arc_1.py | Python | apache-2.0 | 105 |
#include "../../lv_examples.h"
#if LV_USE_ARC && LV_BUILD_EXAMPLES
static void set_angle(void * obj, int32_t v)
{
lv_arc_set_value(obj, v);
}
/**
* Create an arc which acts as a loader.
*/
void lv_example_arc_2(void)
{
/*Create an Arc*/
lv_obj_t * arc = lv_arc_create(lv_scr_act());
lv_arc_set_rotation(ar... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/widgets/arc/lv_example_arc_2.c | C | apache-2.0 | 881 |
#
# An `lv_timer` to call periodically to set the angles of the arc
#
class ArcLoader():
def __init__(self):
self.a = 270
def arc_loader_cb(self,tim,arc):
# print(tim,arc)
self.a += 5
arc.set_end_angle(self.a)
if self.a >= 270 + 360:
tim._del()
#
... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/widgets/arc/lv_example_arc_2.py | Python | apache-2.0 | 679 |
#include "../../lv_examples.h"
#if LV_USE_BAR && LV_BUILD_EXAMPLES
void lv_example_bar_1(void)
{
lv_obj_t * bar1 = lv_bar_create(lv_scr_act());
lv_obj_set_size(bar1, 200, 20);
lv_obj_center(bar1);
lv_bar_set_value(bar1, 70, LV_ANIM_OFF);
}
#endif
| YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/widgets/bar/lv_example_bar_1.c | C | apache-2.0 | 265 |
bar1 = lv.bar(lv.scr_act())
bar1.set_size(200, 20)
bar1.center()
bar1.set_value(70, lv.ANIM.OFF)
| YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/widgets/bar/lv_example_bar_1.py | Python | apache-2.0 | 98 |
#include "../../lv_examples.h"
#if LV_USE_BAR && LV_BUILD_EXAMPLES
/**
* Example of styling the bar
*/
void lv_example_bar_2(void)
{
static lv_style_t style_bg;
static lv_style_t style_indic;
lv_style_init(&style_bg);
lv_style_set_border_color(&style_bg, lv_palette_main(LV_PALETTE_BLUE));
lv_sty... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/widgets/bar/lv_example_bar_2.c | C | apache-2.0 | 1,044 |
#
# Example of styling the bar
#
style_bg = lv.style_t()
style_indic = lv.style_t()
style_bg.init()
style_bg.set_border_color(lv.palette_main(lv.PALETTE.BLUE))
style_bg.set_border_width(2)
style_bg.set_pad_all(6) # To make the indicator smaller
style_bg.set_radius(6)
style_bg.set_anim_time(1000)
style_indi... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/widgets/bar/lv_example_bar_2.py | Python | apache-2.0 | 669 |
#include "../../lv_examples.h"
#if LV_USE_BAR && LV_BUILD_EXAMPLES
static void set_temp(void * bar, int32_t temp)
{
lv_bar_set_value(bar, temp, LV_ANIM_ON);
}
/**
* A temperature meter example
*/
void lv_example_bar_3(void)
{
static lv_style_t style_indic;
lv_style_init(&style_indic);
lv_style_set_... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/widgets/bar/lv_example_bar_3.c | C | apache-2.0 | 1,089 |
def set_temp(bar, temp):
bar.set_value(temp, lv.ANIM.ON)
#
# A temperature meter example
#
style_indic = lv.style_t()
style_indic.init()
style_indic.set_bg_opa(lv.OPA.COVER)
style_indic.set_bg_color(lv.palette_main(lv.PALETTE.RED))
style_indic.set_bg_grad_color(lv.palette_main(lv.PALETTE.BLUE))
style_indic.set_... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/widgets/bar/lv_example_bar_3.py | Python | apache-2.0 | 706 |
#include "../../lv_examples.h"
#if LV_USE_BAR && LV_BUILD_EXAMPLES
/**
* Bar with stripe pattern and ranged value
*/
void lv_example_bar_4(void)
{
LV_IMG_DECLARE(img_skew_strip);
static lv_style_t style_indic;
lv_style_init(&style_indic);
lv_style_set_bg_img_src(&style_indic, &img_skew_strip);
l... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/widgets/bar/lv_example_bar_4.c | C | apache-2.0 | 740 |
#
# get an icon
#
def get_icon(filename,xres,yres):
try:
sdl_filename = "../../assets/" + filename + "_" + str(xres) + "x" + str(yres) + "_argb8888.fnt"
print("file name: ", sdl_filename)
with open(sdl_filename,'rb') as f:
icon_data = f.read()
except:
print("Could not... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/widgets/bar/lv_example_bar_4.py | Python | apache-2.0 | 1,113 |
#include "../../lv_examples.h"
#if LV_USE_BAR && LV_BUILD_EXAMPLES
/**
* Bar with LTR and RTL base direction
*/
void lv_example_bar_5(void)
{
lv_obj_t * label;
lv_obj_t * bar_ltr = lv_bar_create(lv_scr_act());
lv_obj_set_size(bar_ltr, 200, 20);
lv_bar_set_value(bar_ltr, 70, LV_ANIM_OFF);
lv_obj... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/widgets/bar/lv_example_bar_5.c | C | apache-2.0 | 969 |
#
# Bar with LTR and RTL base direction
#
bar_ltr = lv.bar(lv.scr_act())
bar_ltr.set_size(200, 20)
bar_ltr.set_value(70, lv.ANIM.OFF)
bar_ltr.align(lv.ALIGN.CENTER, 0, -30)
label = lv.label(lv.scr_act())
label.set_text("Left to Right base direction")
label.align_to(bar_ltr, lv.ALIGN.OUT_TOP_MID, 0, -5)
bar_rtl = lv.... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/widgets/bar/lv_example_bar_5.py | Python | apache-2.0 | 615 |
#include "../../lv_examples.h"
#if LV_USE_BAR && LV_BUILD_EXAMPLES
static void set_value(void *bar, int32_t v)
{
lv_bar_set_value(bar, v, LV_ANIM_OFF);
}
static void event_cb(lv_event_t * e)
{
lv_obj_draw_part_dsc_t * dsc = lv_event_get_param(e);
if(dsc->part != LV_PART_INDICATOR) return;
lv_obj_t * ... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/widgets/bar/lv_example_bar_6.c | C | apache-2.0 | 2,050 |
def set_value(bar, v):
bar.set_value(v, lv.ANIM.OFF)
def event_cb(e):
dsc = lv.obj_draw_part_dsc_t.__cast__(e.get_param())
if dsc.part != lv.PART.INDICATOR:
return
obj= e.get_target()
label_dsc = lv.draw_label_dsc_t()
label_dsc.init()
# label_dsc.font = LV_FONT_DEFAULT;
value... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/widgets/bar/lv_example_bar_6.py | Python | apache-2.0 | 1,629 |
#!/opt/bin/lv_micropython -i
import lvgl as lv
import display_driver
def set_value(bar, v):
bar.set_value(v, lv.ANIM.OFF)
def event_cb(e):
dsc = lv.obj_draw_part_dsc_t.__cast__(e.get_param())
if dsc.part != lv.PART.INDICATOR:
return
obj= e.get_target()
label_dsc = lv.draw_label_dsc_t()
... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/widgets/bar/test.py | Python | apache-2.0 | 1,698 |
#include "../../lv_examples.h"
#if LV_USE_BTN && LV_BUILD_EXAMPLES
static void event_handler(lv_event_t * e)
{
lv_event_code_t code = lv_event_get_code(e);
if(code == LV_EVENT_CLICKED) {
LV_LOG_USER("Clicked");
}
else if(code == LV_EVENT_VALUE_CHANGED) {
LV_LOG_USER("Toggled");
}
}... | YifuLiu/AliOS-Things | components/py_engine/engine/lib/lv_bindings/lvgl/examples/widgets/btn/lv_example_btn_1.c | C | apache-2.0 | 1,016 |