Adjustpan Not Preventing Keyboard from Covering Edittext

adjustPan not preventing keyboard from covering EditText

After doing a lot of searching apparently it's what I'm calling a bug. If you use the fullscreen tag (to remove the status bar from the activity) you can't use "adjustResize" without wrapping the activity in a ScrollView. Unfortunately for me I'm using a ListView which would create yet another problem. I'm sick of messing with it and will probably just abandon the fullscreen on that activity.

adjustPan cuts off bottom of EditText

Solution is to set a top&bot paddings

My example with editText:

<AutoCompleteTextView
android:id="@+id/editText_new_password"
android:layout_width="match_parent"
android:layout_height="@dimen/btn_editbox_height"
android:background="@drawable/edit_text_style"
android:gravity="center_vertical"
android:paddingEnd="@dimen/login_edit_box_pass_padding_right"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingStart="@dimen/edit_box_padding"
android:textSize="14sp" />

Sample Image

with paddings 12:

Sample Image

and naked paddings:

Sample Image

Keyboard overlapping issue on EditText with adjustpan not working

adjustResize fails to work when you use a FullScreenActivity. One solution would be to contain the whole layout in a ScrollView and scroll it to position editText.getY() + editText.getMeasuredHeight() when the editText gains focus.

Or, if you want a quick fix to the problem, have at look at this solution on a similar question here.



Related Topics



Leave a reply



Submit