public void drawMetaballTransition(Canvas canvas){
  final float v=0.5f;
  final float handleLenRate=2.4f;
  if (mDestinationPoint == null) {
    if (mSelectedView == null)     return;
 else     mDestinationPoint=getCenter(mSelectedView);
  }
  float originRadius, destinationRadius=0.0f;
  originRadius=mfSelectorRadius - (mfSelectorRadius * mfInterpolatedTime);
  destinationRadius=(mfSelectorRadius * mfInterpolatedTime);
  if (mTransitionalCircle == null) {
    if (mfSelectorRadius == 0.0)     calculateSelectorRadius();
    mTransitionalCircle=new Circle();
    mTransitionalCircle.setCenterPoint(new Point(0,mDestinationPoint.getY()));
  }
  mTransitionalCircle.setRadius(originRadius);
  mTransitionalCircle.setCenterX(mOriginPoint.getX() + (mfTransitionDistance * mfInterpolatedTime));
  canvas.drawCircle(mTransitionalCircle.getCenterX(),mTransitionalCircle.getCenterY(),originRadius,mMetaballDestination);
  canvas.drawCircle(mDestinationPoint.getX(),mDestinationPoint.getY(),destinationRadius,mMetaballDestination);
  float nDistance=getDistance(mTransitionalCircle.getCenterPoint(),mDestinationPoint);
  float radiusSum=originRadius + destinationRadius;
  float arc1, arc2=0.0f;
  if ((originRadius == 0) || (destinationRadius == 0))   return;
 else   if (nDistance < radiusSum) {
    arc1=(float)Math.acos(((originRadius * originRadius) + (nDistance * nDistance) - (destinationRadius * destinationRadius)) / (2 * originRadius * nDistance));
    arc2=(float)Math.acos(((destinationRadius * destinationRadius) + (nDistance * nDistance) - (originRadius * originRadius)) / (2 * destinationRadius * nDistance));
  }
 else {
    arc1=arc2=0.0f;
  }
  Point diffPoint=new Point(mDestinationPoint.getX() - mTransitionalCircle.getCenterX(),mDestinationPoint.getY() - mTransitionalCircle.getCenterY());
  float angle1=(float)Math.atan2(diffPoint.getY(),diffPoint.getX());
  float angle2=(float)Math.acos((originRadius - destinationRadius) / nDistance);
  float angle1a=angle1 + arc1 + (angle2 - arc1) * v;
  float angle1b=angle1 - arc1 - (angle2 - arc1) * v;
  float angle2a=(float)(angle1 + Math.PI - arc2 - (Math.PI - arc2 - angle2) * v);
  float angle2b=(float)(angle1 - Math.PI + arc2 + (Math.PI - arc2 - angle2) * v);
  Point p1aTemp=getVector(angle1a,originRadius);
  Point p1bTemp=getVector(angle1b,originRadius);
  Point p2aTemp=getVector(angle2a,destinationRadius);
  Point p2bTemp=getVector(angle2b,destinationRadius);
  Point p1a=new Point(p1aTemp.getX() + mTransitionalCircle.getCenterX(),p1aTemp.getY() + mTransitionalCircle.getCenterY());
  Point p1b=new Point(p1bTemp.getX() + mTransitionalCircle.getCenterX(),p1bTemp.getY() + mTransitionalCircle.getCenterY());
  Point p2a=new Point(p2aTemp.getX() + mDestinationPoint.getX(),p2aTemp.getY() + mDestinationPoint.getY());
  Point p2b=new Point(p2bTemp.getX() + mDestinationPoint.getX(),p2bTemp.getY() + mDestinationPoint.getY());
  Point diffp1p2=new Point(p1a.getX() - p2a.getX(),p1a.getY() - p2a.getY());
  float totalRadius=originRadius + destinationRadius;
  float minDist=Math.min(v * handleLenRate,getLength(diffp1p2.getX(),diffp1p2.getY()) / totalRadius);
  minDist*=Math.min(1,(nDistance * 2) / radiusSum);
  float radius1=originRadius * minDist;
  float radius2=destinationRadius * minDist;
  float pi2=(float)(Math.PI / 2);
  Point segment1=getVector(angle1a - pi2,radius1);
  Point segment2=getVector(angle2a + pi2,radius2);
  Point segment3=getVector(angle2b - pi2,radius2);
  Point segment4=getVector(angle1b + pi2,radius1);
  Path path=new Path();
  path.moveTo(p1a.getX(),p1a.getY());
  path.cubicTo(p1a.getX() + segment1.getX(),p1a.getY() + segment1.getY(),p2a.getX() + segment2.getX(),p2a.getY() + segment2.getY(),p2a.getX(),p2a.getY());
  path.lineTo(p2b.getX(),p2b.getY());
  path.cubicTo(p2b.getX() + segment3.getX(),p2b.getY() + segment3.getY(),p1b.getX() + segment4.getX(),p1b.getY() + segment4.getY(),p1b.getX(),p1b.getY());
  path.lineTo(p1a.getX(),p1a.getY());
  path.close();
  canvas.drawPath(path,mMetaballDestination);
}

