Exemplo n.º 1
0
        void StartAnimation()
        {
            if (_animationView == null)
            {
                return;
            }

            _animationView.Loop = true;
            _animationView.Play();;
        }
Exemplo n.º 2
0
        void _battle_BattleFinshed(object sender, BattleFinishedEventArgs e)
        {
            Flash.Show(this);
            LogoBack.IsVisible = true;
            if (e.Winner == Current)
            {
                Sound.WIN();
                Enemy.AddBattleHistory(Current, UserProfile.HISTORY_TYPE.LOSE_OFFLINE);
                Current.AddBattleHistory(Enemy, UserProfile.HISTORY_TYPE.WIN);
                var i = 0;
                Device.StartTimer(TimeSpan.FromMilliseconds(50), () =>
                {
                    BattleComment.Show(BattleCommentAreaForEnemy, Enemy.LoseComment);
                    BattleComment.Show(BattleCommentAreaForCurrent, Current.WinComment);
                    i++;
                    return(i != 10);
                });
                Device.BeginInvokeOnMainThread(() =>
                {
                    AnimationView.Animation = "animation_win.json";
                    AnimationView.Play();
                });
                Device.StartTimer(TimeSpan.FromSeconds(3), () =>
                {
                    ShowFourth();
                    return(false);
                });
            }
            else
            {
                Sound.LOSE();
                Enemy.AddBattleHistory(Current, UserProfile.HISTORY_TYPE.WIN_OFFLINE);
                Current.AddBattleHistory(Enemy, UserProfile.HISTORY_TYPE.LOSE);

                var i = 0;
                Device.StartTimer(TimeSpan.FromMilliseconds(50), () =>
                {
                    BattleComment.Show(BattleCommentAreaForCurrent, Current.LoseComment);
                    BattleComment.Show(BattleCommentAreaForEnemy, Enemy.WinComment);
                    i++;
                    return(i != 10);
                });
                DependencyService.Get <IDeviceService>().PlayVibrate();
                Device.BeginInvokeOnMainThread(() =>
                {
                    AnimationView.Animation = "animation_lose.json";
                    AnimationView.Play();
                });
                Device.StartTimer(TimeSpan.FromSeconds(3), () =>
                {
                    Back();
                    return(false);
                });
            }
        }
        public MyPage()
        {
            var x             = "Off";
            var animationView = new AnimationView()
            {
                Animation         = "https://www.lottiefiles.com/storage/datafiles/kuhWLbtVdLIP4PK/data.json",
                Loop              = true,
                AutoPlay          = false,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                IsEnabled         = true,
                IsVisible         = true
            };
            //animationView.IsPlaying = true;
            var playButton = new Button()
            {
                Text = "Play"
            };

            playButton.Clicked += (sender, e) => animationView.Play();


            var tap = new TapGestureRecognizer
            {
                Command = new Command(() =>
                {
                    animationView.IsPlaying = true;
                    if (x == "Off")
                    {
                        x = "On";
                    }
                    else
                    {
                        x = "Off";
                    }
                }),
                NumberOfTapsRequired = 1
            };

            animationView.GestureRecognizers.Add(tap);

            Content = new StackLayout
            {
                Children =
                {
                    animationView,
                    playButton,
                    new Label {
                        Text = x
                    }
                },
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                VerticalOptions   = LayoutOptions.CenterAndExpand
            };
        }
        public LottieAnimationPage()
        {
            InitializeComponent();
            this.BindingContext = viewModel = new LottieAnimationViewModel();
            NavigationPage.SetHasNavigationBar(this, false);

            MessagingCenter.Subscribe <LottieAnimationViewModel>(this, "play", (obj) =>
            {
                AnimationView.Play();
            });
        }
 private void AnimationButtonOnClicked(object sender, System.EventArgs e)
 {
     if (AnimationView.IsPlaying)
     {
         AnimationView.Pause();
         AnimationButton.Text = "Start Animation";
     }
     else
     {
         AnimationView.Play();
         AnimationButton.Text = "Stop Animation";
     }
 }
