title: Collapsing margins in Android layouts
body: <p>Is it possible to make margins collapse in Android? Let's say I have a <code>LinearLayout</code> and add three <code>TextView</code>s, each with an <code>android:layout_margin</code> of <code>10dp</code>. I get the following result:</p>
  
  <p><img src="https://i.stack.imgur.com/lNiY8.png" alt="actual result"></p>
  
  <p>However, I'd like to get this result:</p>
  
  <p><img src="https://i.stack.imgur.com/BgsBR.png" alt="expected result"></p>
  
  <p>I know that I could workaround this by setting different top/bottom margins for the different items:</p>
  
  <ul>
  <li>set the top margin of the first item and the bottom margin of the last item to 10dp, </li>
  <li>set the remainding top/bottom margins to 5dp,</li>
  </ul>
  
  <p>but that makes the design more complicated (especially if the TextViews are dynamically created). Is there some way to make the margins behave like in CSS? (For an explanation of why this makes sense, see: <a href="https://stackoverflow.com/questions/3069921/what-is-the-point-of-css-collapsing-margins">What is the point of CSS collapsing margins?</a>)</p>