Code example for DecelerateInterpolator

Methods: getInterpolation

0
	 
	private void animateToCenterStep() { 
		long curTime = System.currentTimeMillis();
		float percentTime = (float) (curTime - startTime)
				/ (float) (endTime - startTime);
		float percentDistance = interpolator.getInterpolation(percentTime);
		 
		if (DBG) Log.i(TAG, "animateToCenterStep: %t=" + percentDistance + " %d=" + percentDistance + 
							" x=" + (int) (percentDistance * (endFlingX - startFlingX)) + 
							" y=" + (int) (percentDistance * (endFlingY - startFlingY)));
		moveRing((int) (startFlingX + percentDistance * (endFlingX - startFlingX)), 
				(int) (startFlingY + percentDistance * (endFlingY - startFlingY)));
 
		// not yet finished? 
		if (percentTime < 1.0f) {
			// more! 
			post(new Runnable() {
				@Override 
				public void run() { 
					animateToCenterStep(); 
				}