title: How can I make a recyclerView to take up to half the screen(max) in android constraint layout?
body: <p>I have a screen that contains 2 views, a map(top) and a recycler(bottom)
  The rules are simple .</p>
  
  <p>the recycler view is allowed to extend up to the middle of the screen, if more space is needed then it should scroll instead, the map will occupy the rest of the space, Of course if the recycler has less elements then it should shrink leaving more space for the map .. </p>
  
  <p>I am trying to achieve this using constraint layout, also I am trying to avoid solutions that involved calculations .</p>
  
  <p>Check image below for more information on what I am trying to achieve : 
  <a href="https://i.stack.imgur.com/0k3lQ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/0k3lQ.png" alt="enter image description here"></a></p>
  
  <p>Here is my code </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;androidx.constraintlayout.widget.ConstraintLayout 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:background="@color/white"
      tools:context="com.qmic.itraffic.ui.activities.crowdsourcing.CrowdSourceReportingDetailsActivity"&gt;
  
      &lt;androidx.constraintlayout.widget.Guideline
          android:id="@+id/halfScreenGuideline"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:orientation="horizontal"
          app:layout_constraintGuide_percent="0.5" /&gt;
  
      &lt;FrameLayout
          android:id="@+id/content_frame"
          android:layout_width="0dp"
          android:layout_height="0dp"
          app:layout_constraintBottom_toTopOf="@+id/categories"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          android:background="@color/manatee"
          /&gt;
  
      &lt;androidx.recyclerview.widget.RecyclerView
          android:id="@+id/categories"
          android:layout_width="match_parent"
          android:layout_height="0dp"
          android:layout_marginTop="8dp"
          android:layout_marginBottom="8dp"
          android:clipToPadding="false"
          app:layout_constraintBottom_toBottomOf="parent"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="@+id/halfScreenGuideline" /&gt;
  
  
  
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  </code></pre>
  
  <p><strong>My Question is can I achieve this behaviour using xml only (constraint layout )?or I would need to do calculation ?</strong></p>