이게 RecyclerView를 갖는 게시판목록 xml입니다
<android.support.design.widget.CoordinatorLayout
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:fitsSystemWindows="true"
tools:context=".Activity.ArticleListActivity">
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/toolbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:contentScrim="?attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways">
<android.support.v7.widget.Toolbar
android:id="@+id/list_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/AppTheme.PopupOverlay">
<TextView
android:id="@+id/boardName"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:textColor="@color/textColorPrimary"
android:textSize="20dp" />
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_article_list" />
</android.support.design.widget.CoordinatorLayout>
그리고 include된 content_article_list.xml은 다음과 같습니다.
<com.malinskiy.superrecyclerview.SuperRecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/article_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/windowBackground"
android:clipToPadding="false"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
저 SuperRecyclerview는 FrameLayout을 상속받는 클래스로 해당 클래스 내부에 RecyclerView를 가지고 있습니다.
이런 구조인데 RecyclerView에서 아무리 스크롤링을 해도 Toolbar가 미동도 안합니다.
검색하다 안돼서 StackOverflow에서도 질문해보고 답변도 받아서 적용해보고 했지만 역시나 같네요
FrameLayout이 문제인가 싶었지만 Toolbar를 제외한 영역에 FrameLayout도 잘사용하더군요
layout_behavior를 코드로 FrameLayout(SuperRecyclerView)에 추가도 해줘봤지만 역시나...
지금상태로는 Toolbar가 StatusBar밑에 겹쳐있습니다.
android:fitsSystemWindows="true"
를 계층별로 적용해보고 했는데 안먹히네요 ㅠ