JohnySeven / TWatchSK

TTGO T-Watch 2020 v1 supporting Signal K features for displaying boat data and controlling devices on board.
MIT License
9 stars 1 forks source link

ENH: Wrap-around scrolling through DynamicViews #74

Open ba58smith opened 2 years ago

ba58smith commented 2 years ago

After you reach the last DynamicView when swiping, the next swipe would "wrap around" back to the Watch's home screen.

ba58smith commented 2 years ago

I found this in the LVGL forums: https://forum.lvgl.io/t/tab-view-circular-scrolling/2473/11 (If the link doesn't take you to it, look at the post from June 22, by kisvegabor.) Unfortunately, the Issue that was created to make this a formal part of LVGL was closed due to inactivity. But there are some comments in there that might be helpful: https://github.com/lvgl/lvgl/issues/1604

JohnySeven commented 2 years ago

Yesterday I was trying to get this stuff working, but we're running LVGL 7 version and this code is v8 only. So we first need to add support for v8 of LVGL and then we would be able to make this code working.

plan B: Maybe I could use what we already have with following algorithm:

We have 3 views + watch face: A B C D WF

Startup position - ( ) is fully in user view A B (WF) C D When user swipes right it will be detected (easy) and as user is scrolling to right it will move view A after D when user shows C and continues to rearrange the view that way until WF is placed to start. B WF (C) D A user continues to swipe right WF C (D) A B user continues to swipe right C D (A) B WF user continues to swipe right D A (B) WF C user swipes to left C D (A) B WF C

This way we could simulate desired outcome. Will need to test it first if there are no artifacts during scrolling.

ba58smith commented 2 years ago

So all of the views would be represented in some kind of container, and each time a swipe is detected, the views get moved within the container? Looks like it should work. RE: artifacts, you might just need to do some kind of "clear screen" before an after each swipe is completed?

JohnySeven commented 2 years ago

We will still use TileView, but we will manage it little more dynamically. But generally yes, we'll follow user and update grid as required.