sharandac / My-TTGO-Watch

A GUI named hedge for smartwatch like devices based on ESP32. Currently support for T-Watch2020 (V1,V2,V3), T-Watch2021, M5Paper, M5Core2 and native Linux support for testing.
GNU General Public License v2.0
534 stars 247 forks source link

Add support for watchface #174

Closed guyou closed 3 years ago

guyou commented 3 years ago

Would be useful to have support for watchfaces, letting user to change the look'n'feel of the main screen. Watch faces example: https://getwatchmaker.com/collection/Square Would be great to have similar possibilities.

guyou commented 3 years ago

As references:

guyou commented 3 years ago

I've just discovered a project with a HUGE collection of faces: https://twatchbuilder.com/ But the code seems quite closed...

Perhaps a sort of inspiration for a face framework.

sharandac commented 3 years ago

for play with customizing 06dbb98

spiffs content

watchface_dial.png
watchface_hour.png
watchface_hour_s.png
watchface_min.png
watchface_min_s.png
watchface_sec.png
watchface_sec_s.png

watchface_theme.json

{
  "hour": {
    "enable": true,
    "x_offset": 0,
    "y_offset": 0
  },
  "min": {
    "enable": true,
    "x_offset": 0,
    "y_offset": 0
  },
  "sec": {
    "enable": true,
    "x_offset": 0,
    "y_offset": 0
  },
  "hour_shadow": {
    "enable": true,
    "x_offset": 5,
    "y_offset": 5
  },
  "min_shadow": {
    "enable": true,
    "x_offset": 5,
    "y_offset": 5
  },
  "sec_shadow": {
    "enable": true,
    "x_offset": 5,
    "y_offset": 5
  }
}
guyou commented 3 years ago

Nice work. I understand that such faces are quite similar.

What's the next step to propose more original faces? In order to keep the idea of an fully external configuration (with files and not C/C++ extension) I can imagine two options:

For the first one, we can found reference around animated SVG: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/animate

sharandac commented 3 years ago

the current version has a little support of it. like label keyword, font size, color and format strings

look here

and it is relative easy, edit a watchface_theme.json file via web-browser and reload config vie watchface app. current implement a .tar.gz packages to load a external watchface. the star trek theme shows it

screen watchface_theme_prev

and the package for startrek theme

guyou commented 3 years ago

This is really awesome. Many thanks.

guyou commented 3 years ago

I'm looking for Watchface editors... https://v1ack.github.io/watchfaceEditor/ seems promising

guyou commented 3 years ago

Once again a big thank for this evolution. I was able to play around in order to add a K2000 comlink face. Funny!

screen2

sharandac commented 3 years ago

Very nice! I made a repro for the watchfaces. Feel free to add it. The app to install it will be coming soon.

guyou commented 3 years ago

I was thinking about such watchface-store. My feeling is that another solution is to promote one repo per watchface. This way, no potential licence issue, as each watchface is in its own repository, with the licence decided by its author (and he assumes his responsabilities). To retrieve them? Look at a GitHub topic: https://github.com/topics/my-ttgo-watch-face I'm quite sure we can build a webpage fetching all these repo and building a global watchface repository.

guyou commented 3 years ago

Hey, and I created an other one. image

sharandac commented 3 years ago

Yes, the idea is good. But then we need a definition of what the repro has to look like so that it is easy to use them. The releases do not really work well. The easiest way would be to always have the following files:

watchface.tar.gz
watchface_theme_prev_120px.png
watchface_theme_prev_60px.png
watchface_theme_prev.png

So it would be enough to set a link to the repro in the watchface_theme_list.json and there you will find these files to use them in the watchface manager I am writing. I download

https://github.com/sharandac/My-TTGO-Watchfaces/blob/main/watchface_theme_list.json

directly from the watch, which is now possible with the watch.

guyou commented 3 years ago

I really don't like the idea of hosting the archive IN the repository. In my humble opinion, it is something similar to a chicken-and-egg problem.

What about improving the watchface_theme_list.json structure, allowing an optional link to archive? For example :

[
{ "name": "gameboy",
  "url": "https://raw.githubusercontent.com/guyou/my-ttgo-watch-face-gameboy/main/",
  "download": "https://github.com/guyou/my-ttgo-watch-face-gameboy/releases/latest/download/watchface.tar.gz"
},{...}
]

I will work on a script to collect all repos with the given topic and build this list.

sharandac commented 3 years ago

Ok, I understand. Sounds logical. I'm just finishing the first version to try it out. After that, we'll rebuild it accordingly.

sharandac commented 3 years ago

And almost forgotten! Thank you for your constructive help with this project!

guyou commented 3 years ago

And almost forgotten! Thank you for your constructive help with this project!

Thank you you for maintaining this project and keeping it really active.