Code example for RotateAnimation

Methods: setDurationsetInterpolatorsetRepeatCountsetRepeatMode

0
	 
	/** 
	 * 初始化动画 
	 */ 
	private static void initAnim(Context context) {
		anim_rotate = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF,0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
		anim_rotate.setDuration(1200);//转动的快慢
		anim_rotate.setRepeatMode(Animation.RESTART);
		anim_rotate.setInterpolator(AnimationUtils.loadInterpolator(context,android.R.anim.linear_interpolator));
		anim_rotate.setRepeatCount(Animation.INFINITE);
	} 
	/** 
	 * loading 对话框,该对话框有图标和文字说明,文字在图标上面显示 
	 * @param context 
	 */ 
	public static void showLoadingDialogWithTextDown(Context context, String showStr){
		try { 
			LayoutInflater layoutInflater = LayoutInflater.from(context);
			LinearLayout linearLayout = (LinearLayout) layoutInflater.inflate(R.layout.dialog_loading_down, null);
			Button loadingBtn = (Button) linearLayout.findViewById(R.id.loading_btn_down);
Stop searching for code, let great code find you!  Add Codota to your java IDE