Created
March 27, 2019 21:55
-
-
Save tshirtman/47b7b18855b38de3730e081682c558ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kivy.app import App | |
from kivy.lang import Builder | |
from jnius import autoclass | |
from android.runnable import run_on_ui_thread | |
KV = ''' | |
FloatLayout: | |
TextInput: | |
size_hint: .5, None | |
height: min(self.minimum_height, 800) | |
pos_hint: {'center': (.5, .5)} | |
''' | |
class Application(App): | |
def build(self): | |
self._set_keyboard() | |
return Builder.load_string(KV) | |
@run_on_ui_thread | |
def _set_keyboard(self): | |
python_activity = autoclass('org.kivy.android.PythonActivity').mActivity | |
window = python_activity.getWindow() | |
window.setSoftInputMode(16) # SOFT_INPUT_ADJUST_RESIZE | |
if __name__ == '__main__': | |
Application().run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment