AppBarLayout Kind nicht beim scrollen Zuklappen

Ich habe eine AppBarLayout enthält eine horizontale RecyclerView unter seinen Kindern.
Die Geschwister der AppBarLayout ist ein ViewPager (mit einer " vertikalen RecyclerView).

Ist hier die XML:

<android.support.design.widget.CoordinatorLayout
    android:id="@+id/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"
    tools:context=".ui.search.SearchResultFragment">

<android.support.v4.view.ViewPager
    android:id="@+id/view_pager"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:overScrollMode="never"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

<android.support.design.widget.AppBarLayout
    android:id="@+id/appBarLayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:elevation="@dimen/d2"
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

    <LinearLayout
        android:id="@+id/header_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:background="@color/white"
        android:gravity="center_vertical"
        android:orientation="horizontal">

        <ImageView
            android:id="@+id/back_image_view"
            android:layout_width="?attr/actionBarSize"
            android:layout_height="?attr/actionBarSize"
            android:scaleType="center"
            android:src="@drawable/ic_backarrow_gray"/>

        <android.support.v7.widget.RecyclerView
            android:id="@+id/query_terms_recycler_view"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_gravity="center_vertical"
            android:layout_weight="1"/>

        <ImageView
            android:id="@+id/search_image_view"
            android:layout_width="?attr/actionBarSize"
            android:layout_height="?attr/actionBarSize"
            android:scaleType="center"
            android:src="@drawable/ic_search_gray"/>

    </LinearLayout>

    <android.support.v7.widget.RecyclerView
        android:id="@+id/related_terms_recycler_view"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="@color/search_term_bg"
        app:layout_scrollFlags="scroll|enterAlways"/>

    <android.support.design.widget.TabLayout
        android:id="@+id/tab_layout"
        android:layout_width="match_parent"
        android:layout_height="@dimen/d8"
        android:background="@color/tab_and_nav_bar"/>

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

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

Ich habe bereits ein anderes UI mit AppBarLayout welches in der Lage ist zu reagieren um einen Bildlauf erfolgreich mit einem Toolbar . Der code ist so ziemlich das gleiche, aber in diesem Fall etwas falsch, da das RecyclerView bricht nicht /ausblenden.

  • Was ist dein problem im detail?
  • Es hat einfach keine Reaktion auf das scrolling-Geste. Es verbergen sollte der recycler anzeigen, aber nichts passiert.
  • Ich glaube, die "Scrollbar" (hidable) Ansichten oben sein muss. Funktioniert es, wenn Sie bewegen Sie die RecyclerView vor dem LinearLayout ?
  • Ich meine, dass der Inhalt der AppBarLayout sollte 1 sein. RecyclerView (mit scrollFlags); 2 LinearLayout; 3. TabLayout . Funktioniert es auf diese Weise?
  • Hey ich versuche jetzt. Ich werde Antworten, um Ihre Antwort unten.
Schreibe einen Kommentar