0

I'm developing a Kodi add-on and while waiting for fetch data from api I want to show that default kodi spinning circle with darker background. Now I'm using .DialogProgress() function when waiting but it looks kinda weird. I can't find anything related with that in Kodi docs.

What function I should use?

Jamiu S.
  • 5,257
  • 5
  • 12
  • 34

1 Answers1

0

Something like this:

from contextlib import contextmanager

from xbmc import executebuiltin


@contextmanager
def busy_spinner():
    """
    Show busy spinner for long operations
    This context manager guarantees that a busy spinner will be closed
    even in the event of an unhandled exception.
    """
    executebuiltin('ActivateWindow(10138)')  # Busy spinner on
    try:
        yield
    finally:
        executebuiltin('Dialog.Close(10138)')  # Busy spinner off



with bysy_spinner():
    some_long_operation()
Roman Miroshnychenko
  • 1,496
  • 1
  • 10
  • 16