How to prevent resizing and relayout the window when soft keyboard displaying - android

I show an edit dialog in an activity, when the soft keyboard displaying, the window of the activity will be resized to too samll which looks awful. I don't want the window of the activity be resized and layout. I just want the keyboard can cover on the activity window and the dialog move to the top so that soft keyboard have room to show.
I have tried to use android:windowSoftInputMode="xxxxx" in the manifest, but there are no one mode which fit my situation. I also found the similar question, but it did't solve my problem.
EDIT: I have tried setImeOptions and also getWindown().setFlags but it still did't worked, Any advice will be very appreciated.
EDIT2: I have tried in 3.0, and use android:windowSoftInputMode="adjustNothing", It worked perfectly, but how can i implement this on 2.3?

add this property in AndroidManifest.xml for your Activity :
android:configChanges="orientation|keyboardHidden|screenSize"
android:windowSoftInputMode="stateUnchanged|adjustPan"

I find a method to avoid the problem, but just avoid, still want to know the solution in android 2.3.
Before, I layout the controls in the XML from top and bottom, just like this:
<ToolBar android:id="#+id/blabla"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" />
So when the keyboard is showing, the window of the activity is resized, so the ToolBar is pushed, which looks not good.
Now, I layout the controls from top, through the window is still resized, but the ToolBar and the other controls will not be pushed, they are just layout out of the window, when the soft keyboard is showing.

Related

Move custom popup up when keyboard is showing in android

My popup layout extending relative layout. In popup i placed edittext. I am displaying popup with arrow based on view. I want to move only popup when keyboard is showing.
Please help me, how to solve this problem.
Simply add:
android:windowSoftInputMode="adjustResize"
To the relevant activity in the AndroidManifest.xml file.
"adjustResize" - The activity's main window is always resized to make
room for the soft keyboard on screen.

Keyboard from EditText destroing Layout

I have EditText, when i toutch this, keyboard will show, but instead of covering the bottom part of the application, it shifts all the elements at the top and makes them smaller, everything looks distorted ...
How do I display the keyboard so that it does not affect our layout?
Please check this Link:
You can add in your menifest for the activity you want to prevent such issue.
Also make sure if you are having a bit more content use scrollView as a parent.
And soft input mode as "adjustResize"
android:windowSoftInputMode="adjustResize"
or
android:windowSoftInputMode="adjustPan"
you can use as per your need.
adjustResize
to ensure that the system resizes your layout to the available space—which ensures that all of your layout content is accessible (even though it probably requires scrolling)—use this one.
adjustPan
The activity's main window is not resized to make room for the soft keyboard, and the contents of the window are automatically panned so that the current focus is never obscured by the keyboard and users can always see what they are typing.
adjustNothing
Do nothing with layouts

Dismissing keyboard slides the view either up or down

Using android webview, whenever I dismiss the keyboard it either slides the view up or down. Going through similar issues on SO, I tried using following 2 individually:
android:windowSoftInputMode="adjustPan" - This does prevent sliding of the webview, but now whenever keyboard is up, some of my UI elements are under the keyboard which prevents user from typing/interacting with those elements hidden under the keyboard. I tried adding a scroll to the webview, but scroll doesn't show up with this option. It works fine, if I don't add this property.
android:windowSoftInputMode="adjustResize" - The issue still remains if I use this property.
Layout width and height on my webview is fill_parent.
android:layout_width="fill_parent"
android:layout_height="fill_parent"
Could anything else help me here?

Android Facebook Messenger keyboard resize activity layout

I trying to fix layout resize in my Activity when keyboard appear on the screen. I've tried to put in manifest on the activity: windowsSoftInputMode="stateAlwaysHidden" but with not results, my layout is still resizing when I open the keyboard with someone on messenger which is unussual.
If you are doing what I think you are doing, stateAlwaysHidden is not the way to go about it.
<activity android:windowSoftInputMode="adjustPan" >
From the documentation
The activity's main window is not resized to make room for the soft keyboard. Rather, the contents of the window are automatically panned so that the current focus is never obscured by the keyboard and users can always see what they are typing.
This is, I think what you want. The pan not to change
Here's a link to the documentation regarding it http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft

android keyboard is hiding the layout

I have a relative layout that is supposed to move up when the soft keyboard opens. It worked all fine until I had to make the application full screen. After I set
android:theme="#android:style/Theme.Holo.NoActionBar.Fullscreen"
the layout doesn't move up. It stays where it is and the keyboard is on top of it.
I tried with android:windowSoftInputMode="adjustPan|adjustResize" but it doesn't work.
I found my answer. The answer to this question can be found here:
Android How to adjust layout in Full Screen Mode when softkeyboard is visible

Categories

Resources