'Time stamp with progress bar with kivyMD
Hello fellow stackers I am making a meditation app with kivyMD, and I'm wondering how to add a time stamp to the progress bar. The same time stamp you would see on any music app for example: 0:00 - 0:00, thanks and have a good one.
here is my python code:
def update_progress(self, dt):
if self.progress < self.length:
self.progress += 1 # Update value.
else: # End case.
self.progress = 0 # Reset value.
self.prog_ev.cancel() # Stop updating.
kivy file:
MDIconButton:
id: my_sound
icon: "pause" if root.progress else "play"
user_font_size: 150
pos_hint: {"center_x": .5, "center_y": .2}
on_press:
root.play_sound()
MDProgressBar:
id: progress_bar
size_hint: .8, .5
pos_hint: {"center_x": .5, "center_y": .3}
min: 0
max: root.length
value: root.progress
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
