public void onPull(float deltaDistance){
  final long now=AnimationUtils.currentAnimationTimeMillis();
  if (mState == STATE_PULL_DECAY && now - mStartTime < mDuration) {
    return;
  }
  if (mState != STATE_PULL) {
    mGlowScaleY=PULL_GLOW_BEGIN;
  }
  mState=STATE_PULL;
  mStartTime=now;
  mDuration=PULL_TIME;
  mPullDistance+=deltaDistance;
  float distance=Math.abs(mPullDistance);
  mEdgeAlpha=mEdgeAlphaStart=Math.max(PULL_EDGE_BEGIN,Math.min(distance,MAX_ALPHA));
  mEdgeScaleY=mEdgeScaleYStart=Math.max(HELD_EDGE_SCALE_Y,Math.min(distance * PULL_DISTANCE_EDGE_FACTOR,1.f));
  mGlowAlpha=mGlowAlphaStart=Math.min(MAX_ALPHA,mGlowAlpha + (Math.abs(deltaDistance) * PULL_DISTANCE_ALPHA_GLOW_FACTOR));
  float glowChange=Math.abs(deltaDistance);
  if (deltaDistance > 0 && mPullDistance < 0) {
    glowChange=-glowChange;
  }
  if (mPullDistance == 0) {
    mGlowScaleY=0;
  }
  mGlowScaleY=mGlowScaleYStart=Math.min(MAX_GLOW_HEIGHT,Math.max(0,glowChange * PULL_DISTANCE_GLOW_FACTOR));
  mEdgeAlphaFinish=mEdgeAlpha;
  mEdgeScaleYFinish=mEdgeScaleY;
  mGlowAlphaFinish=mGlowAlpha;
  mGlowScaleYFinish=mGlowScaleY;
}

public void onPull ( float deltaDistance ) { final long now = AnimationUtils . currentAnimationTimeMillis ( ) ; if ( mState == STATE_PULL_DECAY && now - mStartTime < mDuration ) { return ; } if ( mState != STATE_PULL ) { mGlowScaleY = PULL_GLOW_BEGIN ; } mState = STATE_PULL ; mStartTime = now ; mDuration = PULL_TIME ; mPullDistance += deltaDistance ; float distance = Math . abs ( mPullDistance ) ; mEdgeAlpha = mEdgeAlphaStart = Math . max ( PULL_EDGE_BEGIN , Math . min ( distance , MAX_ALPHA ) ) ; mEdgeScaleY = mEdgeScaleYStart = Math . max ( HELD_EDGE_SCALE_Y , Math . min ( distance * PULL_DISTANCE_EDGE_FACTOR , 1.f ) ) ; mGlowAlpha = mGlowAlphaStart = Math . min ( MAX_ALPHA , mGlowAlpha + ( Math . abs ( deltaDistance ) * PULL_DISTANCE_ALPHA_GLOW_FACTOR ) ) ; float glowChange = Math . abs ( deltaDistance ) ; if ( deltaDistance > 0 && mPullDistance < 0 ) { glowChange = - glowChange ; } if ( mPullDistance == 0 ) { mGlowScaleY = 0 ; } mGlowScaleY = mGlowScaleYStart = Math . min ( MAX_GLOW_HEIGHT , Math . max ( 0 , glowChange * PULL_DISTANCE_GLOW_FACTOR ) ) ; mEdgeAlphaFinish = mEdgeAlpha ; mEdgeScaleYFinish = mEdgeScaleY ; mGlowAlphaFinish = mGlowAlpha ; mGlowScaleYFinish = mGlowScaleY ; }
call when the object is pulled by the user .
