0

I have an Activity with a RelativeLayout in which i have a FrameLayout where i load diferent Fragments and a bottom aligned layout with buttons. In a Fragment i load i have a ScrollView and i want to scroll the Fragment till the end but i want the Activity to maintain its layout so the bottom aligned layout will not be shown above keyboard.

I tried everything and neighter combination seems to work.

So i think that there should be 2 types of adjustments for 2 different views, the activity shouldn't be adjusting and the fragment inside should be something like adjustNothing/adjustPan, is this possible?

To help you understand better, its like Instagram, bottom menu, scroll and shown keyboard.

Hope I'd made myself clear for you to understand.

Thank you.

LE: I know a solution would be to listen for when the softkeyboard is shown and make the bottom layout invisible, but thats not what I'm looking for.

victorholo
  • 105
  • 1
  • 11

1 Answers1

1

Just place the frame layout on top of the RelativeLayout (android:layout_alignParentBottom="true") and above your buttons container (android:layout_above="@id/buttons"). The just set your buttons container on the bottom of the RelativeLayout (´android:layout_above="@id/buttons"´). This way no matter what you set on FrameLayout's layout_height it will fill the space between your button container and the top of the RelativeLayout.

<RelativeLayout>
    <FrameLayout
        android:layout_alignParentTop="true"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@id/buttons">
        <!-- your fragments -->
    </FrameLayout>

    <LinearLayout
        android:layout_alignParentBottom="true"
        android:id="@+id/buttons"
        android:width="match_parent"
        android:height="wrap_content">
        <!-- Your Buttons -->
    </LinearLayout>
</RelativeLatout>

Hope this helps.

Jago
  • 155
  • 9
  • Thats exactly how i have it. FrameLayout above LinearLayout and fill_parent in the RelativeLayout, but it doesn't work. The problem is with the content inside the Fragment which i want to scroll all the way above the keyboard without the buttons being seen. – victorholo Nov 11 '15 at 21:41
  • As far as I know you can't set 2 different adjustments as it is an activity level setting. Instagram seems to have `android:windowSoftInputMode="adjustNothing"` in the manifest file. – Jago Nov 11 '15 at 21:45
  • I guess the only thing i can do is hide the buttons whenever the keyboard is visible. – victorholo Nov 11 '15 at 21:48