Exemplo n.º 1
0
        protected override void OnAppearing()
        {
            base.OnAppearing();
            FromTitleLabel.Opacity  = 0;
            FromTitleLabel.Opacity  = 0;
            DescriptionText.Opacity = 0;

            var parentAnim = new Animation();

            // animate the background angle
            parentAnim.Add(0, 1, new Animation(t =>
            {
                _colorAngleAnim = t;
                PageBackground.InvalidateSurface(); //update canvas eachtime _colorAngleAmin change
            }, 0, 100, Easing.SinInOut));           //Go between 0 and 100 height (the middle row), _colorAngleAmin stop changing till 100 height is reached

            // title animations
            parentAnim.Add(0.1, .25, new Animation(t => FromTitleLabel.TranslationY = t, start: 50, end: 0, easing: Easing.SinInOut));
            parentAnim.Add(0.1, .25, new Animation(t => FromTitleLabel.Opacity      = t, start: 0, end: 1, easing: Easing.SinInOut));
            parentAnim.Add(0.1, .3, new Animation(t => FromAuthorLabel.TranslationY = t, start: 50, end: 0, easing: Easing.SinInOut));
            parentAnim.Add(0.1, .3, new Animation(t => FromAuthorLabel.Opacity      = t, start: 0, end: 1, easing: Easing.SinInOut));

            // book background
            parentAnim.Add(0, .2, new Animation(t => BookBorderBoxView.Scale = t, 0, 1));

            // description background
            //DesciptionBackGround
            DescriptionBackground.AnchorX = 0;
            parentAnim.Add(beginAt: .1, finishAt: .4, new Animation(t => DescriptionBackground.ScaleX = t, 0, 1, Easing.SinInOut));

            // description text
            parentAnim.Add(.30, .4, new Animation(t => DescriptionText.ScaleX = t, 0, 1, Easing.SinInOut));

            parentAnim.Commit(this, "PageAnimations", 16, 1000);
        }
Exemplo n.º 2
0
        protected override void OnAppearing()
        {
            base.OnAppearing();
            FromTitleLabel.Opacity       = 0;
            FromAuthorLabel.Opacity      = 0;
            DescriptionText.Opacity      = 0;
            DescriptionBackground.ScaleX = 0;


            var parentAnim = new Animation();

            // animate the background angle
            parentAnim.Add(0, 1, new Animation(t =>
            {
                _colorAngleAnim = t;
                PageBackground.InvalidateSurface();
            }, 0, 100, Easing.SinInOut));

            // title animations
            parentAnim.Add(.10, .25, new Animation(t => FromTitleLabel.TranslationY = t, 50, 0, Easing.SinInOut));
            parentAnim.Add(.0, .25, new Animation(t => FromTitleLabel.Opacity       = t, 0, 1, Easing.SinInOut));
            parentAnim.Add(.10, .3, new Animation(t => FromAuthorLabel.TranslationY = t, 50, 0, Easing.SinInOut));
            parentAnim.Add(.0, .3, new Animation(t => FromAuthorLabel.Opacity       = t, 0, .5, Easing.SinInOut));

            // book background
            parentAnim.Add(0, .2, new Animation(t => BookBorderBoxView.Scale = t, 0, 1));

            // description background
            //DescriptionBackground
            DescriptionBackground.AnchorX = 0;
            parentAnim.Add(.2, .4, new Animation(t => DescriptionBackground.ScaleX = t, 0, 1, Easing.SinInOut));

            // description text
            parentAnim.Add(.4, .5, new Animation(t => DescriptionText.Opacity = t, 0, 1, Easing.SinInOut));


            parentAnim.Commit(this, "PageAnimations", 16, 2000);
        }
