Добавить поведение прокрутки панели приложения в несколько представлений в CoordinatorLayout

Я хочу добавить поддержку прокрутки для более чем одного прокручиваемого дочернего представленияCoordinatorLayout в сочетании сAppBarLayout а такжеCollapsingToolbarLayout, При прокруткеRecyclerView илиAppBarLayout (сокращенный код ниже), панель приложения и ее содержимое успешно прокручиваются и сворачиваются. Однако при попытке инициировать событие прокрутки наLinearLayout вышеRecyclerViewничего не происходит, потому чтоLinearLayout не знает, чтобы прокрутить или свернуть вид.

Цель состоит в том, чтобы иметьLinearLayout действовать как липкий заголовок кRecyclerView и нижний колонтитулAppBarLayout и получить такое же поведение прокрутки, какRecyclerView, похожий наВоспроизведение в случайном порядке Spotify / доступный автономный заголовок, На самом деле, было бы здорово, если быappbar_scrolling_view_behavior layout_behavior может быть применен кLinearLayout аналогичноRecyclerView, но я представляю, что поведение игнорируется при просмотре без прокрутки. Кто-нибудь знает об обходном пути для этого, который не требует реализацииLinearLayout рассматривать как строку вRecyclerView?

<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.support.design.widget.AppBarLayout
        android:id="@+id/app_bar_layout"
        android:layout_width="match_parent"
        android:layout_height="@dimen/collapsible_app_bar_height"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

        <android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/collapsing_toolbar_layout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@drawable/gradient_banner"
            app:contentScrim="@color/background_content_frame"
            app:layout_scrollFlags="scroll|exitUntilCollapsed">

            <ImageView
                android:id="@+id/image_header"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:src="@drawable/some_image"
                app:layout_collapseMode="parallax"/>

            <android.support.v7.widget.Toolbar
                android:id="@+id/collapsible_toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
                app:layout_collapseMode="pin"/>

        </android.support.design.widget.CollapsingToolbarLayout>

    </android.support.design.widget.AppBarLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="@dimen/slide_handle_height"
        android:orientation="horizontal"
        android:background="@color/slide_handle"
        android:gravity="center_vertical">

        <!-- three buttons -->

    </LinearLayout>

    <android.support.v7.widget.RecyclerView
        android:id="@+id/recycler_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="@dimen/slide_handle_height"
        android:scrollbars="vertical"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

</android.support.design.widget.CoordinatorLayout>

Ответы на вопрос(4)

Ваш ответ на вопрос