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.

Модератори: asoo, Watchmens

Правила форуму
All communication in this branch should only be in English.
Відповісти
wanders
Повідомлень: 19
З нами з: 02 липня 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 жовтня 2019, 15:18
Звідки: Ukraine
Has thanked: 15 times
Been thanked: 1044 times
Контактна інформація:

Повідомлення 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 липня 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 жовтня 2019, 16:55
Звідки: Argentina
Has thanked: 9 times
Been thanked: 6 times
Контактна інформація:

Повідомлення 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 жовтня 2019, 15:18
Звідки: Ukraine
Has thanked: 15 times
Been thanked: 1044 times
Контактна інформація:

Повідомлення 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 квітня 2018, 16:29
Has thanked: 134 times
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 липня 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.
Востаннє редагувалось 09 квітня 2024, 15:23 користувачем wanders, всього редагувалось 2 разів.
franluciani
Повідомлень: 43
З нами з: 04 жовтня 2019, 16:55
Звідки: Argentina
Has thanked: 9 times
Been thanked: 6 times
Контактна інформація:

Повідомлення franluciani »

SashaCX75 писав: 07 квітня 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 жовтня 2019, 15:18
Звідки: Ukraine
Has thanked: 15 times
Been thanked: 1044 times
Контактна інформація:

Повідомлення SashaCX75 »

You can always change the displayed picture by timer
franluciani
Повідомлень: 43
З нами з: 04 жовтня 2019, 16:55
Звідки: Argentina
Has thanked: 9 times
Been thanked: 6 times
Контактна інформація:

Повідомлення franluciani »

SashaCX75 писав: 09 квітня 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 жовтня 2019, 15:18
Звідки: Ukraine
Has thanked: 15 times
Been thanked: 1044 times
Контактна інформація:

Повідомлення SashaCX75 »

The widget that is created before the others is on the bottom layer.
Відповісти

Повернутись до “Zepp OS”

Хто зараз онлайн

Зараз переглядають цей форум: Немає зареєстрованих користувачів і 1 гість