public void TestLoadInvalidJsonString()
        {
            LottieResult <LottieComposition> result = LottieCompositionFactory.FromJsonStringSync(_notJson, "not_json");

            Assert.NotNull(result.Exception);
            Assert.Null(result.Value);
        }
Exemplo n.º 2
0
        public KeyPathTest()
        {
            var task = CoreApplication.MainView.Dispatcher.RunAsync(CoreDispatcherPriority.High, () =>
            {
                _lottieDrawable = new LottieDrawable();

                LottieComposition composition = LottieCompositionFactory.FromJsonStringSync(Fixtures.Squares, "squares").Value;
                _lottieDrawable.SetComposition(composition);
            }).AsTask();

            task.Wait();
        }
Exemplo n.º 3
0
        public Form1()
        {
            InitializeComponent();

            var json   = File.ReadAllText("data.json");
            var result = LottieCompositionFactory.FromJsonStringSync(json, "lol");

            _lottieDrawable.SetComposition(result.Value);
            _lottieDrawable.RepeatMode      = RepeatMode.Restart;
            _lottieDrawable.RepeatCount     = -1; //-1 == infinite
            _lottieDrawable.AnimatorUpdate += _lottieDrawable_AnimatorUpdate;

            _lottieDrawable.Start();
        }