arch(driver): new driver architecture with new color format support
This commit is contained in:
@@ -5,8 +5,8 @@ static void event_handler(lv_event_t * e)
|
||||
{
|
||||
lv_event_code_t code = lv_event_get_code(e);
|
||||
lv_obj_t * obj = lv_event_get_target(e);
|
||||
LV_UNUSED(obj);
|
||||
if(code == LV_EVENT_VALUE_CHANGED) {
|
||||
LV_UNUSED(obj);
|
||||
LV_LOG_USER("State: %s\n", lv_obj_has_state(obj, LV_STATE_CHECKED) ? "On" : "Off");
|
||||
}
|
||||
}
|
||||
@@ -19,19 +19,19 @@ void lv_example_switch_1(void)
|
||||
lv_obj_t * sw;
|
||||
|
||||
sw = lv_switch_create(lv_scr_act());
|
||||
lv_obj_add_event_cb(sw, event_handler, LV_EVENT_ALL, NULL);
|
||||
lv_obj_add_event(sw, event_handler, LV_EVENT_ALL, NULL);
|
||||
|
||||
sw = lv_switch_create(lv_scr_act());
|
||||
lv_obj_add_state(sw, LV_STATE_CHECKED);
|
||||
lv_obj_add_event_cb(sw, event_handler, LV_EVENT_ALL, NULL);
|
||||
lv_obj_add_event(sw, event_handler, LV_EVENT_ALL, NULL);
|
||||
|
||||
sw = lv_switch_create(lv_scr_act());
|
||||
lv_obj_add_state(sw, LV_STATE_DISABLED);
|
||||
lv_obj_add_event_cb(sw, event_handler, LV_EVENT_ALL, NULL);
|
||||
lv_obj_add_event(sw, event_handler, LV_EVENT_ALL, NULL);
|
||||
|
||||
sw = lv_switch_create(lv_scr_act());
|
||||
lv_obj_add_state(sw, LV_STATE_CHECKED | LV_STATE_DISABLED);
|
||||
lv_obj_add_event_cb(sw, event_handler, LV_EVENT_ALL, NULL);
|
||||
lv_obj_add_event(sw, event_handler, LV_EVENT_ALL, NULL);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user