Kivy keyboard height - android

For an app I'm creating in Kivy I would like to know the height of the keyboard, so I can position the widgets accordingly. I heard plyer (https://github.com/kivy/plyer) is good for cross-platform (I wish to develop for Android and iOS (and Windows phone)), however it seems it doesn't cover keyboard control.
How can I get the information about the height of the keyboard in Android (and iOS)? I program in Python 3 (2.7 would help as well if you don't know it in Python 3). Hardcoded keyboard height would be bad, as keyboard heights differ.

The master branch contains some new additions that let you manage this. Using Window (from kivy.core.window import Window) you have:
Window.keyboard_height gives the current height of the software keyboard
Window.softinput_mode can be any of '' (empty) in which case you can use keyboard_height as above, 'pan' in which case the kivy view is shifted upwards so the keyboard doesn't overlap, or 'resize' in which the kivy view is resized to fit the space between the keyboard top and the top of the screen.
These are in the doc for Window.
There isn't really a good way to do this in the current stable release, though maybe you could call the pan or resize modes with pyjnius.

Related

Android Webview: Smaller Display Size Breaks Layout

I have an web app that's basically just displaying mobile website in an Android Webview, with some native bits for handling notification & navigation headers.
The issue is, when I change the Display Size setting (under Display) in an Android phone to anything smaller than Default, the content will be squeezed to the right side and left a blank space. I did a check with dev tool, and somehow the CSS's width is set to 66.67% of parent's by Android (in default it's 100%) & a minor left padding is also added. However, if the Display Size setting is larger than default, there is none / very minor style degradation.
The interesting part is when similar app is made in iOS (just display mobile site), there's no issue at all after changing the Display Size. So I'm pretty certain that the fix is limited to Android.
Is there any guidance to add code to anticipate these changes, or at least, completely disable the Display Size setting's effects?
*Edit:
What I've tried & failed:
Setting "width=device-width, initial-scale=1" in the website
Set loadWithOverviewMode and useWideViewPort to true
Combination of both of them
Solution is simple actually: there's a piece of old CSS code in the website that overrides CSS values when the width of the display is above certain threshold.

AIR - Get SoftKeyboard Screen Size

In my AIR mobile application I am trying to resize my application when the softkeyboard is activated so that the bottom of my application will not be covered by the keyboard. From what I have read this is suppose to be the default behavior but I have never been able to get it to work and I have tried everything I have found online, instead the keyboard overlays ontop of the application.
I then decided I would resize my application myself based on the height and y position of the softkeyboard only to find out that the built in AIR methods for determining the height and y position of the keyboard are not correct (YAY). I even tried using a 3rd party ANE for determining the screen height by FreshPlanet and their code does not always return correct values either. I feel like this shouldn't be that hard to figure out but I am stuck. Please help!
TLDR:
How can I resize my application to be the remaining screen space when the softkeyboard is activated?
What renderMode are you using? (in manifest.xml) I found that only cpu is working to get the correct keyboard height.
Also try to set softKeyboardBehavior to none: <softKeyboardBehavior>none</softKeyboardBehavior>

[Android]How to get soft keyboard height. (Except the suggestions)

First, it's not a simple question like this quest or this quest.
I have to get soft keyboard height in my project. I used to get device screen height and subtraction it by out app root view height. However, it work correctly until my test using keyboard suggestion. Unfortunately for me, my solution did not right in this case. The number I got alway bigger than the soft keyboard height. I tried to google but fail.
Here's my picture:

Android and iOS inconsistencies for text in labels - appcelerator

I'm trying to lay out elements for a user profile using the appcelerator api. On iOS it automatically sets the height so all of the text is shown. The same code in android seems to cut off the bottom of the text, and I have to set a static height for it all to appear. I feel that this is somewhat backwards. Has anyone else had a similar problem?
If you set the height to "auto" for the parent element, it should be just fine. In both Android and iOS.
And of course, the height for the label needs to be also "auto". Make sure to use quotes though, it doesn't know the variable auto

Reposition android virtual keyboard to right of screen in landscape mode

I have am developing an android app for V2.2 onwards.
The app is for numeric data input for the elderly
To keep things nice and simple, I am using the phone style input method. This also has the advantage of using nice big keys for them.
In landscape mode, I would like to move the virtual keyboard and position it on the right hand side of the view. The content itself has much more height than width and it would be perfect to have the screen split down the middle horizontally with the content on the left and the virtual keyboard on the right.
Does anyone know if this is possible?
Thanks

Categories

Resources