Ich versuche eine Animation zu machen, die von der aktuellen Position in die Mitte des Bildschirms gleiten und dann umdrehen wird. Ich habe jede bewegliche Komponente richtig funktioniert, aber sobald ich sie alle in einen Satz mit dem Startoffset gesetzt habe, startet die Animation nicht, bis dieser Offset endet und alle Animationen auf einmal ausgeführt werden. Jede Hilfe wird sehr geschätzt.Android - Animation Start Offset funktioniert nicht richtig
slide_down.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- Slide down -->
<translate
android:fromYDelta="0%"
android:toYDelta="100%"
android:duration="1000"/>
<!-- Set alpha to fully opaque -->
<alpha
android:fromAlpha="0.8"
android:toAlpha="1.0"
android:duration="1000" />
<!-- Flip image once it's in the center -->
<!-- ***** HERE IS THE only offset I set ****** -->
<scale
android:fromXScale="0.0"
android:toXScale="1.0"
android:pivotX="50%"
android:fromYScale="1.0"
android:toYScale="1.0"
android:startOffset="1000"
android:duration="200" />
</set>
Telefonvorwahl
Animation anim = AnimationUtils.loadAnimation(getActivity(), slideDirection);
anim.setAnimationListener(new AnimationListener() {
public void onAnimationStart(Animation animation) {
}
public void onAnimationRepeat(Animation animation) {
}
public void onAnimationEnd(Animation animation) {
mCallBack.categorySelected(view.getId());
}
});
view.clearAnimation();
view.startAnimation(anim);
Danke, Dman
Dank für die Antwort. Nein, was ich suche, ist, dass die Übersetzung und die Alpha gleichzeitig ausgeführt werden, wobei die Flip-Animation beginnt, sobald das Bild in die Mitte verschoben ist und vollständig undurchsichtig ist – DMCApps