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.
Related
I am writing an app with the Salesforce Android SDK.
We have a custom website that is used for the login landing page that has a username and password field.
Clicking on the first field brings focus and keyboard as expected. Clicking on the second field (regardless of which is clicked first) causes the screen to jump up and down for half a second and then leaves the screen so that you can scroll infinitely, even beyond the background image. No matter how far you scroll the scrollbar is stuck at the top. However to scroll back up you have to scroll the same distance you scrolled down.
While this is from the LoginActivity from the Salesforce SDK, I have modified the file to show the action bar at the top.
What is causing this behavior and how can I make it stop, changing zoom controls in the webviews settings does not seem to help.
The same screen in iOS does not seem to have this same behavior.
Worth noting, the defect does not appear in the devices chrome browser.
The Class in Salesforce SDK
According to the Salesforce SDK
There is a ScrollView in a WebView. This shouldn't be necessary and may cause a problem such as the one you described. Changing the ScrollView to LinearLayout should fix the issue.
I have created a custom popup menu which is displaying fine on the S4 but the problem is that part of it gets hidden behind the navigation buttons on Nexus 5.
I have tried using the setSystemUiVisibility() but that doesn't help as the buttons reappear as soon as I touch the view.
I have tried looking for an answer but haven't had any luck.
The amount of content in your PopupWindow likely exceeds the screen real estate. Consider using a ScrollView in your PopupWindow's inflated layout.
If I position a text input in the lower half of a page, when the user taps it to show the virtual keyboard, the page automatically slides up. When you tap away from the keyboard, the page automatically slides down again. I.e., everything is fine.
But when the text input is located in the top half of the page (in which case the page doesn't automatically slide when the keyboard appears), the behaviour is bad:
User taps the text input;
The whole screen (except the text input) turns black momentarily, then the keyboard slides up;
The user taps away from the keyboard;
The screen flashes black before the page is rendered again.
However, if you try the above steps a second time, the sequence is:
1. Same as above;
Same as above;
Same as above;
The screen turns black and stays black;
The user taps on the black screen;
The page is shown again.
I've tried a few different things, like detecting when the text input loses focus (i.e., keyboard hidden) to show to page, scroll the page, etc. but nothing seems to prevent this problem with the black screen.
Showing a javascript alert when the text input loses focus avoids the black screen problem (but I don't want an alert to show either!).
I've also tried using android:hardwareAccelerated="true" inside my AndroidManifest.xml's tag. And whilst that does fix this particular problem, it unfortunately creates many more rendering problems throughout the web app.
Does anyone have any suggestions?
Put this code in your manifest file in your launching activity tag
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:windowSoftInputMode="stateHidden|adjustPan"
I have developed an iPhone app and now going to port it to Android. Almost all features work but the only thing I noticed is when I focus any Texbox or Textarea, the keyboard is opened and moves the whole page off the screen. I got to know that putting android:windowSoftInputMode="adjustPan" would solve the issue but then another issue came out.
Now when I focus any text element, the keyboard is opened but the view size is squeezed to the height (minus keyboard height) shifting bottom tab buttons above keyboard which is very bad effect in my opinion. Although it doesn't now move the whole page off the screen but can I use this property android:windowSoftInputMode="..." to ask it to show keyboard over tab buttons (hiding tab buttons under keyboard) but just move the view if the text elements are being hidden?
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.