[Java] [Android] Animation läuft nich so wie sie soll...

Dieses Thema im Forum "Programmierung & Entwicklung" wurde erstellt von Fuselmeister, 18. November 2010 .

  1. 18. November 2010
    [Android] Animation läuft nich so wie sie soll...

    Hi, ich wollte eine Alpha Animation in meine App einbauen. Die läuft auch aber anstatt das Bild langsam fadet, flakert es iwie nur

    Hier sind die XML Sets:

    fadeout.xml
    Code:
    <?xml version="1.0" encoding="utf-8" ?>
    
    <set
     xmlns:android="http://schemas.android.com/apk/res/android" 
     android:repeatCount="-1"
     android:repeatMode="restart"
     android:interpolator="@android:anim/linear_interpolator"
     >
     
    <alpha
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:interpolator="@android:anim/linear_interpolator"
     android:fromAlpha="1.0"
     android:toAlpha="0.0"
     android:duration="250"
     />
     
    </set>
    fadein.xml
    Code:
    <?xml version="1.0" encoding="utf-8" ?>
    
    <set
     xmlns:android="http://schemas.android.com/apk/res/android" 
     android:repeatCount="-1"
     android:repeatMode="restart"
     android:interpolator="@android:anim/linear_interpolator"
     >
    
    <alpha
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:interpolator="@android:anim/linear_interpolator"
     android:fromAlpha="0.0"
     android:toAlpha="1.0"
     android:duration="250"
     />
    </set>
    Hier die Initalisierung:
    Code:
    Anim_FadeOut = AnimationUtils.loadAnimation(this, R.anim.fadeout);
     Anim_FadeOut.setDuration(250);
     Anim_FadeIn = AnimationUtils.loadAnimation(this, R.anim.fadein);
     Anim_FadeOut.setDuration(250);
    ... und der Aufruf:
    Code:
    LL.startAnimation(Anim_FadeOut);
     LL.removeAllViews();
    // ... aktualisierung...
    LL.startAnimation(Anim_FadeIn);
    weiß da jemand rat? Liegt es evtl. an dem LL.removeAllView() direkt hinter .startAnimation(), aber eigentlich müsste der ja warten bis die Animation abgeschlossen ist... ich bin ratlos^^

    mfg
    Fuselmeister

    p.s. LL = LinearLayout
     
  2. Video Script

    Videos zum Themenbereich

    * gefundene Videos auf YouTube, anhand der Überschrift.