Making a progress bar?browsing

Context: I’m pretty experienced with Python, but new to Pythonista and iOS dev.

I have a SiriShortcut that needs a UI. It’s a yoga timer that takes a list off poses and times, and reads each pose and waits for the duration. I’d like to switch to using Pythonista in order to have the pose name visible.

I can make the basic UI and process the list, but I’m not sure how to make a visible progress bar. It seems like this should be a standard UI element but I’m not finding anything in the docs.

What you probably want to do is take a custom View class, with a custom draw() methos, which strokes a rect outline, then fills a narrower rect, based on a fractional width value. Or, draw N unfilled and M filled rectangles, etc. You would have a value property which when set, sets the internal attribute, then calls set_needs_display.

You could also install ui2 and use ProgressPathView. This allows any sort of path to be used as a progress bar.

@chriscioffi I use two ui.Labels, one in the back with a text and a second one without text but with an half transparent background with the same height as the first label and with a width varying in function of the progress...