keyboard covering webview form in Android app - android

I have a webview of a form in an android app, but the problem is that when I open up the keyboard to type, it covers the other input fields. for the fields near the top, i can click on to type, but the last field is entirely covered by the keyboard, such that if I lower the keyboard and click on the input field in the webview, the keyboard will cover the field (I can type in it, but not see what I am typing)
does anyone have thoughts/guidance/resources on how to approach this problem?
alternatively, does anyone know how I could do something like the following: when I click a input field in a webview, for the keyboard to show right below the field for each field on the page.
I've seen some resources around adjustPan and adjustResize in windowSoftInputMode, but that didn't seem to solve it for me, though I could still be wrong. I am working with an sdk that gets the webview up, so there could be indirection that I am missing.

Related

How to disable Keyboard suggestions on EditText and tell the keyboard to show extra number row

I have an EditText in my layout file. When I click(focus) on EditText a soft keyboard appear contains predictive word in keyboard suggestion bar(see figure 1).
Figure 1
But I want that when I will click on my EditText keyboard will appear with no suggestion bar and with an extra number row(see Figure 2).
Figure 2
I already tried some answer saying that adding below attribute will do that but none of them seems worked for me.
inputType="text|textNoSuggestion",inputType="textFilter" not worked.The below code work but also open a secure keyboard.(oppo,vivo phone built in feature)
inputType="textNoSuggestion|textVisiblePassword"
Is there any solution to make it done without opening secure keyboard?
N.B. I don't wanna disable the secure keyboard.
I saw this feature on some code editing application available on playstore.

Is there anyway using html5 to force android/ios virtual keyboard to be shown

I have some html forms that when they get rendered I would like the keyboard to appear without the user having to touch the field first. I have tried using click and focus neither brings up the keyboard.
For what its worth I am using angular.
I do not believe this is possible with out a very kludgy work around. You might be able to have a hidden text field that it set to focus, which would bring up the keyboard and then manually set focus on other items in the view when needed. However this might cause some issues and you might be able to see the cursor in the hidden text field, among other issues. Why do you need the keyboard to be displayed without a focus on some field?

WebView and Detecting type of edit text in html? Keyboard type?

Part of my app has a form in WebView? How can I detect if the user is clicking on something in the html that should be numeric only? For example a zip code or credit card info? That way I could present them with the correct type of keyboard?
Basically you are trying to fix a missing implementation of HTML5 in android devices:
http://www.quirksmode.org/html5/inputs_mobile.html
this should give you a hint on how to call Java native functions from JS
http://developer.android.com/reference/android/webkit/WebView.html#addJavascriptInterface%28java.lang.Object,%20java.lang.String%29
I don't think you can progrematically change the keyboard input method when it's displayed.
This is one way to open the keyboard, but you'll need to handle the input and this will look bad as you won't see where you are typing.
Open soft keyboard programmatically
anoother way solve the issue of the keyboard type I would popup a native dialog with a textfield and set the keyboard type of this field to the one you need.
then send the result back to the webview by injecting javascript using loadURL();
at anycase you'll want to set the html field to readonly so it's keyboard doesn't jump.

how to know when and where a textfield is focused in an android webview?

Normally when a native textfield in an android view is focused, the view scrolls automatically to keep the field visible when the virtual keyboard appears. And it's normally the same behaviour when I select a textfield in a webview (so I mean a html text input in the page that loaded in the webview).
But for some reason, it doesn't work in my case. I have a webview that displays a form and when a select a textfield, the view scrolls down to the bottom of the page and the field I selected is no longer visible. What should I check in my app to prevent this to happen? If you need more details, just ask. In this way I can show you directly what you need.
Thanks in advance.
EDIT: on android 4, this is not happening. I encountered the problem on android 2.2 and 2.3.
android:windowSoftInputMode="adjustResize"
Add above tag in your manifest file's activity tag. The activity will be the one which displays webview

Android soft keyboard will hide for no reason

I'm having the following issue - I have placed
android:windowSoftInputMode = "stateAlwaysVisible"
in my manifest which works relatively fine since the software keyboard is almost always visible. I have a webview in which I have an editable div in which the user can enter text. However when the user have entered some text and taps somewhere else on the webview(on a position different from the current cursor position) the software keyboard will hide for a moment and afterwards reappear. I'm at my wits end and can't find an explanation for this. Using InputMethodManager to make the keyboard always visible also didn't help.
Any help will be greatly appereciated. Thanks!
The issue was that the keyboard is hiding due to the fact that we were passing all the touch events down to javascript we are having via loadUrl("javascript : bar(event.getX(), event.getY()));".
Turns out the loadUrl method internally hides the software keyboard. I worked this around by not passing the touch events to the javascript, but instead by using window.onmousemove

Categories

Resources