How To Modify Form Such That Keyboard Doesn't Block It? - android

I have a login screen in the first activity of my android application. When the user selects the password field after filling in the username field the virtual on screen keyboard pops up and blocks the password field. The user is unable to view what they are typing. How can I solve this problem?
Below is my main.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout style="#style/LoginScreen" xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#fff"
>
<ListView android:id="#+id/listView1" android:layout_height="wrap_content" android:layout_width="match_parent"></ListView>
<ImageView android:id="#+id/imageView1" android:layout_height="wrap_content" android:layout_width="wrap_content" android:src="#drawable/logo"></ImageView>
<TextView android:textColor="#000" android:layout_width="wrap_content" android:id="#+id/textView1" android:layout_height="wrap_content" android:text="Enter your Google Account credentials:"></TextView>
<TextView style="#style/LoginLabel" android:layout_width="wrap_content" android:id="#+id/textView1" android:layout_height="wrap_content" android:text="Username:"></TextView>
<EditText android:layout_width="match_parent" android:id="#+id/login_username" android:layout_height="wrap_content"></EditText>
<TextView style="#style/LoginLabel" android:layout_width="wrap_content" android:id="#+id/textView2" android:layout_height="wrap_content" android:text="Password:"></TextView>
<EditText android:id="#+id/login_password" android:layout_height="wrap_content" android:layout_width="match_parent" android:password="true"></EditText>
<Button style="#style/LoginButton" android:id="#+id/login_button" android:layout_height="wrap_content" android:layout_width="match_parent" android:text="Login"></Button>
<LinearLayout android:id="#+id/linearLayout1" android:layout_height="wrap_content" android:layout_width="match_parent">
</LinearLayout>

In your manifest you can define how you want the soft keyboard to modify your layout, e.g:
<activity android:name=".YourActivity"
android:windowSoftInputMode="adjustResize"/>
That will resize your components to "best fit". You can also use adjustPan, in that case the visible area will move around to focus on your textbox.
See this.

Related

Software keyboard move editTexts for android

