Open FourLeafTec opened 10 hours ago
Your code doesn't work in all cases. It works only if expression for Hidden flag or Disabled state is simple expression where only native variable is used. But expression can be anything, at least if you are using EEZ Flow.
Alternative way to prevent flickering is to call ui_tick()
not only in a loop after lv_timer_handler
or lv_task_handler
, but also immediately after calling ui_init()
If the variable is only used in the tick function, screen switching may cause state flickering. Initially, the widget state is the default lvgl state, and it won't switch to the variable-specified state until the next tick, resulting in flickering.
Therefore, it's necessary to get the variable value and set the state once during screen creation.
As shown in the image below.