如何按顺序折叠布局?

How to collapse layouts in order?

我正在尝试制作折叠工具栏,其中

但在我的布局中,两个块同时移动(或者如果我将两个相对布局放在同一个折叠布局中,则作为一个块移动)

<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/app_bar_layout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/white">

    <android.support.design.widget.CollapsingToolbarLayout
      android:id="@+id/collapsing_1"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:minHeight="56dip"
      android:orientation="vertical"
      app:layout_scrollFlags="scroll|enterAlways|exitUntilCollapsed">


      <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="56dip">

      </RelativeLayout>

      <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="56dip"
        android:background="@color/white"
        android:minHeight="56dip"
        app:layout_collapseMode="pin"/>

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

    <android.support.design.widget.CollapsingToolbarLayout
      android:id="@+id/collapsing_2"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      app:layout_scrollFlags="scroll">


      <RelativeLayout 
        android:id="@+id/holder_event"
        android:layout_width="match_parent"
        android:layout_height="195dip"
        app:layout_collapseMode="parallax"
        app:layout_scrollFlags="scroll">

      </RelativeLayout>


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

我用下面的表格实现了它。折叠 2 通过边距位于折叠 1 下方,它也只有滚动标志。折叠一个总是进入和模式引脚,它使折叠 1 保持在原位,直到有额外的未折叠 space

  <android.support.design.widget.AppBarLayout
    android:id="@+id/app_bar_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/white">

    <android.support.design.widget.CollapsingToolbarLayout
      android:id="@+id/ll_collapsing"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:minHeight="56dip"
      android:orientation="vertical"
      app:layout_scrollFlags="scroll|exitUntilCollapsed">


      <RelativeLayout
        android:id="@+id/colapsing_2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="285dp"
        app:layout_collapseMode="parallax"
        app:layout_scrollFlags="scroll">
      </RelativeLayout>

      <LinearLayout
        android:id="@+id/colapsing_1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:minHeight="56dip"
        android:orientation="vertical"
        app:layout_collapseMode="pin"
        app:layout_scrollFlags="scroll|enterAlways">

      </LinearLayout>

      <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="56dip"
        android:background="@color/white"
        android:minHeight="56dip"
        app:layout_collapseMode="pin">
      </android.support.v7.widget.Toolbar>
    </android.support.design.widget.CollapsingToolbarLayout>


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