Even more problems when using CoordinatorLayout and AppBarLayout.
I am trying to achieve the main functionality of scrolling a toolbar when turning off the screen while scrolling down and returning to the screen when scrolling up.
However, my current setup shows a problem: not only the toolbar does not scroll, as the ListView seems to take the screen below. It is almost as if it were offset by the height of the AppBarLayout.
Here is the gif describing the problem, note that the last item is disabled and the ScrollBar is disabled:

My layout is pretty standard:
<?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:background="@color/background"> <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="?android:attr/actionBarSize" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" android:background="@color/orange" app:layout_scrollFlags="scroll|enterAlways"/> </android.support.design.widget.AppBarLayout> <android.support.v4.widget.SwipeRefreshLayout android:id="@+id/swipeToRefresh" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior"> <ExpandableListView android:id="@+id/listView" android:groupIndicator="@android:color/transparent" android:layout_width="match_parent" android:dividerHeight="0px" android:layout_height="match_parent"/> </android.support.v4.widget.SwipeRefreshLayout> </android.support.design.widget.CoordinatorLayout>
android android-coordinatorlayout android-appbarlayout
Graeme
source share