Exemplo n.º 6
0
        protected override void OnAppearing()
        {
            AnimationView.Play();

            Device.StartTimer(TimeSpan.FromMilliseconds(2500), () =>
            {
                if (isPageLoaded)
                {
                    AnimationView.Play();
                }

                return(isPageLoaded);
            });
        }
Exemplo n.º 7
0
        async Task PlayWinningAnimation()
        {
            try
            {
                var view = new ContentView
                {
                    BackgroundColor   = Color.FromHex("#7000"),
                    VerticalOptions   = LayoutOptions.FillAndExpand,
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                };

                var animation = new AnimationView
                {
                    Animation         = "trophy.json",
                    WidthRequest      = 360,
                    HeightRequest     = 360,
                    Loop              = false,
                    AutoPlay          = false,
                    HorizontalOptions = LayoutOptions.Center,
                    VerticalOptions   = LayoutOptions.Center,
                };

                view.Content = animation;
                view.Opacity = 0;

                var layout = Content as AbsoluteLayout;

                AbsoluteLayout.SetLayoutFlags(view, AbsoluteLayoutFlags.All);
                AbsoluteLayout.SetLayoutBounds(view, new Rectangle(0, 0, 1, 1));
                layout.Children.Add(view);

                await view.FadeTo(1, 250);

                animation.Play();

                await Task.Delay(3000);

                await view.FadeTo(0, 300);

                layout.Children.Remove(view);
            }
            catch (Exception e)
            {
                Log.Instance.LogException(e);
            }
        }
Exemplo n.º 8
0
        public void ShowProgress(string message = null)
        {
            if (_hudRoot == null)
            {
                return;
            }

            Device.BeginInvokeOnMainThread(() =>
            {
                _hudView.Content        = _progressAnimation;
                _hudLabel.Text          = message;
                _hudRoot.IsVisible      = true;
                _hudLabel.IsVisible     = !string.IsNullOrWhiteSpace(message);
                _hudView.IsVisible      = true;
                _progressAnimation.Loop = true;
                _progressAnimation.Play();
            });
        }
Exemplo n.º 9
0
        async Task PlayAnimation()
        {
            var animation = new AnimationView
            {
                Animation         = "checkmark_circle.json",
                WidthRequest      = 160,
                HeightRequest     = 160,
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Center,
            };

            Device.BeginInvokeOnMainThread(() =>
            {
                Hud.Instance.Show("Nice work!", animation);
                animation.Loop = false;
                animation.Play();
            });

            await Task.Delay(2500);

            await Hud.Instance.Dismiss(true);
        }
Exemplo n.º 10
0
        protected override void OnIsLoadingMoreChanged()
        {
            InitializeLoadingMoreAnimation();

            if (IsLoadingMore)
            {
                if (Footer == null)
                {
                    Footer = _animationView;
                }

                _animationView.AbortAnimation(GetHashCode().ToString());
                _animationView.IsVisible = true;
                _animationView.Play();
            }
            else
            {
                _animationView.AbortAnimation(GetHashCode().ToString());
                _animationView.IsPlaying = false;
                _animationView.IsVisible = false;
                Footer = null;
            }
        }
Exemplo n.º 11
0
        private void UpdateControlStateWithAnimation()
        {
            if (IsFavorite)
            {
                if (Parent is Layout <View> animationContainer)
                {
                    //await Task.Delay(1000);
                    if (!animationContainer.Children.Contains(_animationView))
                    {
                        animationContainer.Children.Add(_animationView);
                    }

                    Source = null;
                    _animationView.AbortAnimation(GetHashCode().ToString());
                    _animationView.IsVisible = true;
                    _animationView.Play();
                }
                else
                {
                    System.Diagnostics.Debug.WriteLine($"Favorite button doesn't have parent container to render animation.");
                }
            }
        }
