I've got this layout:
Without colors: https://i.stack.imgur.com/OdSda.png
- Layout for the tabs (separate xml file)
- RelativeLayout 1 surrounding everything else
- A, B, C all have their own LinearLayout in RelativeLayout 2
- The horizontal line, D (in a LinearLayout) and the "OK" button have their own RelativeLayout 3
- And there's RelativeLayout 4 (=footer) for E
What I want to happen if I click on the EditText next to D and the keyboard opens up:
- 4 stays at the bottom and is hidden behind the keyboard
- If there isn't enough space to fully display 3, 2 is collapsed until the keyboard is closed again
What's actually happening:
- 2 stays where it is
- The keyboard covers 3 halfway and I can't see what I'm typing
- 4 is pushed up and covers D
Two things I've already tried but with both didn't fully work as expected:
I) Add android:windowSoftInputMode="adjustPan"
to the manifest:
- 4 stays at the bottom BUT
- Everything else is pushed up, so 2, 3 and the tabs which are then covered half way
II) Add android:windowSoftInputMode="adjustResize"
to the manifest: Nothing changes unless I also add android:fitsSystemWindows="true"
to the tab fragment's xml:
- Now all the padding of the surrounding RelativeLayout 1 is ignored
- The EditText next to D is pushed up against 2 but not readable and D and the "OK" button are covered by the keyboard
- 4 is still pushed up