0

Ich erstelle eine Animation, bei der mein Bild an eine andere Stelle auf dem Bildschirm übersetzt wird und dann langsam eingeblendet wird. Ich habe den Übersetzungsteil abgeschlossen (siehe unten), aber jetzt, wenn ich die Einblendanimation starte, verschwindet sie für die Dauer und beginnt danach wieder. Ich möchte zeigen, dass das Bild allmählich eingeblendet wird ... Irgendwelche Ideen, warum das passiert?Bild verschwindet in der Animation

public static int moveTwo(AnimationListener activity, View apa, int animationmove) 


Log.v("MOVETWO", "Started move2"); 
AnimationSet picMov2 = new AnimationSet(true); 
picMov2.setAnimationListener(activity); 
RotateAnimation rotate2 = new RotateAnimation(0, 0, 
     Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 
     0.5f); 
// rotate1.setStartOffset(50); 
rotate2.setDuration(2000); 
picMov2.addAnimation(rotate2); 
TranslateAnimation trans2 = new TranslateAnimation(-200, -400, 0, 0); 
trans2.setDuration(2000); 
picMov2.setFillAfter(true); 
picMov2.addAnimation(trans2); 
apa.startAnimation(picMov2); 
animationmove = 3; 
return animationmove; 





public static int moveThree(AnimationListener activity, View apa, int animationmove) 


AlphaAnimation fadein = new AlphaAnimation((float) 0.3, 1);//HERE THE IMAGE IS DISAPPEARING 
fadein.setAnimationListener(activity); 

fadein.setDuration(2000); 
fadein.setFillAfter(true); 
apa.startAnimation(fadein); 
animationmove=4; 
return animationmove; 

Antwort

-1

nur benötigt, um eine Aktion übersetzen an der gleichen Stelle zu schaffen, damit es nicht in seine ursprüngliche Position zurückgeht

public static int moveThree(AnimationListener activity, View apa, int animationmove) 
{ 
    Log.v("MOVETHREE", "Started move3"); 

    AnimationSet picMov3 = new AnimationSet(true); 
    picMov3.setAnimationListener(activity); 
    AlphaAnimation fadein = new AlphaAnimation((float) 0.4, 1); 
    // rotate1.setStartOffset(50); 
    fadein.setDuration(duration); 
    picMov3.addAnimation(fadein); 
    TranslateAnimation trans1 = new TranslateAnimation(-400, -400, 0, 0); 
    trans1.setDuration(duration); 
    picMov3.setFillAfter(true); 
    picMov3.addAnimation(trans1); 
    apa.startAnimation(picMov3); 
+0

die Antwort nicht, was nicht erklärt, ist es schwer, zwischen dem beziehen Antwort und die Frage !!! –