• Administrador
  •  
    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.

Moderadores: asoo, Watchmens

Reglas del Foro
All communication in this branch should only be in English.
Responder
wanders
Mensajes: 19
Registrado: 02 Jul 2020, 00:06
Ubicación: Austin TX USA
Been thanked: 1 time
Contactar:

Definitive Documentation for Zepp OS hmUI.createWidget()

Mensaje por 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

Código: Seleccionar todo

            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.
Avatar de Usuario
SashaCX75
Mensajes: 823
Registrado: 26 Oct 2019, 15:18
Ubicación: Ukraine
Has thanked: 13 times
Been thanked: 1036 times
Contactar:

Mensaje por 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
Mensajes: 19
Registrado: 02 Jul 2020, 00:06
Ubicación: Austin TX USA
Been thanked: 1 time
Contactar:

Mensaje por 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
Mensajes: 43
Registrado: 04 Oct 2019, 16:55
Ubicación: Argentina
Has thanked: 9 times
Been thanked: 6 times
Contactar:

Mensaje por 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.
Avatar de Usuario
SashaCX75
Mensajes: 823
Registrado: 26 Oct 2019, 15:18
Ubicación: Ukraine
Has thanked: 13 times
Been thanked: 1036 times
Contactar:

Mensaje por 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
Mensajes: 131
Registrado: 12 Abr 2018, 16:29
Has thanked: 128 times
Been thanked: 19 times
Contactar:

Mensaje por taw_bip »

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

Mensaje por 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.
Última edición por wanders el 09 Abr 2024, 15:23, editado 2 veces en total.
franluciani
Mensajes: 43
Registrado: 04 Oct 2019, 16:55
Ubicación: Argentina
Has thanked: 9 times
Been thanked: 6 times
Contactar:

Mensaje por franluciani »

SashaCX75 escribió: 07 Abr 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
Avatar de Usuario
SashaCX75
Mensajes: 823
Registrado: 26 Oct 2019, 15:18
Ubicación: Ukraine
Has thanked: 13 times
Been thanked: 1036 times
Contactar:

Mensaje por SashaCX75 »

You can always change the displayed picture by timer
franluciani
Mensajes: 43
Registrado: 04 Oct 2019, 16:55
Ubicación: Argentina
Has thanked: 9 times
Been thanked: 6 times
Contactar:

Mensaje por franluciani »

SashaCX75 escribió: 09 Abr 2024, 16:55
You can always change the displayed picture by timer
Yes, but how can i manage the order of layers?
Avatar de Usuario
SashaCX75
Mensajes: 823
Registrado: 26 Oct 2019, 15:18
Ubicación: Ukraine
Has thanked: 13 times
Been thanked: 1036 times
Contactar:

Mensaje por SashaCX75 »

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

Volver a “Zepp OS”

¿Quién está conectado?

Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 1 invitado