public void drawMetaballTransition ( Canvas canvas ) { final float v = 0.5f ; final float handleLenRate = 2.4f ; if ( mDestinationPoint == null ) { if ( mSelectedView == null ) return ; else mDestinationPoint = getCenter ( mSelectedView ) ; } float originRadius , destinationRadius = 0.0f ; originRadius = mfSelectorRadius - ( mfSelectorRadius * mfInterpolatedTime ) ; destinationRadius = ( mfSelectorRadius * mfInterpolatedTime ) ; if ( mTransitionalCircle == null ) { if ( mfSelectorRadius == 0.0 ) calculateSelectorRadius ( ) ; mTransitionalCircle = new Circle ( ) ; mTransitionalCircle . setCenterPoint ( new Point ( 0 , mDestinationPoint . getY ( ) ) ) ; } mTransitionalCircle . setRadius ( originRadius ) ; mTransitionalCircle . setCenterX ( mOriginPoint . getX ( ) + ( mfTransitionDistance * mfInterpolatedTime ) ) ; canvas . drawCircle ( mTransitionalCircle . getCenterX ( ) , mTransitionalCircle . getCenterY ( ) , originRadius , mMetaballDestination ) ; canvas . drawCircle ( mDestinationPoint . getX ( ) , mDestinationPoint . getY ( ) , destinationRadius , mMetaballDestination ) ; float nDistance = getDistance ( mTransitionalCircle . getCenterPoint ( ) , mDestinationPoint ) ; float radiusSum = originRadius + destinationRadius ; float arc1 , arc2 = 0.0f ; if ( ( originRadius == 0 ) || ( destinationRadius == 0 ) ) return ; else if ( nDistance < radiusSum ) { arc1 = ( float ) Math . acos ( ( ( originRadius * originRadius ) + ( nDistance * nDistance ) - ( destinationRadius * destinationRadius ) ) / ( 2 * originRadius * nDistance ) ) ; arc2 = ( float ) Math . acos ( ( ( destinationRadius * destinationRadius ) + ( nDistance * nDistance ) - ( originRadius * originRadius ) ) / ( 2 * destinationRadius * nDistance ) ) ; } else { arc1 = arc2 = 0.0f ; } Point diffPoint = new Point ( mDestinationPoint . getX ( ) - mTransitionalCircle . getCenterX ( ) , mDestinationPoint . getY ( ) - mTransitionalCircle . getCenterY ( ) ) ; float angle1 = ( float ) Math . atan2 ( diffPoint . getY ( ) , diffPoint . getX ( ) ) ; float angle2 = ( float ) Math . acos ( ( originRadius - destinationRadius ) / nDistance ) ; float angle1a = angle1 + arc1 + ( angle2 - arc1 ) * v ; float angle1b = angle1 - arc1 - ( angle2 - arc1 ) * v ; float angle2a = ( float ) ( angle1 + Math . PI - arc2 - ( Math . PI - arc2 - angle2 ) * v ) ; float angle2b = ( float ) ( angle1 - Math . PI + arc2 + ( Math . PI - arc2 - angle2 ) * v ) ; Point p1aTemp = getVector ( angle1a , originRadius ) ; Point p1bTemp = getVector ( angle1b , originRadius ) ; Point p2aTemp = getVector ( angle2a , destinationRadius ) ; Point p2bTemp = getVector ( angle2b , destinationRadius ) ; Point p1a = new Point ( p1aTemp . getX ( ) + mTransitionalCircle . getCenterX ( ) , p1aTemp . getY ( ) + mTransitionalCircle . getCenterY ( ) ) ; Point p1b = new Point ( p1bTemp . getX ( ) + mTransitionalCircle . getCenterX ( ) , p1bTemp . getY ( ) + mTransitionalCircle . getCenterY ( ) ) ; Point p2a = new Point ( p2aTemp . getX ( ) + mDestinationPoint . getX ( ) , p2aTemp . getY ( ) + mDestinationPoint . getY ( ) ) ; Point p2b = new Point ( p2bTemp . getX ( ) + mDestinationPoint . getX ( ) , p2bTemp . getY ( ) + mDestinationPoint . getY ( ) ) ; Point diffp1p2 = new Point ( p1a . getX ( ) - p2a . getX ( ) , p1a . getY ( ) - p2a . getY ( ) ) ; float totalRadius = originRadius + destinationRadius ; float minDist = Math . min ( v * handleLenRate , getLength ( diffp1p2 . getX ( ) , diffp1p2 . getY ( ) ) / totalRadius ) ; minDist *= Math . min ( 1 , ( nDistance * 2 ) / radiusSum ) ; float radius1 = originRadius * minDist ; float radius2 = destinationRadius * minDist ; float pi2 = ( float ) ( Math . PI / 2 ) ; Point segment1 = getVector ( angle1a - pi2 , radius1 ) ; Point segment2 = getVector ( angle2a + pi2 , radius2 ) ; Point segment3 = getVector ( angle2b - pi2 , radius2 ) ; Point segment4 = getVector ( angle1b + pi2 , radius1 ) ; Path path = new Path ( ) ; path . moveTo ( p1a . getX ( ) , p1a . getY ( ) ) ; path . cubicTo ( p1a . getX ( ) + segment1 . getX ( ) , p1a . getY ( ) + segment1 . getY ( ) , p2a . getX ( ) + segment2 . getX ( ) , p2a . getY ( ) + segment2 . getY ( ) , p2a . getX ( ) , p2a . getY ( ) ) ; path . lineTo ( p2b . getX ( ) , p2b . getY ( ) ) ; path . cubicTo ( p2b . getX ( ) + segment3 . getX ( ) , p2b . getY ( ) + segment3 . getY ( ) , p1b . getX ( ) + segment4 . getX ( ) , p1b . getY ( ) + segment4 . getY ( ) , p1b . getX ( ) , p1b . getY ( ) ) ; path . lineTo ( p1a . getX ( ) , p1a . getY ( ) ) ; path . close ( ) ; canvas . drawPath ( path , mMetaballDestination ) ; }
draw the current metaball transitional state based on the interpolator value .
