title: How to implement the fling for a custom view
body: <p>I have a custom view which draw something accroding to a certain parameter(<code>center</code>).</p>
  
  <p>Once the user move the view I will re-draw the view.(I make this by using the <code>GestureDetector</code> and override the <code>onScroll</code> method).</p>
  
  <p>However now I want to implement the fling effect. I know I have to do something insid the <code>onFling</code> method.</p>
  
  <p>But I do not know how to make it.</p>
  
  <p>It seems that <code>OverScroller.fling</code> is what I want.  But I can not found more documents about it.</p>
  
  <pre><code>@Override
  public void computeScroll() {
      super.computeScroll();
      if (sc.computeScrollOffset()) {
          int stx = sc.getStartX(), sty = sc.getStartY();
          int cx = sc.getCurrX(), cy = sc.getCurrY();
          int edx = sc.getFinalX(), edy = sc.getFinalY();
          if (cx &lt;= edx &amp;&amp; cy &lt;= edy) {
              this.center = new Point(this.center.x+cx-stx,this.center.y+cy-sty);
          }
          ViewCompat.postInvalidateOnAnimation(this);
      }
  
  }
  public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
      Log.i("event", "fling:" + e1.getX() + "," + e2.getX());
      sc.forceFinished(true);
      sc.fling(0, 0, velocityX, velocityY, -30, 30, -30, 30);
      return true;
  }
  </code></pre>
  
  <p>When I ran the application, I can not get the expected fling effect.</p>
  
  <p>Do I miss anything?</p>