fix(ebike): make it work without lottie too (#7135)
This commit is contained in:
committed by
GitHub
parent
9b6f6d23f1
commit
040d293229
@@ -62,7 +62,10 @@ lv_subject_t ebike_subject_language;
|
||||
void lv_demo_ebike(void)
|
||||
{
|
||||
lv_i18n_init(lv_i18n_language_pack);
|
||||
|
||||
#if LV_USE_LOTTIE
|
||||
LV_DRAW_BUF_INIT_STATIC(lottie_ebike_draw_buf);
|
||||
#endif
|
||||
|
||||
lv_subject_init_int(&ebike_subject_language, 0);
|
||||
lv_subject_add_observer_obj(&ebike_subject_language, language_observer_cb, lv_screen_active(), NULL);
|
||||
@@ -103,10 +106,12 @@ void lv_demo_ebike(void)
|
||||
menu_bar_create();
|
||||
}
|
||||
|
||||
#if LV_USE_LOTTIE
|
||||
lv_draw_buf_t * lv_demo_ebike_get_lottie_draw_buf(void)
|
||||
{
|
||||
return &lottie_ebike_draw_buf;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
|
||||
@@ -121,7 +121,7 @@ static lv_obj_t * left_cont_create(lv_obj_t * parent)
|
||||
lv_lottie_set_src_data(stats_img, lottie_ebike_stats, lottie_ebike_stats_size);
|
||||
lv_lottie_set_draw_buf(stats_img, lv_demo_ebike_get_lottie_draw_buf());
|
||||
#else
|
||||
stat_img = lv_image_create(left_cont);
|
||||
stats_img = lv_image_create(left_cont);
|
||||
LV_IMAGE_DECLARE(img_ebike_stats_large);
|
||||
lv_image_set_src(stats_img, &img_ebike_stats_large);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user