• Administrator
  •  
    Support Ukraine
    If you experience any problems with the forum (it is not visible, there is no way to post messages, or some functionality does not work), please let us know. If you have problems with registration or you did not receive confirmation letter, let us know and we will activate your account manually.
    If you get an "The submitted form was invalid. Try submitting again" error, delete cookies, then try again.
     

Definitive Documentation for Zepp OS hmUI.createWidget()

A branch of the forum to discuss everything that is connected with Huami Zepp OS.

Moderators: asoo, Watchmens

Forum rules
All communication in this branch should only be in English.
Post Reply
wanders
Posts: 19
Joined: 02 Jul 2020, 00:06
Location: Austin TX USA
Been thanked: 1 time
Contact:

Definitive Documentation for Zepp OS hmUI.createWidget()

Post 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.
User avatar
SashaCX75
Posts: 816
Joined: 26 Oct 2019, 15:18
Location: Ukraine
Has thanked: 13 times
Been thanked: 1025 times
Contact:

Post 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/
wanders
Posts: 19
Joined: 02 Jul 2020, 00:06
Location: Austin TX USA
Been thanked: 1 time
Contact:

Post 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...
franluciani
Posts: 43
Joined: 04 Oct 2019, 16:55
Location: Argentina
Has thanked: 9 times
Been thanked: 6 times
Contact:

Post 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.
User avatar
SashaCX75
Posts: 816
Joined: 26 Oct 2019, 15:18
Location: Ukraine
Has thanked: 13 times
Been thanked: 1025 times
Contact:

Post 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.
taw_bip
WF maker
Posts: 130
Joined: 12 Apr 2018, 16:29
Has thanked: 127 times
Been thanked: 19 times
Contact:

Post by taw_bip »

You should air your complaints to the developers. You'll get better results.
https://api.huami.com/t/zepp-community-slack
wanders
Posts: 19
Joined: 02 Jul 2020, 00:06
Location: Austin TX USA
Been thanked: 1 time
Contact:

Post 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.
Last edited by wanders on 09 Apr 2024, 15:23, edited 2 times in total.
franluciani
Posts: 43
Joined: 04 Oct 2019, 16:55
Location: Argentina
Has thanked: 9 times
Been thanked: 6 times
Contact:

Post 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
User avatar
SashaCX75
Posts: 816
Joined: 26 Oct 2019, 15:18
Location: Ukraine
Has thanked: 13 times
Been thanked: 1025 times
Contact:

Post by SashaCX75 »

You can always change the displayed picture by timer
franluciani
Posts: 43
Joined: 04 Oct 2019, 16:55
Location: Argentina
Has thanked: 9 times
Been thanked: 6 times
Contact:

Post 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?
User avatar
SashaCX75
Posts: 816
Joined: 26 Oct 2019, 15:18
Location: Ukraine
Has thanked: 13 times
Been thanked: 1025 times
Contact:

Post by SashaCX75 »

The widget that is created before the others is on the bottom layer.
Post Reply

Return to “Zepp OS”

Who is online

Users browsing this forum: No registered users and 0 guests