CoretechR / OMOTE

Open Source Remote Using ESP32 and LVGL
https://hackaday.io/project/191752
GNU General Public License v3.0
1.31k stars 128 forks source link

Assist function for MQTT messages #73

Closed JustMe-NL closed 5 months ago

JustMe-NL commented 5 months ago

The two functions at the end of guiMemoryOptimizer can be used to determine if the widgets on the tab you want to update are currently loaded into memory or visible on screen.

When a MQTT message arrives and you will want to update the gui accordingly, you need to know if the gui is loaded into memory and/or visible at this moment. These functions can then be called from the gui itself to check if an immediate update is needed/possible.

The other updates in guiMemoryOptimizer and guiBase change the behaviour of the panelindicators: when you click the middle panelindicator everything is the same as it was, you open the scene selector. But if you click on the partially visible indicators next to the current active panel this creates a opposite swipe gesture effect. So if you click on the right indicator, the next screen to the right swipes in view (if available) and vice versa for the left.

This is an addition to the swiping gestures so you can swipe and click.

KlausMu commented 5 months ago

Hi @JustMe-NL I like the idea of navigating to prev and next gui with the pageIndicator.

I created a new PR. This PR is using two new commands. These commands can also be bind to hardware keys.

I think, this new PR covers all of your PR and is more versatile because of the commands being used.

I also added a function bool gui_memoryOptimizer_isGUInameInMemory(std::string guiName), although it is not yet used. But maybe some people find it useful.

Could you please test it if it fits to your needs? https://github.com/CoretechR/OMOTE/pull/75