title: How do I constrain components that are a direct children of CoordinatorLayout to components inside a ConstraintLayout?
body: <p>I am trying to align a fab on the horizontal divider. At the same time I need the fab and CircularRevealLinearLayout to be direct children of the CoordinatorLayout. If they are not direct children, the fab will not animate. I tried to place the CoordinatorLayout within the ConstraintLayout and constrain it to the horizontal divider but it would not work. </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;com.google.android.material.card.MaterialCardView
      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:id="@+id/players_container"
      android:layout_width="500dp"
      android:layout_height="600dp"&gt;
  
      &lt;androidx.coordinatorlayout.widget.CoordinatorLayout
          android:id="@+id/coordinator"
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
          &lt;com.google.android.material.circularreveal.CircularRevealLinearLayout
              android:id="@+id/circular_reveal"
              android:layout_width="300dp"
              android:layout_height="500dp"
              android:elevation="10dp"
              android:visibility="invisible"
              app:layout_constraintTop_toTopOf="@id/edit_btn"
              app:layout_constraintEnd_toEndOf="@id/edit_btn"
              android:background="@color/color_secondary"
              app:layout_behavior="com.google.android.material.transformation.FabTransformationSheetBehavior"/&gt;
  
          &lt;com.google.android.material.floatingactionbutton.FloatingActionButton
              android:id="@+id/edit_btn"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:src="@drawable/ic_edit_black_24dp"
              app:layout_constraintHorizontal_bias=".95"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toBottomOf="@id/horizontal_divider"
              app:layout_constraintBottom_toBottomOf="@id/horizontal_divider"
              app:layout_constraintEnd_toEndOf="parent"/&gt;
  
      &lt;androidx.constraintlayout.widget.ConstraintLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
  
          &lt;androidx.constraintlayout.widget.ConstraintLayout
              android:id="@+id/image_layout"
              android:layout_width="match_parent"
              android:layout_height="0dp"
              app:layout_constraintBottom_toTopOf="@id/horizontal_divider"
              app:layout_constraintTop_toTopOf="parent"&gt;
  
  
              &lt;ImageView
                  android:id="@+id/teamBackground"
                  android:layout_width="match_parent"
                  android:layout_height="400dp"
                  android:src="@drawable/team_golfball"
                  app:layout_constraintTop_toTopOf="parent"
                  app:layout_constraintStart_toStartOf="parent"
                  app:layout_constraintBottom_toBottomOf="parent"
                  app:layout_constraintEnd_toEndOf="parent" /&gt;
  
              &lt;com.google.android.material.textview.MaterialTextView
                  android:id="@+id/team_name"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  app:layout_constraintStart_toStartOf="@id/image_layout"
                  app:layout_constraintEnd_toEndOf="@id/image_layout"
                  app:layout_constraintTop_toTopOf="@id/image_layout"
                  app:layout_constraintBottom_toBottomOf="@id/image_layout"
                  android:text="Team One"
                  style="@style/TextAppearance.MyTheme.Headline7"/&gt;
  
          &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  
  
          &lt;View
              android:id="@+id/horizontal_divider"
              android:layout_width="match_parent"
              android:layout_height="1dp"
              android:background="@color/black_regular"
              app:layout_constraintTop_toBottomOf="@id/image_layout"
              app:layout_constraintBottom_toTopOf="@id/player_card_recyclerView"/&gt;
  
          &lt;androidx.recyclerview.widget.RecyclerView
              android:id="@+id/player_card_recyclerView"
              android:layout_width="match_parent"
              android:layout_height="0dp"
              app:layout_constraintHeight_percent=".75"
              android:overScrollMode="never"
              android:padding="20dp"
              app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
              app:layout_constraintBottom_toBottomOf="parent"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toBottomOf="@id/horizontal_divider"
              tools:itemCount="5"
              tools:listitem="@layout/playercard_draggable" /&gt;
  
      &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
      &lt;/androidx.coordinatorlayout.widget.CoordinatorLayout&gt;
  &lt;/com.google.android.material.card.MaterialCardView&gt;
  
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/w9w5z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/w9w5z.png" alt="enter image description here"></a></p>
  
  <p>what I want: </p>
  
  <p><a href="https://i.stack.imgur.com/sNZFp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sNZFp.png" alt="enter image description here"></a></p>