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.

版主: asooWatchmens

版面规则
All communication in this branch should only be in English.
回复
wanders
帖子: 19
注册时间: 02 7月 2020, 00:06
来自: Austin TX USA
Been thanked: 1 time
联系:

Definitive Documentation for Zepp OS hmUI.createWidget()

帖子 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

代码: 全选

            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.
头像
SashaCX75
帖子: 831
注册时间: 26 10月 2019, 15:18
来自: Ukraine
Has thanked: 15 time
Been thanked: 1044 time
联系:

帖子 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
帖子: 19
注册时间: 02 7月 2020, 00:06
来自: Austin TX USA
Been thanked: 1 time
联系:

帖子 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
帖子: 43
注册时间: 04 10月 2019, 16:55
来自: Argentina
Has thanked: 9 time
Been thanked: 6 time
联系:

帖子 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.
头像
SashaCX75
帖子: 831
注册时间: 26 10月 2019, 15:18
来自: Ukraine
Has thanked: 15 time
Been thanked: 1044 time
联系:

帖子 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
帖子: 136
注册时间: 12 4月 2018, 16:29
Has thanked: 134 time
Been thanked: 21 time
联系:

帖子 taw_bip »

You should air your complaints to the developers. You'll get better results.
https://api.huami.com/t/zepp-community-slack
wanders
帖子: 19
注册时间: 02 7月 2020, 00:06
来自: Austin TX USA
Been thanked: 1 time
联系:

帖子 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.
上次由 wanders 在 09 4月 2024, 15:23,总共编辑 2 次。
franluciani
帖子: 43
注册时间: 04 10月 2019, 16:55
来自: Argentina
Has thanked: 9 time
Been thanked: 6 time
联系:

帖子 franluciani »

SashaCX75 写了: 07 4月 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
头像
SashaCX75
帖子: 831
注册时间: 26 10月 2019, 15:18
来自: Ukraine
Has thanked: 15 time
Been thanked: 1044 time
联系:

帖子 SashaCX75 »

You can always change the displayed picture by timer
franluciani
帖子: 43
注册时间: 04 10月 2019, 16:55
来自: Argentina
Has thanked: 9 time
Been thanked: 6 time
联系:

帖子 franluciani »

SashaCX75 写了: 09 4月 2024, 16:55
You can always change the displayed picture by timer
Yes, but how can i manage the order of layers?
头像
SashaCX75
帖子: 831
注册时间: 26 10月 2019, 15:18
来自: Ukraine
Has thanked: 15 time
Been thanked: 1044 time
联系:

帖子 SashaCX75 »

The widget that is created before the others is on the bottom layer.
回复

回到 “Zepp OS”

在线用户

正浏览此版面之用户: 没有注册用户 和 1 访客