How to make sure specific view is visible when keyboard appears?

android

Solution

Spoke with the Android developers hangout, and it doesn't seem like there's an easy way to solve this problem. The consensus seems to be reworking the layout rather than having an API to fix the issue.

Problem

I have a layout with a graphic at the top, an `EditText` in the middle and a button some distance below it, like so: When the user is typing in the `EditText`, I want to pan the layout so that the "Go" button is still visible, even if that means clipping the image off the top, like so: I know about `windowSoftInputMode="adjustPan"` in the manifest, but that doesn't work because it only pans far enough for the EditText to be visible. Is there a way to make sure it pans until the button is visible too? For comments with K_Anas, this is my layout. It has all the extra margins and spacing removed compared to the first screenshot, to remove any other source of problems. ``` <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <View android:layout_width="300dp" android:layout_height="150dp" android:layout_alignParentTop="true" android:background="#999"/> <EditText android:layout_width="280dp" android:layout_height="wrap_content" android:layout_centerInParent="true" android:hint="Sample..."/> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:text="Go"/> </RelativeLayout> ```

Original source