Page 1 of 1

Definitive Documentation for Zepp OS hmUI.createWidget()

Posted: 06 Apr 2024, 15:07
by wanders
I'm clearly at sea regarding ZeppOS's hmUI.createWidget() documentation. I cannot find any authoritative specification regarding the specialized widgets that are typical for watchfaces. In particular, I cannot find complete specification for the type parameter.

Here's an example generated by @SashaCX75 's excellent Watch_Face_Editor_(ZeppOS):
Spoiler

Code: Select all

            normal_distance_current_text_font = hmUI.createWidget(hmUI.widget.TEXT_FONT, {
              x: 100,
              y: 285,
              w: 100,
              h: 35,
              text_size: 35,
              char_space: 0,
              line_space: 0,
              font: 'fonts/NotoSans-ExtraCondensedMedium.ttf',
              color: 0xFFFFFFFF,
              align_h: hmUI.align.CENTER_H,
              align_v: hmUI.align.CENTER_V,
              unit_type: 1,
              text_style: hmUI.text_style.ELLIPSIS,
              type: hmUI.data_type.DISTANCE,
              show_level: hmUI.show_level.ONLY_NORMAL,
            });
This widget is more than a static text widget. By specifying the type as hmUI.data_type.DISTANCE, more than just the size of the data returned is specified. There is an implicit callback function that updates the widget as the distance value changes (i.e. an implicit DISTANCE sensor is invoked). Moreover, there is a unit_type parameter which presumably indicates how to append a unit tag to the string.

My quest is to find documentation for the created widget's behavior for the complete set of type parameters. Where can I find the definitive specs for hmUI.createWidget() and the widgets that it creates? I've looked in the usual places (here, and even here) and, frankly, I need more.

Re: Definitive Documentation for Zepp OS hmUI.createWidget()

Posted: 06 Apr 2024, 15:50
by SashaCX75
Not everything is in the documentation. I can only assume that some widget types that are not very stable are not included in the documentation.
TEXT_FONT widget is something between TEXT_IMG and TEXT widgets.
You can read about data types here
https://docs.zepp.com/docs/watchface/ap ... data_type/

Re: Definitive Documentation for Zepp OS hmUI.createWidget()

Posted: 06 Apr 2024, 15:57
by wanders
@SashaCX75 , you've made my point: "Not everything is in the documentation". That means that ZeppOS is a TOY operating system, and that makes it frustrating to work with. Heck, the fact that they host their documentation on github implies that they expect their users to either fix the docs, or at least review and complain.

I suppose that I'll make some requests at github...

Re: Definitive Documentation for Zepp OS hmUI.createWidget()

Posted: 07 Apr 2024, 13:05
by franluciani
Hi, i have the same problem. I saw that you can do an analog clock with hands that move continusly, but i didn't find that in official Zepp docs. It's frustrating becuase i don't know how to program that.

Re: Definitive Documentation for Zepp OS hmUI.createWidget()

Posted: 07 Apr 2024, 13:38
by SashaCX75
@franluciani
There are several types of smooth second hand in the editor. The most reliable ones use animation. There is a description of animation in the documentation.

Re: Definitive Documentation for Zepp OS hmUI.createWidget()

Posted: 07 Apr 2024, 21:31
by taw_bip
You should air your complaints to the developers. You'll get better results.
https://api.huami.com/t/zepp-community-slack

Re: Definitive Documentation for Zepp OS hmUI.createWidget()

Posted: 08 Apr 2024, 15:56
by wanders
Thanks, @taw_bip , for the suggestion. I've pinged the developers on Slack.

EDIT: I've been informed that the "watch face API" is not maintained, per a Slack user by the handle of Silver. I've suggested that said API be put onto github and managed by a volunteer. We'll see.

EDIT #2: I got another response from Myoung XUE @ Zepp Health, evidently a part of the Zepp OS maintainer group, who said:
This is a very good suggestion. We have recently considered improving the documentation of the Watchface part and will supplement the content you mentioned. Please give us some time.
Again, we shall see.

Re: Definitive Documentation for Zepp OS hmUI.createWidget()

Posted: 08 Apr 2024, 23:17
by franluciani
SashaCX75 wrote: 07 Apr 2024, 13:38
@franluciani
There are several types of smooth second hand in the editor. The most reliable ones use animation. There is a description of animation in the documentation.
Thank you for your comment. Anyway i ask if you know how to show 60 icons for the seconds, and fill each icon with color when the secconds passes.

Thank you in advance

Re: Definitive Documentation for Zepp OS hmUI.createWidget()

Posted: 09 Apr 2024, 16:55
by SashaCX75
You can always change the displayed picture by timer

Re: Definitive Documentation for Zepp OS hmUI.createWidget()

Posted: 14 Apr 2024, 00:02
by franluciani
SashaCX75 wrote: 09 Apr 2024, 16:55
You can always change the displayed picture by timer
Yes, but how can i manage the order of layers?

Re: Definitive Documentation for Zepp OS hmUI.createWidget()

Posted: 14 Apr 2024, 07:25
by SashaCX75
The widget that is created before the others is on the bottom layer.