I'm trying to get the editTexts, and sign in button to move up when the software keyboard is out however I want the background to not be compressed(I'm going to add an image soon). I have the TextView(Login), two EditTexts(email and password) and signin button in a ScrollView because I thought that might help however I have not be able to figure anything out.
http://i.imgur.com/vlYifc6.png
http://i.imgur.com/vlYifc6.png
This is the xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:paddingBottom="#dimen/activity_vertical_margin" tools:context=".MainActivity">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="#+id/scrollView"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true" >
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:gravity="center"
android:id="#+id/textLayout">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Login"
android:id="#+id/loginView"
android:textSize="22dp"
android:layout_above="#+id/textLayout"
android:layout_centerHorizontal="true" />
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="#+id/emailTextfield"
android:inputType="textEmailAddress"
android:background="#android:drawable/edit_text"
android:textColor="#android:color/primary_text_light"
android:text="andresc1305#yahoo.com"
android:hint="Email" />
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:hint="Password"
android:text="Andres123"
android:background="#android:drawable/edit_text"
android:textColor="#android:color/primary_text_light"
android:ems="10"
android:id="#+id/passwordTextfield" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SIGN IN"
android:background="#android:color/transparent"
android:textSize="24dp"
android:id="#+id/signinButton"
android:layout_below="#+id/textLayout"
android:layout_centerHorizontal="true"
android:onClick="onSigninClick"/>
</LinearLayout>
</ScrollView>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Forgot your password?"
android:background="#android:color/transparent"
android:textSize="14dp"
android:id="#+id/forgotButton"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:onClick="onPasswordRecoverClick"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Register"
android:background="#android:color/transparent"
android:textSize="14dp"
android:id="#+id/registerButton"
android:layout_alignTop="#+id/forgotButton"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:onClick="onRegisterClick"/>
</RelativeLayout>
Look at this answer. In short, your problem can most likely be solved by setting the following in your AndroidManifest.xml inside the relevant activity or application element:
android:windowSoftInputMode="adjustResize"
#PPartisan
This is without:
android:windowSoftInputMode="adjustResize"
http://i.imgur.com/tbNioU2.png
This is with:
http://i.imgur.com/7ZePHjS.png
Beside the compression you can see my "Forgot your password" and "Register" buttons but I have those outside my ScrollView in the XML. Is there a way to scroll the LinearLayout (which contains the Login(TextView, email(EditText), password(EditText), and Signin(button) up when the software keyboard comes up?
The answer by zmilojko seems like what I want to do but he only says to add the ScrollView and not what to do after that has been added. Is there something I can place in the to make it move up when the software keyboard comes up?
see this thread, i think it can help you
layout of the screen moves up when keyboard is displayed
or just try to put this in your xml:
android:windowSoftInputMode="adjustPan"
or this
android:windowSoftInputMode="adjustNothing"
Seems like it works different in each case.

Still my layout not shifting up side.

I am trying to shift my layout up when soft keyboard will open.
I have edittext and button. I can see edittext clearly whether keyboard is open or not but problem is that i am showing drop down for edittext. When drop down open it open on top of edittext because there is no sufficient space between keyboard and dropdown.
So i am trying to shift my entire screen up (only edittext will show). So can show dropdown below of Edittext.
I try following things...
I add following attribute in my activity in AndroidManifest.xml
android:windowSoftInputMode="adjustPan"
I add following code in my .java file
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN)
I read somewhere i need to use relative layout. I also try this but none of them helpful.
Here is my xml code for your reference.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:background="#EFEFEF"
>
<ViewStub
android:id="#+id/vsHeader2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inflatedId="#+id/header"
android:layout="#layout/copyofheader" />
<TextView
android:id="#+id/firstPara"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="56dip"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:text=""
android:textSize="16sp" />
<TextView
android:id="#+id/secondPara"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/firstPara"
android:layout_marginTop="24dip"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:text=""
android:textColor="#666666"
android:textSize="16sp" />
<AutoCompleteTextView
android:id="#+id/mysecondautocomplete"
android:layout_width="fill_parent"
android:layout_height="40dip"
android:layout_below="#id/secondPara"
android:layout_marginLeft="12dip"
android:layout_marginRight="12dip"
android:layout_marginTop="12dip"
android:ems="10"
android:dropDownVerticalOffset="44dip"
android:windowSoftInputMode="stateHidden"
android:dropDownHeight="290dip"
android:imeOptions="actionSearch"
android:drawableLeft="#drawable/search_grey"
android:background="#drawable/borderforloginedittext"
android:drawablePadding="6dip"
android:hint="Enter Restaurant Name"
android:inputType="textPersonName"
android:dropDownWidth="match_parent"
android:textColor="#cc3333"
android:textColorHint="#999999"
android:textSize="16sp" />
I don't understand why my layout not shifting up. Please give me any hint or reference.
UPDATE:
I just re-read your question and found the mistake you are making. You are adding android:windowSoftInputMode="adjustPan" in AndroidManifestfor resizing or scaling the window for the keyboard.
You should use android:windowSoftInputMode="adjustResize" which will resize the window or adjust the window accordingly.
Try this:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:background="#EFEFEF"
>
<ViewStub
android:id="#+id/vsHeader2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inflatedId="#+id/header"
android:layout="#layout/copyofheader" />
<TextView
android:id="#+id/firstPara"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="56dip"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:text=""
android:textSize="16sp" />
<TextView
android:id="#+id/secondPara"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/firstPara"
android:layout_marginTop="24dip"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:text=""
android:textColor="#666666"
android:textSize="16sp" />
<AutoCompleteTextView
android:id="#+id/mysecondautocomplete"
android:layout_width="fill_parent"
android:layout_height="40dip"
android:layout_below="#id/secondPara"
android:layout_marginLeft="12dip"
android:layout_marginRight="12dip"
android:layout_marginTop="12dip"
android:ems="10"
android:dropDownVerticalOffset="44dip"
android:windowSoftInputMode="stateHidden"
android:dropDownHeight="290dip"
android:imeOptions="actionSearch"
android:drawableLeft="#drawable/search_grey"
android:background="#drawable/borderforloginedittext"
android:drawablePadding="6dip"
android:hint="Enter Restaurant Name"
android:inputType="textPersonName"
android:dropDownWidth="match_parent"
android:textColor="#cc3333"
android:textColorHint="#999999"
android:textSize="16sp" />
</RelativeLayout>
</ScrollView>
</RelativeLayout>
Put your entire layout inside a Scrollview. So when the soft keyboard gets open, your view will get adjusted accordingly.

Android edittext auto grow with text and pushing things down

Yes, this is yet another edittext grow question on SO. And yes I've already gone through all those edittext grow questions. But this ones a bit specific.
UI:
A simple android layout with edittext and button below it. When text is less, the edittext view is still covering whole screen leaving space for button below.
Once user starts entering text, edittext grows vertically to accommodate text. At the same time, the button should also kept pushing downwards to let edittext grow.
User can vertically scroll through screen to view full text.
UI after entering significant text:
Here's the layout with edittext and button below:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#color/background"
android:clipToPadding="false"
android:fadingEdge="none"
android:fillViewport="true"
android:padding="13dp"
android:scrollbarStyle="outsideOverlay" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1">
<!-- some fixed width image -->
<ImageView
android:id="#+id/someimage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:src="#drawable/page_white_text" />
<EditText
android:id="#+id/some"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#id/someimage"
android:background="#null"
android:gravity="top"
android:minLines="10"
android:minHeight="50dp"
android:textColor="#222222"
android:textSize="15dp"
android:typeface="serif" >
<requestFocus />
</EditText>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:baselineAligned="true"
android:layout_marginTop="5dp"
android:padding="10dp"
android:orientation="vertical" >
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
</LinearLayout>
</RelativeLayout>
</ScrollView>
This works more or less. But when I enter to much text, instead of pushing button downwards. It goes behind it like:
Any help here is much appreciated. Thanks :)
Here's my recommendation: inside the ScrollView, put a RelativeLayout in which you can place every element in a certain order using android:layout_below. For the auto-growing of your EditText, use this solution.
Let's see an example:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center">
<RelativeLayout
android:id="#+id/general2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_margin="20sp" >
<TextView
android:id="#+id/textFirstOpinion"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="#string/titleFirstOpinion"
android:textStyle="bold"
android:textSize="23sp"
android:textColor="#FFFFFF"
android:layout_marginTop="10dp" />
<EditText
android:id="#+id/fieldFirstOpinion"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#id/textFirstOpinion"
android:minHeight="80sp"
android:isScrollContainer="true"
android:inputType="textMultiLine"
android:textSize="20sp"
android:gravity="top|left" />
<Button
android:id="#+id/button"
android:layout_width="110dp"
android:layout_height="wrap_content"
android:layout_below="#id/fieldFirstOpinion"
android:layout_centerHorizontal="true"
android:layout_marginTop="37sp"
android:textSize="23sp"
android:text="#string/textSendButton"
android:gravity="center_horizontal"
android:padding="10dp" />
</RelativeLayout>
</ScrollView>
try adding android:layout_below="#id/some" in your LinearLayout like
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:baselineAligned="true"
android:layout_marginTop="5dp"
android:padding="10dp"
android:orientation="vertical"
android:layout_below="#id/some" >
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
</LinearLayout>
Since you want the button to be at the bottom of the page, add the following line
android:layout_below="#+id/some"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
in your LinearLayout code here like
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/some"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:baselineAligned="true"
android:layout_marginTop="5dp"
android:padding="10dp"
android:orientation="vertical" >
Also make sure the layout:height parameter of EditText is set to wrap_content
Try this and tell me if it works or not