Exemplo n.º 12
0
        private void SetContent()
        {
            var jsonAnimationFile =
                string.IsNullOrEmpty(_jsonAnimationFile) ? _defaultJsonAnimationFile : _jsonAnimationFile;

            var animation = new AnimationView
            {
                Loop      = _loop,
                AutoPlay  = true,
                Animation = jsonAnimationFile
            };

            var label1 = new Label
            {
                TextColor = Color.Black,
                Text      = "UploadMessage1".Translate(),
                HorizontalTextAlignment = TextAlignment.Center,
                VerticalTextAlignment   = TextAlignment.Center
            };

            var label2 = new Label
            {
                TextColor               = Color.Black,
                Text                    = "UploadMessage2".Translate(),
                HorizontalOptions       = LayoutOptions.StartAndExpand,
                HorizontalTextAlignment = TextAlignment.Start,
                VerticalTextAlignment   = TextAlignment.Center,
                LineBreakMode           = LineBreakMode.WordWrap
            };

            var label3 = new Label
            {
                TextColor = Color.Black,
                Text      = "UploadMessage3".Translate(),
                HorizontalTextAlignment = TextAlignment.Center,
                VerticalTextAlignment   = TextAlignment.Center
            };

            var button = new Button
            {
                Text            = "Ok".Translate(),
                Command         = new Command(Close),
                BackgroundColor = Color.Accent,
                TextColor       = Color.White
            };

            animation.Play();
            var frame = new Frame {
                CornerRadius = 10, Margin = 20
            };

            var layout = new AbsoluteLayout
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand
            };

            AbsoluteLayout.SetLayoutBounds(animation, new Rectangle(.5, .1, .5, .2));
            AbsoluteLayout.SetLayoutFlags(animation, AbsoluteLayoutFlags.All);

            AbsoluteLayout.SetLayoutBounds(label1, new Rectangle(.5, .3, .9, .1));
            AbsoluteLayout.SetLayoutFlags(label1, AbsoluteLayoutFlags.All);


            AbsoluteLayout.SetLayoutBounds(label2, new Rectangle(.5, .5, 1, .3));
            AbsoluteLayout.SetLayoutFlags(label2, AbsoluteLayoutFlags.All);

            AbsoluteLayout.SetLayoutBounds(label3, new Rectangle(.5, .75, .9, .1));
            AbsoluteLayout.SetLayoutFlags(label3, AbsoluteLayoutFlags.All);

            AbsoluteLayout.SetLayoutBounds(button, new Rectangle(.5, .9, .4, .1));
            AbsoluteLayout.SetLayoutFlags(button, AbsoluteLayoutFlags.All);

            layout.Children.Add(animation);
            layout.Children.Add(label1);
            layout.Children.Add(label2);
            layout.Children.Add(label3);
            layout.Children.Add(button);
            frame.Content   = layout;
            BackgroundColor = Color.Transparent;
            Content         = frame;
        }
