When the keyboard opens I need to know how much space it is using, or the height left....
function alertSH() {
var height = app.GetScreenHeight();
var layHeight = lay.GetHeight();
app.Alert(height + ', ' + layHeight);
}
Neither of these change when the keyboard is open.
How can we get this height change?
Hoe can we know if the soft keyboard is covering layouts?
Sometimes, depending on your layout, it can be a help to put the lower controls on a Scroller and to scroll them up either manually or programmatically.
This is available, just needs added to DroidScript. (It's possible in Java)
@Dave Smart.... can we get this feature? It is needed for serious app development.
http://www.ninthavenue.com.au/how-to-check-if-the-software-keyboard-is-shown-in-android
@Dave - what you think?
Put the IMMResult private class in your Activity (or in a separate file if you need to reuse it).
Put the first code block wherever you need conditional logic based on the state of the keyboard. This code block first shows the keyboard then checks the IMMResult to find out if it was hidden beforehand or not.
You could change it to first hide the keyboard then query the result if that works better for you.
It's quite a mess really, but it should give you the information you need.
This would work??
Why do you want to know if the keyboard is active and its height and why do you think it is needed for 'serious app development'?
Serious development WITH droidscript. Since a lot of actions take place within a webview, the keyboard will cover content. If we could do
web.isKeyboardActice or something, we can adjust the height of the webview.
Example. Create a webview with 1, 1 as dimensions.
In the html have a full page textarea. When you start typing (after so many lines) it will go UNDER the keyboard.
Since DroidScript is a hybrid, and using html is a BIG part of it, this is neccessary!
Hope I explained well.
Still hoping for a isKeyboardActive() hack....
:)
Please explain 'ctrl' - what is needed here?
Also, how do I update DroidScript?
ctrl would be the webview?