You would need to install kivyMD and Kivy. Use the MDApp to create your main App class. You can mix kivy widgets with KivyMD widgets.
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/74dcada2-b7e3-4e44-805a-e175c78055b7n%40googlegroups.com.
And do you know how can I input some specific values under each day in the calendar? Like when I click on a day I can see text that I wrote?
The datepicker is used for selecting dates. It does not have that capability. You would need to create that capability.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/5dfa37f3-d46b-4c6c-8a0a-401ffeddf80bn%40googlegroups.com.
Share a complete (minimal) runnable example that demonstrates the issue.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/cd09813d-0d6d-457e-9255-363a3c61b81dn%40googlegroups.com.
Looking at the source code for kivymd_extensions, you need to add an import to register all of the widgets.
import kivymd_extensions.akivymd # this import registers the widgets in kv
You also need to define the initial x_values and y_values in the bar chart. I have added them to your kv code.
import kivy
kivy.require('2.0.0')
# import kivy.core.text
# import numpy as np
# import time
# import PoseModule as pm
# import cv2
# from kivy.app import App
# from kivy.uix.widget import Widget
# from kivy.base import EventLoop
from kivy.lang import Builder
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.uix.boxlayout import BoxLayout
from kivymd.app import MDApp
import kivymd_extensions.akivymd # this import registers the widgets in kv
# from kivy.core.window import Window
from kivy.uix.image import Image
# from kivy.graphics.texture import Texture
from kivy.clock import Clock
# detector = pm.PoseDetector()
class WindowManager(ScreenManager):
pass
class Menu(Screen):
pass
class KivyCamera(Image):
def __init__(self, **kwargs):
super(KivyCamera, self).__init__(**kwargs)
self.cap = None
self.counter = 0
self.direction = 0
self.event = None
def start(self, cap, fps=30):
self.cap = cap
self.event = Clock.schedule_interval(self.update, 1.0 / fps)
def stop(self):
if self.event:
Clock.unschedule(self.event)
self.cap = None
def update(self, dt):
### (just cv2 functions)
pass
class WorkingScreen(Screen, BoxLayout):
def init_qrtest(self):
pass
def dostart(self, *largs):
# global cap
# cap = cv2.VideoCapture(0)
# self.ids.qrcam.start(cap)
pass
def doexit(self):
# global cap
# self.ids.qrcam.stop()
pass
class Calendar(Screen):
def show_cal(self):
chart = self.root.ids.chart
chart.x_values = [1, 2, 3, 4, 5]
chart.y_values = [2, 4, 6, 8, 10]
class MyMainApp(MDApp):
def build(self):
return Builder.load_file("my.kv")
if __name__ == '__main__':
MyMainApp().run()
Kv Code:
"280dp"
x_values: [1, 2, 3, 4, 5]
y_values: [2, 4, 6, 8, 10]
GridLayout:
cols: 1
size_hint: 1, 0.2
Button:
size_hint: 0.25, 0.25
pos_hint: {"x": 0.4, "y": 0.01}
text: "Go Back"
on_release:
app.root.current = "Menu"
root.manager.transition.direction = "right"
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/0f14122f-ed63-4030-a866-db7308a95b19n%40googlegroups.com.
You can choose to do what you want – But I downloaded and installed the extension, made the changes and ran your code, with the changed below.

To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/783087df-44df-4132-9b94-ba11686ee5a3n%40googlegroups.com.
Here is an example of using Clock and Kivy properties to set values, and also setting values by writing to widget attributes.
from kivy.app import App
from kivy.lang import Builder
from kivy.clock import Clock
from kivy.uix.label import Label
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import StringProperty, NumericProperty
from time import asctime
kv = """
<TimeLabel>:
text: self.time
font_size: 40
RootBoxLayout:
orientation: 'vertical'
TimeLabel:
Label:
text: 'Count Down Timer'
font_size: 30
ProgressBar:
id: progress_bar
min: 0
max: 100
size_hint_y: None
height: 24
size_hint_x: .8
pos_hint: {'center_x': 0.5}
Label:
text: str(root.count_down)
font_size: 30
size_hint_y: None
height: 96
Button:
text: 'Start'
size_hint_y: None
height: 48
on_release: root.start_count_down()
disabled: root.count > 0
"""
class TimeLabel(Label):
time = StringProperty(asctime())
def on_kv_post(self, base_widget):
Clock.schedule_interval(self.update_time, 1)
def update_time(self, dt):
self.time = asctime()
class RootBoxLayout(BoxLayout):
count_down = NumericProperty(10)
count = NumericProperty()
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.schedule = None
def start_count_down(self):
self.schedule = Clock.schedule_interval(self._update, .1)
def _update(self, dt):
if self.count > 100: # 100 * .1 is 10 sec
self.schedule.cancel()
self.schedule = None
self.ids.progress_bar.value = self.count = 0
self.count_down = 10
else:
self.count += 1
self.ids.progress_bar.value = self.count
if not self.count % 10:
self.count_down -= 1
class ProgressDemoApp(App):
def build(self):
return Builder.load_string(kv)
ProgressDemoApp().run()
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/52f288e8-bf56-4694-8cae-bf19f8c32d42n%40googlegroups.com.