Exemplo n.º 13
0
        public UploadingPage()
        {
            Title          = ApplicationResource.PageUploadingTitle;
            BindingContext = new UploadingViewModel(Navigation);

            animationView = new AnimationView();
            animationView.SetBinding(AnimationView.IsPlayingProperty, new Binding("ShowAnimation"));
            animationView.SetBinding(AnimationView.IsVisibleProperty, new Binding("ShowAnimation"));
            animationView.SetBinding(AnimationView.AnimationProperty, new Binding("Animation"));
            animationView.SetBinding(AnimationView.LoopProperty, new Binding("ShouldLoopAnimation"));
            animationView.AutoPlay      = true;
            animationView.HeightRequest = animationView.WidthRequest = 200;
            animationView.Play();

            var heroImage = new Image();

            heroImage.HeightRequest = heroImage.WidthRequest = 200;
            heroImage.SetBinding(Image.SourceProperty, new Binding("HeroImage"));
            heroImage.SizeChanged += HeroImage_SizeChanged;

            var titleLabel = new Label()
            {
                WidthRequest            = 300,
                FontAttributes          = FontAttributes.Bold,
                TextColor               = Color.Black,
                HorizontalOptions       = LayoutOptions.Center,
                HorizontalTextAlignment = TextAlignment.Center
            };

            titleLabel.SetBinding(Label.TextProperty, new Binding("StatusTitle"));

            var messageLabel = new Label()
            {
                WidthRequest            = 300,
                TextColor               = Color.SlateGray,
                HorizontalOptions       = LayoutOptions.Center,
                HorizontalTextAlignment = TextAlignment.Center
            };

            messageLabel.SetBinding(Label.TextProperty, new Binding("StatusMessage"));

            var startButton = new Button()
            {
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                FontAttributes    = FontAttributes.Bold,
                WidthRequest      = 180,
                HeightRequest     = 40,
                CornerRadius      = 20
            };

            startButton.SetBinding(Button.TextProperty, new Binding("UploadButtonText"));
            startButton.SetBinding(Button.TextColorProperty, new Binding("UploadButtonTextColor"));
            startButton.SetBinding(Button.BackgroundColorProperty, new Binding("UploadButtonColor"));
            startButton.SetBinding(Button.CommandProperty, new Binding("StartUploadCommand"));
            startButton.SetBinding(Button.IsEnabledProperty, new Binding("UploadButtonEnabled"));
            startButton.SetBinding(Button.IsVisibleProperty, new Binding("UploadEnabled"));

            AbsoluteLayout.SetLayoutBounds(startButton, new Rectangle(.5, 1, 180, 40));
            AbsoluteLayout.SetLayoutFlags(startButton, AbsoluteLayoutFlags.PositionProportional);

            uploadingLayout        = new RelativeLayout();
            uploadingLayout.Margin = new Thickness(40);

            uploadingLayout.Children.Add(animationView,
                                         Constraint.RelativeToParent((parent) =>
            {
                return((parent.Width * .5) - (heroImage.Width / 2));
            }),
                                         Constraint.RelativeToParent((parent) =>
            {
                return(parent.Height * .3 - (heroImage.Height / 2));
            })
                                         );
            uploadingLayout.Children.Add(heroImage,
                                         Constraint.RelativeToParent((parent) =>
            {
                return((parent.Width * .5) - (heroImage.Width / 2));
            }),
                                         Constraint.RelativeToParent((parent) =>
            {
                return(parent.Height * .3 - (heroImage.Height / 2));
            })
                                         );

            uploadingLayout.Children.Add(startButton,
                                         Constraint.RelativeToParent((parent) =>
            {
                return((parent.Width * .5) - (startButton.Width / 2));
            }),
                                         Constraint.RelativeToParent((parent) =>
            {
                return((parent.Height * .9) - startButton.Height);
            })
                                         );
            uploadingLayout.Children.Add(messageLabel,
                                         Constraint.RelativeToParent((parent) =>
            {
                return((parent.Width * .5) - (messageLabel.Width / 2));
            }),
                                         Constraint.RelativeToView(startButton, (parent, sibling) =>
            {
                return(startButton.Y - messageLabel.Height - 40);
            })
                                         );
            uploadingLayout.Children.Add(titleLabel,
                                         Constraint.RelativeToParent((parent) =>
            {
                return((parent.Width * .5) - (titleLabel.Width / 2));
            }),
                                         Constraint.RelativeToView(messageLabel, (parent, sibling) =>
            {
                return(messageLabel.Y - titleLabel.Height - 10);
            })
                                         );

            Content = uploadingLayout;
        }
Exemplo n.º 14
0
 private void MyViewModel_ThoughtButtonPressed(object sender, PrayerListViewModel.ThoughtButtonPressedEventArgs e)
 {
     //PRAYER BUTTON
     _animation.Play();
 }
Exemplo n.º 15
0
 private void MyViewModel_PrayerButtonPressed(object sender, PrayerListViewModel.PrayerButtonPressedEventArgs e)
 {
     //THOUGHT BUTTON
     _animation1.Play();
 }
