2010-11-24 6 views
0

로테이션 애니메이션을 사용하여 새로운 활동을 시작하는 방법을 아는 사람이 있습니까?로테이션 애니메이션을 사용하여 활동 간을 전환하십시오.

나는 내가 원하는 것을 설명하려고합니다

: 예를 들어

은 내가 SKD 샘플 "ApiDemos에"에 안드로이드 응용 프로그램 exemple에 대해 검토 한 결과 내가 com.exemple.android.apis.animation.Rotate3dAnimation.javacom.exemple.android.apis.animation.Transition3d.java라는 이름의 클래스를 발견했습니다. 이 클래스를 사용하면 회전 효과가있는 이미지를 전환 할 수 있습니다.

이미지 대신 동일하지만 이미지를 수행하는 방법이 있는지 알고 싶습니다. 저는 활동 (whith new layout)이 될 것입니다.

+0

Mardine 작업 여기를 볼 수 있습니다

@Override protected void onResume() { // animateIn this activity ActivitySwitcher.animationIn(findViewById(R.id.help_top), getWindowManager()); super.onResume(); } 

활동 B에 대한 "onResume"기능을 오버라이드 (override) : 명성을 얻으려면, 그리고 대답을 다른 사람을 당신의 질문하고, 투표하고, 당신의 질문에 대한 좋은 대답을 받아들이십시오. –

답변

3

창 관리자는이 시점에서 3D 변환을 지원하지 않습니다. 각 액티비티는 윈도우이기 때문에 액티비티 간의 애니메이션은 윈도우 애니메이션이기 때문에 윈도우 매니저가 지원하는 것으로 제한됩니다.

0

이것이 우리가 달성 할 수있는 방법입니다. 활동 A에서 행동 B로 전환한다고 가정 해 보겠습니다. 먼저 활동 A에 애니메이션을 적용한 다음 재정의 된 함수 "onAnimationFinished"에서 활동 B를 시작합니다. 이렇게하면 활동 A에 대한 애니메이션이 끝난 후에 만 ​​활동 B가 시작됩니다.

// we will only animate activity A here. 
// The activity B will be animated from its onResume() - be sure to implement it. 

final Intent intent = new Intent(getApplicationContext(), B.class); 
// disable default animation for new intent 
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); 
//Animate A 
ActivitySwitcher.animationOut(findViewById(R.id.A), getWindowManager(), new ActivitySwitcher.AnimationFinishedListener() { 
     @Override 
     public void onAnimationFinished() { 
      // Start activity B 
      startActivity(intent); 
     } 
    }); 

이제 당신은 예를

http://blog.robert-heim.de/karriere/android-startactivity-rotate-3d-animation-activityswitcher/comment-page-1/#comment-12025

관련 문제