How to show the contents hidden by keyboard in the webview - android

My android application is a webview, and in first page there are 5 editboxes. When i enter some data in editbox the last editbox is hidden by keyboard. So i enclosed webview within a scrollview. But the scrolling is happening only on the first page but not on all the other pages. Is it possible to scroll screen up only if keyboard is hiding some text in webview?
Meanwhile i tried using the window attribute windowSoftInputMode="adjustResize" but still i am getting the same problem. Any Ideas on how to make this working?
-Regards,
Ron..

This could be the consequence of http://code.google.com/p/android/issues/detail?id=5497. Looks like adjustResize should work if you created your layout correctly, but it will not if your app is in fullscreen mode (i.e. the Android status bar is not displayed). If your app runs in fullscreen mode, try the 'normal' mode for a change and see if the webview adjusts its size correctly when the keyboard is displayed.

Related

Android: Textinput does not rise up in fullscreen mode inside a webview

My Android APP has a webview to display html content, in one of the pages have text boxes, and when I click on the text box appears the Android keyboard, and the textbox show up to be visible, so far so good, but when I put the application in Fullscreen Mode, when I call the keyboard, textbox does not rise up.
Does anyone know why?

AdjustResize does not work after dismissing keyboard by clicking outside keyboard

I have a WebView (within a Fragment within a ViewPager with SlidingTabLayout).
When using the WebView to type, I want the layout to resize to make sure the input is visible.
When I click a text input in the WebView, the softkeyboard appears and the layout resizes. I'm able to enter my text and submit using the softkeyboard's return button or cancel input using the back button. After this, the keyboard disappears and the layout resizes back. Correct AdjustResize behavior.
However, when dismissing the keyboard by clicking outside the Softkeyboard (e.g. when entering a query in Google and pressing the Search button in the WebView) the keyboards hides and it takes about 2-3 seconds for the layout to resize (leaving a blank space for 2-3 seconds at the bottom of my layout). After that, when selecting the textinput, the keyboard overlays the WebView (adjustPan).
How can I make sure that when dismissing the keyboard by pressing the WebView, adjustResize behavior is maintained.
I've tried re-setting AdjustResize (e.g. from onTouch) but this has no effect:
this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
I've also tried the following solution but this gives no change.
In addition, I've think this is probably not a focus issue (since the keyboard does appear, and the webview does respond). And I do ask focus from my View:
webView.setFocusable(true);
webView.setFocusableInTouchMode(true);
It turned out to be that when you perform layout translations on the WebView or if the WebView's layout is changed indirectly (e.g. when resizing an element above the WebView in a RelativeLayout that causes the WeView to also be resized) showing and hiding the keyboard can cause some strange behavior:
AdjustResize behavior can be lost (as indicated in the question)
WebView resize's after keyboard can take longer then normal.
WebView's performance decreases
What solved this issue for me, was to prevent layout changes in the WebView in any way (layout reload upon rotation does not appear to cause this). In my case I was showing and hiding the Toolbar causing the WebView to resize (and fill the screen).

Stop showing softkeyboard in WebView

Is there a way to prevent the softkeyboard to show up in a WebView? My app is attached to a scanner which simulates keyboard entry (that works so far), so the softkeyboard is only annoying when it occupies the screen.
The Nullkeyboard from the Playstore does the trick, but in certain cases I would like to enable the keyboard again.
If it helps, I can control the content of the webpage being shown. Would like to avoid programming a full input method.
In your manifest, on the activity, use android:windowSoftInputMode="stateAlwaysHidden" and the soft keyboard should never be displayed.

Webview moves up when keyboard hides

The issue happens in an application whith a linear layout that divides the screen in two parts, the upper part is a simple View and the lower part is a WebView that loads google.com. The WebView takes the 60% of the space and the View the other 40%. In that scenario I touch the google search bar showing the soft keyboard, inmediately I touch the WebView outside the search bar just at the right of the search button, that hides the soft keyboard but just before this the WebView moves up for an instant and comes back to its initial position as the keyboard dissapears, no idea of why this happens and how to avoid it.
Please see the sample application, to reproduce the issue you can use a WVGA (800×480) simulator, I noticed the issue in a Samsung Galaxy Tab 10.1.
http://www.fileserve.com/file/txC3RV6/WebViewDemo.rar
Any suggestion?
Thanks for your time.
Goyo.
If you put the entire linear view inside the scrollview then the webview wont move up.

Keyboard layout hiding android action bar?

In my Android application running in a XOOM device, when I click in an Edittext the keyboard opens and hides the Actionbar. I don't want this to happen, how can I solve this? This is done by the Google Contacts app for the tablet for example.
EDIT:
I have several edittexts in which the user needs fo fill. At first, when the user clicked on one edittext on the bottom, the keyboard showed up and hide the edittext in which the user was typing, so he couldn't see what he was typing. I found it really bad, and to solve it I just added to the manifest: android:windowSoftInputMode="stateVisible|adjustPan"
But after that, now the screen adjust itselfs and hides the action bar.
The Google Contacts app does the same, but it magically doesn't hide the Action bar. How do they do it?
Use adjustResize instead of adjustPan. The framework will always try to keep the focused element on-screen by scrolling any parent views if necessary.
If your EditText field is not nested in some sort of scrolling container such as a ScrollView then your layout may be too tall to completely display when the keyboard resizes your activity. Try wrapping your form's layout in a ScrollView. This will also allow your app's content to scroll if it is running on a smaller screen device where it may have similar issues.

Categories

Resources