title: Scrollview doesn't scroll after resizing it's child using animation
body: <p>I have a LinearLayout inside a ScrollView. At some point I collapse and expand the LinearLayout. After that the scrollview does scroll. Any ideas?</p>
  
  <pre><code>&lt;ScrollView
      android:id="@+id/scrollView"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:fillViewport="false"&gt;
  
      &lt;LinearLayout
          android:id="@+id/detailsView"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="vertical"
          android:visibility="visible"
          &gt;
  ........
  &lt;/LinearLayout&gt;
  &lt;/ScrollView&gt;
  </code></pre>
  
  <p>Expand and collapse is done using ValueAnimator over LayoutParams (height) of the LinearLayout.</p>
  
  <p><strong>Update:</strong> I think important is that it breaks down after animated expansion/collapse. Until that it works fine.</p>
  
  <p><strong>Update 2:</strong> For expanding again, I measured the expected height as follows:</p>
  
  <pre><code>  int expectedHeight = detailsView.measure(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
  </code></pre>
  
  <p>and animate expansion to that height. This measured the height to 2000+ instead of expected 800 something. Thus the sizes were equal and scrollview didn't scroll, although it didn't show the full hierarchy.</p>
  
  <p>As a quick-fix I save the current height before collapsing and use it as the target height on expanding. The question is, can this be done automatically without dirty-height saving?</p>