Code example for VelocityTracker

Methods: clear, recycle

0
          * @see android.view.VelocityTracker#clear() 
          * @see android.view.VelocityTracker#recycle() 
          */ 
    private void releaseVelocityTracker() { 
        if(null != mVelocityTracker) {
            mVelocityTracker.clear();
            mVelocityTracker.recycle();
            mVelocityTracker = null;
        } 
    } 
 
    private static final String sFormatStr = "velocityX=%f\nvelocityY=%f";
 
    /** 
     * 记录当前速度 
     * 
     * @param velocityX x轴速度 
     * @param velocityY y轴速度 
     */ 
    private void recodeInfo(final float velocityX, final float velocityY) {
        final String info = String.format(sFormatStr, velocityX, velocityY);