2013-07-31 3 views
3

나는 내가 느린/더 빠르고 크기하기로 반송 할 수 있도록 바운스 효과를 수정할 내가 안드로이드 애니메이션 보간을 편집하는 방법은 무엇입니까?

<scale xmlns:android="http://schemas.android.com/apk/res/android" 
    android:duration="500" 
    android:fromXScale="0" 
    android:fromYScale="0" 
    android:interpolator="@android:anim/bounce_interpolator" 
    android:toXScale="1" 
    android:toYScale="1" /> 

interpolater 바운스와 노력 바운스 효과와 함께하고 싶어 .. 규모가 애니메이션 대화를 주도해야 . 난 아무것도 찾을 didnt는, T는 세트

<set > 
    <scale 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     android:duration="500" 
     android:fromXScale="0" 
     android:fromYScale="0" 
     android:toXScale="1" 
     android:toYScale="1" /> 
    <scale 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     android:duration="100" 
     android:fromXScale="1" 
     android:fromYScale="1" 
     android:startOffset="500" 
     android:toXScale=".8" 
     android:toYScale=".8" /> 
    <scale 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     android:duration="100" 
     android:fromXScale=".8" 
     android:fromYScale=".8" 
     android:startOffset="600" 
     android:toXScale="1" 
     android:toYScale="1" /> 
</set> 

전체 애니메이션 행위를 이상하게 그것을 만들려고? 내 질문에 의해이 애니메이션을 해결하는 방법 또는 어떻게 bounce_interpolator 수정하는 방법은 무엇입니까?

답변

2

ipfx.org를 사용하여 사용자 정의 보간기를 만듭니다.
바운스 예제를 사용하고 필요에 맞게 편집하십시오. 사용보다
http://ipfx.org/?p=7ffffffe575efffe9e02fffed8f6fffe&l=2f13c5ac138b3d6ad338a5a77a8386807d6e

앱()

import org.ipfx.Interpolator; 

... 
... 

final org.ipfx.Interpolator interpolator = org.ipfx.Interpolator.parseUrl(urlData); 

ObjectAnimator animator = ObjectAnimator.ofFloat(...); 
animator.setDuration(1000); 

animator.setInterpolator(new TimeInterpolator() { 
    @Override 
    public float getInterpolation(float input) { 
     return interpolator.calc(input); 
    } 
}); 

animator.start(); 
에서 보간을 생성