본문 바로가기

프로그래밍/Android 짜투리 지식

[android] 제자리에서 도는 애니메이션

주소록에 sync 맞추기 위해 작성한 애니메이션

Animation anim = new RotateAnimation(360, 0, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);

anim.setDuration(1000); anim.setStartOffset(0); // anim.setFillEnabled(true); // animation 종료 후, 뷰의 위치를 유지하는 것을 컨트롤 할것인가 // anim.setFillAfter(true); // animation 종료 후, 뷰의 위치를 유지하겠는가 anim.setInterpolator(AnimationUtils.loadInterpolator(mOwnerActivity.getApplicationContext(), android.R.anim.decelerate_interpolator)); imgSyncContact.setBackgroundResource(R.drawable.btn_youtube_sync_s); imgSyncContact.setAnimation(anim);