Exemplo n.º 3
0
        protected override void OnAppearing()
        {
            base.OnAppearing();

            // add the elements to the shared transition
            Transition.SetName(FromTitleLabel, "FromTitle");
            Transition.SetName(FromAuthorLabel, "FromAuthor");
            Transition.SetName(SelectedBookTitleLabel, "ToTitle");
            Transition.SetName(SelectedBookAuthorLabel, "ToAuthor");

            // initial view values
            FromTitleLabel.Opacity          = 0;
            FromAuthorLabel.Opacity         = 0;
            SelectedBookTitleLabel.Opacity  = 0;
            SelectedBookAuthorLabel.Opacity = 0;

            DescriptionText.Opacity                  = 0;
            DescriptionBackground.ScaleX             = 0;
            SelectedBookDescriptionText.Opacity      = 0;
            SelectedBookDescriptionBackground.ScaleX = 0;

            BookBorderBoxView.Opacity         = 0;
            SelectedBookBorderBoxView.Opacity = 0;

            SwapPanel.WidthRequest             = 50;
            SwapPanel.Scale                    = 0;
            SwapLabel.Opacity                  = 0;
            CycleArrow.Opacity                 = 0;
            SelectedBookBookmark.Opacity       = 0;
            SelectedBookBookmarkShadow.Opacity = 0;
            SwapFromBookmark.Opacity           = 0;
            SwapFromBookmarkShadow.Opacity     = 0;

            var parentAnim = new Animation();

            // animate the background angle
            parentAnim.Add(0, .3, new Animation(t =>
            {
                _colorAngleAnim = t;
                PageBackground.InvalidateSurface();
            }, 0, 200, Easing.SinInOut));

            // Title Animations
            parentAnim.Add(0.00, 0.15, new Animation(t => FromTitleLabel.TranslationY  = t, 50, 0, Easing.SinInOut));
            parentAnim.Add(0.00, 0.18, new Animation(t => FromTitleLabel.Opacity       = t, 0, 1, Easing.SinInOut));
            parentAnim.Add(0.00, 0.15, new Animation(t => FromAuthorLabel.TranslationY = t, 50, 0, Easing.SinInOut));
            parentAnim.Add(0.00, 0.15, new Animation(t => FromAuthorLabel.Opacity      = t, 0, .5, Easing.SinInOut));

            parentAnim.Add(0.00, 0.15, new Animation(t => SelectedBookTitleLabel.TranslationY  = t, 50, 0, Easing.SinInOut));
            parentAnim.Add(0.00, 0.18, new Animation(t => SelectedBookTitleLabel.Opacity       = t, 0, 1, Easing.SinInOut));
            parentAnim.Add(0.00, 0.15, new Animation(t => SelectedBookAuthorLabel.TranslationY = t, 50, 0, Easing.SinInOut));
            parentAnim.Add(0.00, 0.15, new Animation(t => SelectedBookAuthorLabel.Opacity      = t, 0, .5, Easing.SinInOut));

            // Book Background
            parentAnim.Add(0.05, 0.15, new Animation(t => BookBorderBoxView.Scale           = t, 0, 1));
            parentAnim.Add(0.05, 0.15, new Animation(t => BookBorderBoxView.Opacity         = t, 0, 1));
            parentAnim.Add(0.05, 0.15, new Animation(t => SelectedBookBorderBoxView.Scale   = t, 0, 1));
            parentAnim.Add(0.05, 0.15, new Animation(t => SelectedBookBorderBoxView.Opacity = t, 0, 1));

            // Description Background
            DescriptionBackground.AnchorX = 0;
            parentAnim.Add(0.15, 0.35, new Animation(t => DescriptionBackground.ScaleX = t, 0, 1, Easing.SinInOut));
            SelectedBookDescriptionBackground.AnchorX = 1;
            parentAnim.Add(0.15, 0.35, new Animation(t => SelectedBookDescriptionBackground.ScaleX = t, 0, 1, Easing.SinInOut));

            // Description Text
            parentAnim.Add(0.30, .40, new Animation(t => DescriptionText.Opacity             = t, 0, 1, Easing.SinInOut));
            parentAnim.Add(0.30, .40, new Animation(t => SelectedBookDescriptionText.Opacity = t, 0, 1, Easing.SinInOut));

            // Animate in the bookmarks
            parentAnim.Add(0.30, .40, new Animation(t => SelectedBookBookmark.Opacity       = t, 0, 1, Easing.SinInOut));
            parentAnim.Add(0.30, .40, new Animation(t => SelectedBookBookmarkShadow.Opacity = t, 0, .5, Easing.SinInOut));
            parentAnim.Add(0.30, .40, new Animation(t => SwapFromBookmark.Opacity           = t, 0, 1, Easing.SinInOut));
            parentAnim.Add(0.30, .40, new Animation(t => SwapFromBookmarkShadow.Opacity     = t, 0, .5, Easing.SinInOut));

            // animate in the swap panel
            parentAnim.Add(0.45, 0.60, new Animation(t => { SwapPanel.Scale = t; }, 0, 1, Easing.SinInOut));
            parentAnim.Add(0.50, 0.70, new Animation(t => { SwapPanel.WidthRequest = t; }, 50, 200, Easing.SinInOut));
            parentAnim.Add(0.60, 0.70, new Animation(t => { SwapLabel.Opacity = t; }, 0, 1));

            // animate in the arrow
            parentAnim.Add(0.80, 0.85, new Animation(t => { CycleArrow.Opacity = t; }, 0, 1));
            parentAnim.Add(0.80, 1.00, new Animation(t => { CycleArrow.Rotation = t; }, 0, 180, Easing.SinInOut));

            parentAnim.Commit(this, "PageAnimations", 16, 3000);
        }