Definitive Documentation for Zepp OS hmUI.createWidget()
Posted: 06 Apr 2024, 15:07
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):
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.
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,
});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.