title: Android sticky-footer: Align footer view to table, until it reaches screen size, then become fixed.at the bottom
body: <p>This should be similar to an iOS tableview footer, also seen in various websites (sticky-footer).</p>
  
  <p>I want to achieve the following:</p>
  
  <p><a href="https://i.stack.imgur.com/a3FUp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/a3FUp.png" alt="diagram"></a></p>
  
  <p><strong>A</strong> is a <code>RecyclerView</code> with variable number of rows. </p>
  
  <p>When <strong>A</strong> is smaller than screen (or parent) size, <strong>B</strong> (footer) should be placed bellow the last row.</p>
  
  <p>When <strong>A</strong> + <strong>B</strong> are bigger than screen size, then <strong>B</strong> becomes fixed at the bottom and <strong>A</strong> content is scrollable.</p>
  
  <p>We are currently performing this with <code>onMeasure</code> functions that calculate all components heights in order to resize A accordingly.</p>
  
  <p>I was wondering if there is an easier way to do it, maybe with <code>ConstraintLayout</code>.</p>