kivy

Handling app suspend/resume on Android in Kivy

浪子不回头ぞ 提交于 2020-07-08 13:37:45
问题 I started developing an app with Kivy for Android and managed to build and run an APK today. Couldn't find a straight answer on how to handle my app being suspended and resumed by a user without going through the initialization/loading screen? Is there a special mechanism that will handle this? It is rather annoying that every time I send the app to the background and bring focus back to it there is that loading screen popping up. 回答1: I have never used Kivy or developed for android, but I

Kivy Python TextInput display Bubble

两盒软妹~` 提交于 2020-07-07 11:12:48
问题 I am trying to display numeric keyboard in bubble for TextInput in Kivy. Is it possible? So far I have: Builder.load_string(''' <NumericKeyboard> size_hint: (None, None) size: (160, 120) pos_hint: {'center_x': .5, 'y': .6} BubbleButton: text: 'Cut' BubbleButton: text: 'Copy' BubbleButton: text: 'Paste' ''') class NumericKeyboard(Bubble): pass class CustomTextInput(TextInput): def __init__(self, **kwargs): super(CustomTextInput, self).__init__(**kwargs) def on_focus(self, instance, value):

Kivy Python TextInput display Bubble

萝らか妹 提交于 2020-07-07 11:12:43
问题 I am trying to display numeric keyboard in bubble for TextInput in Kivy. Is it possible? So far I have: Builder.load_string(''' <NumericKeyboard> size_hint: (None, None) size: (160, 120) pos_hint: {'center_x': .5, 'y': .6} BubbleButton: text: 'Cut' BubbleButton: text: 'Copy' BubbleButton: text: 'Paste' ''') class NumericKeyboard(Bubble): pass class CustomTextInput(TextInput): def __init__(self, **kwargs): super(CustomTextInput, self).__init__(**kwargs) def on_focus(self, instance, value):

Kivy Python TextInput display Bubble

大兔子大兔子 提交于 2020-07-07 11:12:33
问题 I am trying to display numeric keyboard in bubble for TextInput in Kivy. Is it possible? So far I have: Builder.load_string(''' <NumericKeyboard> size_hint: (None, None) size: (160, 120) pos_hint: {'center_x': .5, 'y': .6} BubbleButton: text: 'Cut' BubbleButton: text: 'Copy' BubbleButton: text: 'Paste' ''') class NumericKeyboard(Bubble): pass class CustomTextInput(TextInput): def __init__(self, **kwargs): super(CustomTextInput, self).__init__(**kwargs) def on_focus(self, instance, value):

Pyjnius import jar file

*爱你&永不变心* 提交于 2020-07-05 07:15:52
问题 Pyjnius allows you to create a python wrapper for java classes like: Hardware = autoclass('org.myapp.Hardware') Is there a way to import an existing *.jar file like that? What does the syntax look like? 回答1: You can add the jar into CLASSPATH, then import pyjnius and use autoclass as normal :-): import os os.environ['CLASSPATH'] = "path/to/your.jar" from jnius import autoclass Bla = autoclass('bla.bla.BlaClass') 回答2: As much as jar file relevant only for android, you need to add jar file in

Pyjnius import jar file

拜拜、爱过 提交于 2020-07-05 07:15:49
问题 Pyjnius allows you to create a python wrapper for java classes like: Hardware = autoclass('org.myapp.Hardware') Is there a way to import an existing *.jar file like that? What does the syntax look like? 回答1: You can add the jar into CLASSPATH, then import pyjnius and use autoclass as normal :-): import os os.environ['CLASSPATH'] = "path/to/your.jar" from jnius import autoclass Bla = autoclass('bla.bla.BlaClass') 回答2: As much as jar file relevant only for android, you need to add jar file in

Cannot install Kivy (windows 10, python 3.8)

大兔子大兔子 提交于 2020-07-03 13:42:30
问题 I am having a great deal of trouble installing kivy on my system. I have had this working before but for some reason am having an extremely hard time right now. I follow the directions verbatim, setting up a virtualenv, activating the env, installing the dependencies (docutils, pygments, pypiwin32, kivy_deps.sdl2==0.1*., kivy_deps.glew==0.1*., kivy_deps.gstreamer==0.1.*). all of that part above works fine. when i finally go to install kivy (py -m pip install kivy), i get a barrage of errors:

How to open a pdf within Python Kivy app?

南楼画角 提交于 2020-07-03 11:42:34
问题 I've searched about this but found nothing. Only opening images has documented. Maybe I can open a page as an image but I want full access on text like copy/paste and highlighting. Is there any way to open a pdf within a kivy app? 回答1: This is not supported by Kivy. PDF rendering and interaction is quite complicated, I don't know how difficult it would be to implement. 来源: https://stackoverflow.com/questions/61145384/how-to-open-a-pdf-within-python-kivy-app

How to open a pdf within Python Kivy app?

送分小仙女□ 提交于 2020-07-03 11:42:30
问题 I've searched about this but found nothing. Only opening images has documented. Maybe I can open a page as an image but I want full access on text like copy/paste and highlighting. Is there any way to open a pdf within a kivy app? 回答1: This is not supported by Kivy. PDF rendering and interaction is quite complicated, I don't know how difficult it would be to implement. 来源: https://stackoverflow.com/questions/61145384/how-to-open-a-pdf-within-python-kivy-app

Can you wrap lines in a kivy file?

橙三吉。 提交于 2020-06-28 08:08:06
问题 I have a couple of lines in my kv. file that are really long (80+ chars), and I was wondering if there was a way to wrap/continue them on the next line. For example, how do I go from this Line: points: self.pos[0] + 5, self.pos[1] + 2, self.pos[0] + self.width - 5, self.pos[1] + 2 to Line: points: self.pos[0] + 5, self.pos[1] + 2, self.pos[0] + self.width - 5, self.pos[1] + 2 or something similar. 回答1: Acording to https://kivy.org/docs/api-kivy.lang.html#valid-expressons, you can use line