Exemplo n.º 16
0
        public ProgressWheelView()
        {
            var progressWheel = new ProgressWheelAnimatedView()
            {
                Margin = new Thickness(10, 0),
                MillisecondsToCompleteWheel = 6000,
                SegmentCount  = GoalToSegmentCountConverter.ToSegments(Settings.CurrentGoal),
                TotalProgress = Settings.CurrentGoal.RequiredMinutes(),
            };

            progressWheel.SetBinding(
                ProgressWheelAnimatedView.TargetProgressProperty,
                nameof(ViewModel.MinutesBriskWalked));

            progressWheel.Effects.Add(new ViewLifeCycleEffect(loaded: (sender, args) =>
            {
                ViewModel.GoalCompleted = ViewModel.GoalCompleted ==
                                          Settings.CurrentGoal.RequiredMinutes() >=
                                          progressWheel.TargetProgress;
                progressWheel.SetInitialProgress((float)ViewModel?.MinutesBriskWalked);
            }));

            var completeAnimation = new AnimationView()
            {
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions   = LayoutOptions.Fill,
                Animation         = "check.json",
                Loop      = false,
                Margin    = new Thickness(0, 0, 0, 10),
                IsPlaying = true,
            };

            completeAnimation.SetBinding(IsVisibleProperty, nameof(ViewModel.GoalCompleted));

            progressWheel.OnAnimationFinished += () =>
            {
                ViewModel.GoalCompleted = progressWheel.CurrentProgress >= Settings.CurrentGoal.RequiredMinutes();

                if (ViewModel.GoalCompleted)
                {
                    completeAnimation.Play();
                }
            };

            var incomplete = IncompleteContent();

            incomplete.SetBinding(IsVisibleProperty, nameof(ViewModel.GoalCompleted), converter: new InvertedBooleanConverter());
            var complete = CompleteContent();

            complete.SetBinding(IsVisibleProperty, nameof(ViewModel.GoalCompleted));


            Content = new Grid()
            {
                VerticalOptions   = LayoutOptions.Fill,
                HorizontalOptions = LayoutOptions.Fill,
                RowDefinitions    = new RowDefinitionCollection()
                {
                    new RowDefinition()
                    {
                        Height = GridLength.Star
                    },
                    new RowDefinition()
                    {
                        Height = GridLength.Star
                    },
                },
                Children =
                {
                    { progressWheel,     0, 1, 0, 2 },
                    { incomplete,        0, 1, 0, 2 },
                    { completeAnimation, 0, 1, 0, 2 },    // tmp while check.json is not cropped
                    //{completeAnimation, 0, 0 },
                    { complete,          0,1 },
                }
            };
        }
Exemplo n.º 17
0
 public bool Play()
 {
     return(Player?.Play() ?? false);
 }
