0

https://www.project-respite.com/lottie-xamarin-forms/

I don't know what I'm doing wrong. I followed the steps on the tutorial, but I am getting this error "View does not contain the definition of 'AddAnimationListner'..."

I've tried using these [1]classes as well: addAnimatorUpdateListener and addAnimationListner.

What can I do to fix it?

Code: screenshot https://i.stack.imgur.com/oJZ1o.jpg

using Android.Animation;
using Android.App;
using Android.Content;
using Android.OS;
using Lottie.Forms.Droid;
using Com.Airbnb.Lottie;


namespace RefrigerantID.Droid
{
    [Activity(Theme = "@style/Theme.Splash",
        MainLauncher = true,
        NoHistory = true)]
    public class SplashActivity : Activity, Animator.IAnimatorListener
    {
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.splash);

            var animationView = FindViewById(Resource.Id.animation_view);
            animationView.AddAnimationListener(this);
        }

        public void OnAnimationCancel(Animator animation)
        {
        }

        public void OnAnimationEnd(Animator animation)
        {
            StartActivity(new Intent(Application.Context, typeof(MainActivity)));
        }

        public void OnAnimationRepeat(Animator animation)
        {
        }

        public void OnAnimationStart(Animator animation)
        {
        }
    }
}
TylerH
  • 20,799
  • 66
  • 75
  • 101
neutJor
  • 55
  • 1
  • 8
  • Hi I am trying todo the same do you happen to have a working sample I cannot make it work I am following the same link.greatly appreciated – developer9969 May 25 '19 at 15:20

1 Answers1

1

What about...

var animationView = FindViewById<LottieAnimationView>(Resource.Id.animation_view);
animationView.AddAnimationListener(this);
Elton Santana
  • 950
  • 3
  • 11
  • 22