Code example for ScaleAnimation

Methods: setDurationsetFillAfter

0
	 
	private static int	xOffset		= 16;
	private static int	yOffset		= -13;
	 
	public static Animation getScaleAnimation(float fromX,float  toX,float  fromY,float  toY,int durationMillis){
		ScaleAnimation scale = new ScaleAnimation(fromX, toX, fromY, toY, 
				Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
		scale.setDuration(durationMillis);
		scale.setFillAfter(true);
		return scale;
	} 
 
	public static void initOffset(Context context){//由布局文件
		xOffset		= (int) (10.667 *context.getResources().getDisplayMetrics().density);
		yOffset		= -(int) (8.667 *context.getResources().getDisplayMetrics().density);
	} 
	 
	public static Animation getRotateAnimation(float fromDegrees ,float toDegrees,int durationMillis){
		RotateAnimation rotate = new RotateAnimation(fromDegrees, toDegrees,
				Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
Connect your IDE to all the code out there  Get Codota for Java