Exemplo n.º 18
0
        private async void Tgr2_Tapped(object sender, EventArgs e)
        {
            preferiticambiati = true;
            SnackDataDTO index = null;

            foreach (var item in (sender as StackLayout).Children)
            {
                if (item is Label)
                {
                    var snackName = (item as Label).Text;
                    index = result.data.snacks.Single(obj => obj.friendly_name == snackName);
                    break;
                }
            }
            if (index != null)
            {
                string preferito = "";

                foreach (var app in (sender as StackLayout).Children)
                {
                    if (app is StackLayout)
                    {
                        foreach (var an in (app as StackLayout).Children)
                        {
                            if (an is Grid)
                            {
                                foreach (var ans in (an as Grid).Children)
                                {
                                    if (ans is AnimationView)
                                    {
                                        AnimationView ap = (AnimationView)ans;
                                        if (ap.Animation == "star.json")
                                        {
                                            if (Check_FavouritesAndSet(index.id))
                                            {
                                                ap.IsVisible = true;
                                                ap.FadeTo(1);
                                                ap.Play();
                                            }
                                        }
                                    }
                                    if (ans is ImageButton)
                                    {
                                        ImageButton image = (ImageButton)ans;
                                        string      a     = "";
                                        if (Check_Favourites(index.id))
                                        {
                                            a = "fondomerende.image.star_fill.png";
                                        }
                                        else
                                        {
                                            a = "fondomerende.image.star_empty.png";
                                        }


                                        image.Source = ImageSource.FromResource(a);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 19
0
        private void OnPageStateChanged(object sender, PageStateEventArgs e)
        {
            if (e.State == PredictionPageState.NoModelAvailable)
            {
                heroImage.IsVisible     = true;
                titleLabel.IsVisible    = true;
                messageLabel.IsVisible  = true;
                animationView.IsVisible = false;

                if (cameraIsAvailable)
                {
                    cameraPreview.IsVisible = false;
                    captureButton.IsVisible = false;

                    if (ToolbarItems.Contains(browseMedaToolbarItem))
                    {
                        ToolbarItems.Remove(browseMedaToolbarItem);
                    }

                    if (ToolbarItems.Contains(toggleCameraToolbarItem))
                    {
                        ToolbarItems.Remove(toggleCameraToolbarItem);
                    }
                }
            }

            else if (e.State == PredictionPageState.CameraReady)
            {
                if (animationView.IsPlaying)
                {
                    animationView.Pause();
                }

                if (!ToolbarItems.Contains(browseMedaToolbarItem))
                {
                    ToolbarItems.Add(browseMedaToolbarItem);
                }
                browseMedaToolbarItem.IsEnabled = true;

                if (!ToolbarItems.Contains(toggleCameraToolbarItem))
                {
                    ToolbarItems.Add(toggleCameraToolbarItem);
                }
                toggleCameraToolbarItem.IsEnabled = true;

                heroImage.IsVisible     = false;
                titleLabel.IsVisible    = false;
                messageLabel.IsVisible  = false;
                animationView.IsVisible = false;
                cameraPreview.IsVisible = true;
                captureButton.IsVisible = true;

                StartCamera();
            }

            else if (e.State == PredictionPageState.NoCameraReady)
            {
                if (animationView.IsPlaying)
                {
                    animationView.Pause();
                }

                if (!ToolbarItems.Contains(browseMedaToolbarItem))
                {
                    ToolbarItems.Add(browseMedaToolbarItem);
                    browseMedaToolbarItem.IsEnabled = true;
                }

                heroImage.IsVisible     = true;
                titleLabel.IsVisible    = true;
                messageLabel.IsVisible  = true;
                animationView.IsVisible = false;
                if (cameraIsAvailable)
                {
                    cameraPreview.IsVisible = false;
                    captureButton.IsVisible = false;
                }
            }

            else if (e.State == PredictionPageState.Uploading)
            {
                if (browseMedaToolbarItem != null)
                {
                    browseMedaToolbarItem.IsEnabled = false;
                }
                if (toggleCameraToolbarItem != null)
                {
                    toggleCameraToolbarItem.IsEnabled = false;
                }

                heroImage.IsVisible     = true;
                titleLabel.IsVisible    = true;
                messageLabel.IsVisible  = true;
                animationView.IsVisible = true;

                if (cameraIsAvailable)
                {
                    cameraPreview.IsVisible = false;
                    captureButton.IsVisible = false;
                    StopCamera();
                }

                animationView.Play();
                animationView.Loop = true;
            }

            else if (e.State == PredictionPageState.None)
            {
                heroImage.IsVisible     = false;
                titleLabel.IsVisible    = false;
                messageLabel.IsVisible  = false;
                animationView.IsVisible = false;

                if (cameraIsAvailable)
                {
                    cameraPreview.IsVisible = false;
                    captureButton.IsVisible = false;
                    StopCamera();
                }
            }
        }
Exemplo n.º 20
0
        public override void Run(Window window)
        {
            Conformant conformant = new Conformant(window);

            conformant.Show();

            Naviframe navi = new Naviframe(conformant)
            {
                PreserveContentOnPop     = true,
                DefaultBackButtonEnabled = true
            };

            navi.Show();
            conformant.SetContent(navi);

            Layout layout = new Layout(conformant)
            {
                WeightX    = 1,
                WeightY    = 1,
                AlignmentX = -1,
                AlignmentY = -1,
            };

            layout.SetTheme("layout", "application", "default");
            layout.Show();

            Background bg = new Background(layout)
            {
                WeightX    = 1,
                WeightY    = 1,
                AlignmentX = -1,
                AlignmentY = -1,
                Color      = Color.Gray,
            };

            bg.Show();
            layout.SetPartContent("elm.swallow.bg", bg);

            Box box = new Box(conformant)
            {
                WeightX    = 1,
                WeightY    = 1,
                AlignmentX = -1,
                AlignmentY = -1,
            };

            box.Show();
            box.SetPadding(5, 5);
            layout.SetPartContent("elm.swallow.content", box);

            Label label = new Label(box)
            {
                WeightX    = 1,
                WeightY    = 0,
                AlignmentX = 0.5,
                AlignmentY = 0,
            };

            label.Show();
            box.PackEnd(label);

            AnimationView aniview = new AnimationView(box)
            {
                WeightX    = 1,
                WeightY    = 1,
                AlignmentX = -1,
                AlignmentY = -1,
            };

            aniview.SetAnimation(Path.Combine(TestRunner.ResourceDir, "a_mountain.json"));
            aniview.Show();

            Box box1 = new Box(box)
            {
                WeightX      = 1,
                WeightY      = 0,
                AlignmentX   = -1,
                AlignmentY   = 1,
                IsHorizontal = true,
            };

            box1.Show();
            box.PackEnd(box1);

            Label label1 = new Label(box)
            {
                WeightX    = 1,
                WeightY    = 0,
                AlignmentX = 0.0,
                AlignmentY = 0.5,
                Text       = "Default Size = (" + aniview.DefaultSize.Width + "," + aniview.DefaultSize.Height + ")",
            };

            label1.Show();
            box1.PackEnd(label1);

            Label label2 = new Label(box)
            {
                WeightX    = 1,
                WeightY    = 0,
                AlignmentX = 1.0,
                AlignmentY = 0.5,
                Text       = "FrameCount : " + (aniview.FrameCount).ToString(),
            };

            label2.Show();
            box1.PackEnd(label2);

            Label label3 = new Label(box)
            {
                WeightX    = 1,
                WeightY    = 0,
                AlignmentX = 1.0,
                AlignmentY = 0.5,
                Text       = "Duration : " + (Math.Round(Convert.ToDouble(aniview.DurationTime), 2)).ToString(),
            };

            label3.Show();
            box.PackEnd(label3);

            box.PackEnd(aniview);

            Box box2 = new Box(box)
            {
                WeightX      = 1,
                WeightY      = 0,
                AlignmentX   = -1,
                AlignmentY   = 1,
                IsHorizontal = true,
            };

            box2.Show();
            box.PackEnd(box2);

            Check check = new Check(box2)
            {
                WeightX    = 1,
                WeightY    = 0,
                AlignmentX = -1,
                AlignmentY = -1,
                Text       = "Loop",
            };

            check.Show();
            box2.PackEnd(check);

            check.StateChanged += (s, e) =>
            {
                aniview.AutoRepeat = !aniview.AutoRepeat;
            };

            Check check2 = new Check(box2)
            {
                WeightX    = 1,
                WeightY    = 0,
                AlignmentX = -1,
                AlignmentY = -1,
                Text       = "Speed: 0.25x",
            };

            check2.Show();
            box2.PackEnd(check2);

            check2.StateChanged += (s, e) =>
            {
                if (check2.IsChecked)
                {
                    aniview.Speed = 0.25;
                }
                else
                {
                    aniview.Speed = 1.0;
                }
            };

            Slider slider = new Slider(box)
            {
                WeightX            = 1,
                WeightY            = 0,
                AlignmentX         = -1,
                AlignmentY         = -1,
                IsIndicatorVisible = true,
                IndicatorFormat    = "%1.1f",
                Minimum            = 0,
                Maximum            = 1,
            };

            slider.Show();
            box.PackEnd(slider);

            slider.ValueChanged += (s, e) =>
            {
                aniview.Progress = slider.Value;
            };

            Box box3 = new Box(box)
            {
                WeightX      = 1,
                WeightY      = 0,
                AlignmentX   = -1,
                AlignmentY   = 1,
                IsHorizontal = true,
            };

            box3.Show();
            box.PackEnd(box3);

            Label label4 = new Label(box)
            {
                WeightX    = 1,
                WeightY    = 0,
                AlignmentX = 0.0,
                AlignmentY = 0.5,
                Text       = (aniview.MinFrame).ToString() + " / " + (aniview.MaxFrame).ToString(),
            };

            label4.Show();
            box3.PackEnd(label4);

            Label label5 = new Label(box)
            {
                WeightX    = 1,
                WeightY    = 0,
                AlignmentX = 1.0,
                AlignmentY = 0.5,
                Text       = (aniview.MinProgress).ToString() + " / " + (aniview.MaxProgress).ToString(),
            };

            label5.Show();
            box3.PackEnd(label5);

            Box box4 = new Box(box)
            {
                WeightX      = 1,
                WeightY      = 0,
                AlignmentX   = -1,
                AlignmentY   = 1,
                IsHorizontal = true,
            };

            box4.Show();
            box.PackEnd(box4);

            Button btn1 = new Button(box4)
            {
                WeightX    = 1,
                WeightY    = 0,
                AlignmentX = -1,
                AlignmentY = -1,
                Text       = "Play",
            };

            btn1.Show();
            box4.PackEnd(btn1);

            btn1.Clicked += (s, e) =>
            {
                aniview.Play();
                UpdateAnimationViewStateLabel(aniview, label);
            };

            Button btn2 = new Button(box4)
            {
                WeightX    = 1,
                WeightY    = 0,
                AlignmentX = -1,
                AlignmentY = -1,
                Text       = "Reverse",
            };

            btn2.Show();
            box4.PackEnd(btn2);

            btn2.Clicked += (s, e) =>
            {
                aniview.Play(true);
                UpdateAnimationViewStateLabel(aniview, label);
            };

            Button btn3 = new Button(box4)
            {
                WeightX    = 1,
                WeightY    = 0,
                AlignmentX = -1,
                AlignmentY = -1,
                Text       = "Stop",
            };

            btn3.Show();
            box4.PackEnd(btn3);

            btn3.Clicked += (s, e) =>
            {
                aniview.Stop();
            };

            Box box5 = new Box(box)
            {
                WeightX      = 1,
                WeightY      = 0,
                AlignmentX   = -1,
                AlignmentY   = 1,
                IsHorizontal = true,
            };

            box5.Show();
            box.PackEnd(box5);

            Button btn4 = new Button(box5)
            {
                WeightX    = 1,
                WeightY    = 0,
                AlignmentX = -1,
                AlignmentY = -1,
                Text       = "Pause",
            };

            btn4.Show();
            box5.PackEnd(btn4);

            btn4.Clicked += (s, e) =>
            {
                aniview.Pause();
            };

            Button btn5 = new Button(box5)
            {
                WeightX    = 1,
                WeightY    = 0,
                AlignmentX = -1,
                AlignmentY = -1,
                Text       = "Resume",
            };

            btn5.Show();
            box5.PackEnd(btn5);

            btn5.Clicked += (s, e) =>
            {
                aniview.Resume();
            };

            aniview.Started += (s, e) =>
            {
                UpdateAnimationViewStateLabel(aniview, label);
            };

            aniview.Stopped += (s, e) =>
            {
                UpdateAnimationViewStateLabel(aniview, label);
                label4.Text  = "0 / " + (aniview.MaxFrame).ToString();
                label5.Text  = "0 / " + (aniview.MaxProgress).ToString();
                slider.Value = 0;
            };

            aniview.Paused += (s, e) =>
            {
                UpdateAnimationViewStateLabel(aniview, label);
            };

            aniview.Resumed += (s, e) =>
            {
                UpdateAnimationViewStateLabel(aniview, label);
            };

            aniview.Updated += (s, e) =>
            {
                slider.Value = aniview.Progress;
                label4.Text  = (aniview.Frame).ToString() + " / " + (aniview.MaxFrame).ToString();
                label5.Text  = (Math.Round(Convert.ToDouble(aniview.Progress), 2)).ToString() + " / " + (aniview.MaxProgress).ToString();
            };

            UpdateAnimationViewStateLabel(aniview, label);

            navi.Push(layout, "AnimationView Test");
        }