title: Why is requestLayout being called directly after invalidate
body: <p>I'm learning about custom views and wanted to learn about <code>invalidate()</code> and <code>requestLayout()</code>.</p>
  
  <p>Please refer to this answer and its diagram:</p>
  
  <blockquote>
    <p><a href="https://stackoverflow.com/a/25846243/4243687">https://stackoverflow.com/a/25846243/4243687</a></p>
  </blockquote>
  
  <p><code>invalidate()</code> tells Android that the state of the view has changed and needs to be re-drawn.</p>
  
  <p><code>requestLayout()</code> means the size of the view may have changed and needs to be remeasured, and then re-drawn.</p>
  
  <p><code>invalidate()</code> will invoke <code>dispatchDraw()</code>, <code>draw()</code>, and <code>onDraw()</code> hence it re-renders the view.</p>
  
  <p><code>requestLayout()</code> on the other hand does pretty much everything from measuring to re-rendering again.</p>
  
  <p>Why do so many of the examples out there (even the <code>TextView</code> source code) call <code>invalidate()</code> and then <code>requestLayout()</code> right on the next line?</p>