How to show hourglass

I see that the built-in apps (stock, cryptocurrency…) are able to show a tiny hourglass on the upper-right corner when loading something. But I can’t find any documentation on this. Anyone knows how to do it in program?

Hello,

Regarding this hourglass icon, I need to explain to you:

  1. The hourglass icon is displayed because the application calls the API that is not yet open to the system and makes an https request
  2. Among the third-party APIs currently open, the urequests library of micropython
  • Therefore, calling the urequests library will not display the hourglass
  • If you want to do this, you can refer to the example below, where the hourglass is stored in the device as a font.
_scr.set_style_border_width(0, 0)
_scr.set_style_bg_opa(lv.OPA.TRANSP, 0)
_scr.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF)
loading_icon = lv.label(_scr)
loading_icon.set_text("\uF252") # busy icon
loading_icon.set_style_text_color(lv.color_hex(0xFCCA00), 0)
loading_icon.align(lv.ALIGN.TOP_RIGHT, 10, 30)

The hourglass icon currently only exists in these fonts:

  • font_ascii_14
  • font_ascii_16
  • font_ascii_18
  • font_icons_32

If you want to replace other images, you can refer to the following github library to generate them.

In addition, we will make the relevant API public in the third-party developer documentation later.

If you have any questions about the product, please feel free to contact us.

1 Like

Thanks for the info! I’ll give it a try.

1 Like