void animateChallengeTo(int y,int velocity){
  if (mChallengeView == null) {
    return;
  }
  cancelTransitionsInProgress();
  mChallengeInteractiveInternal=false;
  mChallengeView.setLayerType(LAYER_TYPE_HARDWARE,null);
  final int sy=mChallengeView.getBottom();
  final int dy=y - sy;
  if (dy == 0) {
    completeChallengeScroll();
    return;
  }
  setScrollState(SCROLL_STATE_SETTLING);
  final int childHeight=mChallengeView.getHeight();
  final int halfHeight=childHeight / 2;
  final float distanceRatio=Math.min(1f,1.0f * Math.abs(dy) / childHeight);
  final float distance=halfHeight + halfHeight * distanceInfluenceForSnapDuration(distanceRatio);
  int duration=0;
  velocity=Math.abs(velocity);
  if (velocity > 0) {
    duration=4 * Math.round(1000 * Math.abs(distance / velocity));
  }
 else {
    final float childDelta=(float)Math.abs(dy) / childHeight;
    duration=(int)((childDelta + 1) * 100);
  }
  duration=Math.min(duration,MAX_SETTLE_DURATION);
  mScroller.startScroll(0,sy,0,dy,duration);
  postInvalidateOnAnimation();
}

void animateChallengeTo ( int y , int velocity ) { if ( mChallengeView == null ) { return ; } cancelTransitionsInProgress ( ) ; mChallengeInteractiveInternal = false ; mChallengeView . setLayerType ( LAYER_TYPE_HARDWARE , null ) ; final int sy = mChallengeView . getBottom ( ) ; final int dy = y - sy ; if ( dy == 0 ) { completeChallengeScroll ( ) ; return ; } setScrollState ( SCROLL_STATE_SETTLING ) ; final int childHeight = mChallengeView . getHeight ( ) ; final int halfHeight = childHeight / 2 ; final float distanceRatio = Math . min ( 1f , 1.0f * Math . abs ( dy ) / childHeight ) ; final float distance = halfHeight + halfHeight * distanceInfluenceForSnapDuration ( distanceRatio ) ; int duration = 0 ; velocity = Math . abs ( velocity ) ; if ( velocity > 0 ) { duration = 4 * Math . round ( 1000 * Math . abs ( distance / velocity ) ) ; } else { final float childDelta = ( float ) Math . abs ( dy ) / childHeight ; duration = ( int ) ( ( childDelta + 1 ) * 100 ) ; } duration = Math . min ( duration , MAX_SETTLE_DURATION ) ; mScroller . startScroll ( 0 , sy , 0 , dy , duration ) ; postInvalidateOnAnimation ( ) ; }
animate the bottom edge of the challenge view to the given position .