Android EditText expands to dialog

I have this layout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/viewer_top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#android:color/background_dark"
android:orientation="horizontal" >
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="3dp"
android:layout_weight="1" >
<EditText
android:id="#+id/viewer_filter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/hint_filter"
android:background="#android:color/white"
android:drawableLeft="#android:drawable/ic_menu_search"
android:inputType="text"
android:paddingLeft="4dp"
android:selectAllOnFocus="true" >
</EditText>
<ImageView
android:id="#+id/viewer_filterX"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#id/viewer_filter"
android:layout_alignRight="#id/viewer_filter"
android:src="#android:drawable/ic_menu_close_clear_cancel"
android:visibility="invisible" >
</ImageView>
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:layout_marginTop="3dp"
android:layout_marginBottom="5dp"
android:layout_weight="1" >
<EditText
android:id="#+id/viewer_search"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/hint_search"
android:background="#android:color/white"
android:drawableLeft="#android:drawable/ic_menu_search"
android:inputType="text"
android:paddingLeft="4dp"
android:selectAllOnFocus="true" >
</EditText>
<ImageView
android:id="#+id/viewer_searchGo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#id/viewer_search"
android:layout_alignRight="#id/viewer_search"
android:src="#android:drawable/ic_menu_send"
android:visibility="invisible" >
</ImageView>
<ImageView
android:id="#+id/viewer_searchX"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#id/viewer_search"
android:layout_toLeftOf="#id/viewer_searchGo"
android:src="#android:drawable/ic_menu_close_clear_cancel"
android:visibility="invisible" >
</ImageView>
</RelativeLayout>
</LinearLayout>
<HorizontalScrollView
android:id="#+id/viewer_hscroll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/viewer_top" >
<ListView
android:id="#+id/viewer_list"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</ListView>
</HorizontalScrollView>
</RelativeLayout>
When I click on either EditText it expands to this dialog:
On portrait mode the EditTexts can be edited as they are without expanding. The XML for portrait is similar, only the EditTexts are one below the other and are screen wide.
How do I prevent this EditText expansion?
Not only the full phone screen is hidden by the EditText + virtual keyboard, but the clickable images the I put over the EditText are not visible.
I tried to set the EditText layout_width to 0dp, but they don't show.
I am not using SearchViews because they steal the focus and I cannot use the back key to go back to the previous activity.
Update
I removed the layout-land XML and used the same XML for both portrait and landscape.
In portrait mode it is fine, no expansion, in landscape mode there is expansion.
So it has to do somehow with being in landscape mode.
add this line to your edit text
android:imeOptions="flagNoFullscreen"
edit text look like this
<EditText
android:id="#+id/viewer_filter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="hint_filter"
android:background="#android:color/white"
android:drawableLeft="#android:drawable/ic_menu_search"
android:inputType="text"
android:paddingLeft="4dp"
android:selectAllOnFocus="true"
android:imeOptions="flagNoFullscreen">
Try to use android:maxLines="1" for EditText
I had similar issue. You can use mEditText.setSingleLine(true); where you are using it. This will solve your problem.
Hi please add this line in java code where your edit text is declared description.setMaxLines(1);
This post addresses the same problem and has the solution
Need to add
android:imeOptions="flagNoExtractUi"
to prevent this behavior.
If someone knows how, please mark this post as duplicate.

