This is where I got to...

I think this might work? At least it makes it to the emulator.. :-P

namespace MonoAndroidApplication1
{
    public class MonoAnimate
    {
        private View myView;
        private int currentColor;

        //stepping params
        private static int STEPPING = 30;
        private static int ANIMDURATION = 50;

        public MonoAnimate(View view)
        {
            this.myView = view;

            AnimationSet _as = new AnimationSet(true);
            _as.FillEnabled = true;
            _as.Interpolator = new BounceInterpolator();

            TranslateAnimation anim1 = new TranslateAnimation(-300, 100, 0,
0);
            anim1.Duration = ANIMDURATION;
            anim1.RepeatCount = (255 / STEPPING);
            anim1.FillAfter = true;
            anim1.Interpolator = new AccelerateInterpolator();
            _as.AddAnimation(anim1);

            TranslateAnimation anim2 = new TranslateAnimation(100, 0, 0, 0);
            anim2.Duration = ANIMDURATION;
            anim2.StartOffset = ANIMDURATION;
            _as.AddAnimation(anim2);
        }
    }
}

On Tue, Aug 2, 2011 at 8:58 PM, fonager <t...@netcoders.dk> wrote:

> Ohhh, what a fool I have been.
>
> I was using a "AnimationSet" to have many animations running at once, so
> adding a Interpolator on one of the animations, made no sence.
>
> I changed it, so I applied the interpolator to the animationset instead,
> and
> now everything bounces.
>
>        AnimationSet aset = new AnimationSet(true);
>
>        AlphaAnimation fadeIn = new AlphaAnimation(0.0f, 1.0f);
>        fadeIn.Duration = 3000;
>         AlphaAnimation fadeOut = new AlphaAnimation(1.0f, 0.0f);
>        fadeOut.Duration = 3000;
>         ScaleAnimation scale = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f);
>        scale.Duration = 3000;
>         scale.Interpolator = new BounceInterpolator(); *// <-- has no
> effect*
>
>        aset.AddAnimation(scale);
>        aset.AddAnimation(fadeIn);
>        aset.AddAnimation(fadeOut);
>
>        aset.Interpolator = new BounceInterpolator(); *// <-- work on all
> animations together*
>
>
> --
> View this message in context:
> http://mono-for-android.1047100.n5.nabble.com/SetAnimationListener-tp4656547p4658311.html
> Sent from the Mono for Android mailing list archive at Nabble.com.
> _______________________________________________
> Monodroid mailing list
> Monodroid@lists.ximian.com
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
>



-- 
Glen Hassell
Inner Technique
http://innertech.com.au/
Office: 03 9687 0006
Mobile: +61 (0) 438 340 385
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to