3 ms·
C is neat but something like python may be simpler to work with for most programmers. I wonder if anyone here has experience with Kivy and KivyMD libraries for
by pkphilip 2y ago
C is neat but something like python may be simpler to work with for most programmers. I wonder if anyone here has experience with Kivy and KivyMD libraries for python.
The code is simple and self explanatory.
class RectangleFlatButton(TouchRippleBehavior, Button):
primary_color = get_color_from_hex("#EB8933")
def on_touch_down(self, touch):
collide_point = self.collide_point(touch.x, touch.y)
if collide_point:
touch.grab(self)
self.ripple_show(touch)
return True
return False
def on_touch_up(self, touch):
if touch.grab_current is self:
touch.ungrab(self)
self.ripple_fade()
return True
return False
class MainApp(App):
def build(self):
screen = Builder.load_string(KV)
screen.add_widget(
RectangleFlatButton(
text="Hello, World",
pos_hint={"center_x": 0.5, "center_y": 0.5},
size_hint=(None, None),
size=(dp(110), dp(35)),
ripple_color=(0.8, 0.8, 0.8, 0.5),
)
)
return screen
MainApp().run()
- intrepidhero 2y agoI built a simple kivy app a few years. Working with kivy and testing on my (linux) dev machine was great. Even side loading to test on my phone using the kivy launcher wasn't too bad. The pain point was that building APKs that the play store would accept was an ordeal and then when they change requirements you have to hope the kivy folks update their build tools in time to recompile with a new version of the NDK before google delists your app.
- pkphilip 2y agoThank you. Wasn't aware of that.