Android Tabhost keyboard overlaps inputs

I have tabhost layout where i load my Form Activity(10 inputs in scroll bar). When i start typing on the most bottom inputs, the keyboard shown and the focused input is not shown(the keyboard overlaps the inputs instead of scrolling as normal) and i can't see what am i my typing. When i tried to run the form activity outside tabhost, everything works as normal, i can type and see the inputs focused always. My min API level is 10, max is 17.
Any help or direction highly appreciated.
TabHost Layout:
<?xml version="1.0" encoding="UTF-8"?>
<TabHost
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<RelativeLayout
android:id="#+id/layTab"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true"
android:gravity="center"
android:background="#00A99D"
android:paddingLeft="0dip"
android:paddingRight="0dip" >
<TabWidget
android:id="#android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:gravity="center|bottom"
android:padding="0dip" />
</RelativeLayout>
<FrameLayout
android:id="#android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_above="#id/layTab"/>
</RelativeLayout>
Form Layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#eee"
android:padding="0dip"
android:layout_alignParentBottom="true">
<LinearLayout
android:id="#+id/body"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="#id/header"
android:orientation="vertical" >
<EditText
android:id="#+id/editText6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="1"
android:ems="10" />
<EditText
android:id="#+id/editText6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="2"
android:ems="10" />
<EditText
android:id="#+id/editText6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="3"
android:ems="10" />
<EditText
android:id="#+id/editText6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="4"
android:ems="10" />
<EditText
android:id="#+id/editText6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="5"
android:ems="10" />
<EditText
android:id="#+id/editText6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="6"
android:ems="10" />
<EditText
android:id="#+id/editText6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="7"
android:ems="10" />
<EditText
android:id="#+id/editText6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="8"
android:ems="10" />
<EditText
android:id="#+id/editText6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:imeOptions="flagNoExtractUi"
android:hint="9"
android:ems="10"/>
<EditText
android:id="#+id/editText6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="10"
android:ems="10" />
</LinearLayout>
</ScrollView>
</LinearLayout>
When a keyboard pops up, it has 'two visual modes'. FullScreen, meaning that the window in which the keyboard renders is fully overlaying your application or not fullscreen.
In the second case the window, in which your activity displays, is resized. With this resizing, I assume that a TabHost does scale up but the child layouts (in the case your form) are not scaled the same way as if they would be a stand-alone layout.
The Android documentation states that an application using an EditText should be aware of:
Properly set the inputType in your editable text views, so that the
input method will have enough context to help the user in entering
text into them.
Deal well with losing screen space when the input
method is displayed. Ideally an application should handle its window
being resized smaller, but it can rely on the system performing
panning of the window if needed. You should set the
windowSoftInputMode attribute on your activity or the corresponding
values on windows you create to help the system determine whether to
pan or resize (it will try to determine this automatically but may
get it wrong).
You can also control the preferred soft input state
(open, closed, etc) for your window using the same
windowSoftInputMode attribute.

Categories

Resources