2021-02-08 09:53:03 +01:00
|
|
|
#include "../../../lvgl.h"
|
2021-02-14 14:56:34 +01:00
|
|
|
#if LV_USE_BAR && LV_BUILD_EXAMPLES
|
2021-02-08 09:53:03 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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);
|
|
|
|
lv_style_set_bg_img_tiled(&style_indic, true);
|
|
|
|
lv_style_set_bg_img_opa(&style_indic, LV_OPA_30);
|
|
|
|
|
2021-03-25 13:36:50 +01:00
|
|
|
lv_obj_t * bar = lv_bar_create(lv_scr_act());
|
2021-03-31 19:57:14 +02:00
|
|
|
lv_obj_add_style(bar, &style_indic, LV_PART_INDICATOR);
|
2021-02-08 09:53:03 +01:00
|
|
|
|
|
|
|
lv_obj_set_size(bar, 260, 20);
|
2021-03-25 16:14:17 +01:00
|
|
|
lv_obj_center(bar);
|
2021-03-23 20:51:39 +01:00
|
|
|
lv_bar_set_mode(bar, LV_BAR_MODE_RANGE);
|
2021-02-08 09:53:03 +01:00
|
|
|
lv_bar_set_value(bar, 90, LV_ANIM_OFF);
|
|
|
|
lv_bar_set_start_value(bar, 20, LV_ANIM_OFF);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|