I have the following layout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.AppBarLayout>
<ScrollView
android:id="@+id/scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<!-- Content -->
</ScrollView>
<include layout="@layout/fixed_layout_when_keyboard_not_visible" />
</RelativeLayout>
In AndroidManifest I have the android:windowSoftInputMode
set to adjustResize
which doesn't 'squeeze' the content when keyboard is visible and keeps the Toolbar fixed at all times, even when I scroll.
However, I have another view at the bottom, out of the ScrollView
, which I want to be fixed as well but at the same time not block any content when keyboard pops up- right now it moves with the keyboard as of the following property layout_gravity="bottom
".
I could just toggle the visibility of that layout when keyboard shows/hides but that doesn't seem the most elegant solution. What would you suggest? Any help very much appreciated :)