0

I'm working on an Android app with a slightly complex layout and I'm having nightmares to make it work the way I want. My main layout is defined like this:

<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:background="#000000"
tools:context=".MainLayout" >

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <RelativeLayout
        android:id="@+id/content"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:scrollbars="none" />

    <LinearLayout
        android:id="@+id/menudown"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >

        ... buttons ...

    </LinearLayout>
</LinearLayout>

<LinearLayout
    android:id="@+id/header"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_centerInParent="true" >

    ... header content ...
</LinearLayout>    

</RelativeLayout>

The idea of the layout is having a content frame(content), a footer menu (menudown) and a header (header) hovering over the content, aligned to the top of the screen. - Sorry guys, no image, confidential project.

The content is inflated with other layouts, depending on the section the user is, and some of them are forms to be filled. So, i just used the adjustPan and everything worked fine.

The problem here is: the client asked me to make the content scrollable while there's a soft keyboard showing, so that the user can view whatever he wrote on the other fields.

And it's painful because: the form fits the screen, so using content as a scrollview won't help, unless it gets resized.

And simply changing to adjustResize does not work because: the menudown goes up with the soft keyboard, which should not heappen. Also, the visual effect is terrible.

The app was already made for iPad (by someone else), and what heappens there is: the menudown remains aligned to the bottom of the screen, under the soft keyboard, which pushes only the content view up. Then, the content becomes scrollable, so that the user is able to see it entirely.

Hugo Aboud
  • 443
  • 3
  • 10

1 Answers1

0

I have this same issue too, making keyboard behave the same way as it does on iOS. The best thing I can get from all the other posts is manually detecting the soft keyboard and moving the view up the difference.

This seems to be the best: How to check visibility of software keyboard in Android?

Community
  • 1
  • 1
Jasoneer
  • 2,078
  • 2
  • 15
  • 20