title: Animate a ViewGroup height using GestureDetectorCompat
body: <p>I am using <code>GestureDetectorCompat</code> to do a very basic animation of the <code>ViewGroup</code> height. On the <code>onScroll</code> event I am taking the <code>ViewGroup</code> and subtracting or adding the <code>distanceY</code> I am getting from the <code>onScroll</code> method signature.</p>
  
  <pre><code>@Override
  public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
  
      FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) container.getLayoutParams();
  
      params.height = (int) (container.getHeight() + distanceY);
      container.setLayoutParams(params);
  
      return true;
  }
  </code></pre>
  
  <p>The animation is very choppy/flickery. Am I missing something here? Is there a better way to animate a <code>View</code> height according to motion events?</p>
  
  <p>Another wondering I have, When I drag down the view, <code>distanceY</code> from the <code>onScroll</code> event contains positive and negative values. Shouldn't dragging down consist of only negative values? how can I tell if user is dragging down or up?</p>