mirror of
https://github.com/lvgl/lvgl.git
synced 2026-06-01 00:51:49 +08:00
add examples + refactoring
This commit is contained in:
@@ -8,11 +8,10 @@ void lv_example_imgbtn_1(void)
|
||||
LV_IMG_DECLARE(imgbtn_right);
|
||||
LV_IMG_DECLARE(imgbtn_mid);
|
||||
|
||||
|
||||
/* Create a transition animation on width transformation.*/
|
||||
static lv_style_prop_t tr_prop[] = {LV_STYLE_TRANSFORM_WIDTH, 0};
|
||||
/* Create a transition animation on width transformation and recolor.*/
|
||||
static lv_style_prop_t tr_prop[] = {LV_STYLE_TRANSFORM_WIDTH, LV_STYLE_IMG_RECOLOR_OPA, 0};
|
||||
static lv_style_transition_dsc_t tr;
|
||||
lv_style_transition_dsc_init(&tr, tr_prop, &lv_anim_path_def, 300, 0);
|
||||
lv_style_transition_dsc_init(&tr, tr_prop, &lv_anim_path_def, 200, 0);
|
||||
|
||||
static lv_style_t style_def;
|
||||
lv_style_init(&style_def);
|
||||
|
||||
@@ -31,7 +31,7 @@ void lv_example_tileview_1(void)
|
||||
/*Tile3: a list*/
|
||||
lv_obj_t * tile3 = lv_tileview_add_tile(tv, 1, 1, LV_DIR_LEFT);
|
||||
lv_obj_t * list = lv_list_create(tile3);
|
||||
lv_obj_set_size(list, LV_COORD_PCT(100), LV_COORD_PCT(100));
|
||||
lv_obj_set_size(list, LV_SIZE_PCT(100), LV_SIZE_PCT(100));
|
||||
|
||||
lv_list_add_btn(list, NULL, "One", NULL);
|
||||
lv_list_add_btn(list, NULL, "Two", NULL);
|
||||
|
||||
Reference in New Issue
Block a user