XML:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
</android.support.design.widget.AppBarLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="6dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Opção de Pesq.: "
android:textColor="@color/black"
android:textSize="@dimen/font_size_normal" />
<Spinner
android:id="@+id/comboOpcaoPesqCliente"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
android:textSize="@dimen/font_size_normal" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="6dp">
<EditText
android:id="@+id/edPesquisaCliente"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="Digite para pesquisar"
android:imeOptions="actionDone"
android:singleLine="true"
android:textSize="@dimen/font_size_editText" />
<Button
android:id="@+id/btLimpar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Limpar"
android:textColor="@color/black"
android:textSize="@dimen/font_size_normal" />
</LinearLayout>
</LinearLayout>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerViewListaClientes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/white"
android:cacheColorHint="@android:color/transparent"
android:clipToPadding="false"
android:divider="@null"
android:dividerHeight="0dp"
android:listSelector="@android:color/transparent"
android:scrollbarStyle="outsideOverlay"
android:scrollbars="vertical" />
<ProgressBar
android:id="@+id/progressBar"
style="@android:style/Widget.ProgressBar.Large"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center|center_vertical"
android:layout_marginRight="6dp"
android:visibility="invisible" />
</FrameLayout>
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
I added this to the activity in Manifest:
android:windowSoftInputMode="adjustPan"
What's going wrong is the following:
When I scroll down the list and the Toolbar hides and I click on an EditText and the keyboard opens, then when I close the keyboard and roll the list up, the Toolbar simply disappears, but this only happens when the keyboard is open when the Toolbar is hidden:
Photo: Before:
Then: