Ejemplo n.º 1
0
        protected override async Task OnDisappearingAnimationBegin()
        {
            if (!IsAnimationEnabled)
            {
                return;
            }

            var taskSource = new TaskCompletionSource <bool>();

            var currentHeight = FrameContainer.Height;

            await Task.WhenAll(
                FnameEntry.FadeTo(0),
                LnameEntry.FadeTo(0),
                UsernameEntry.FadeTo(0),
                PasswordEntry.FadeTo(0),
                LoginButton.FadeTo(0));

            FrameContainer.Animate("HideAnimation", d =>
            {
                FrameContainer.HeightRequest = d;
            },
                                   start: currentHeight,
                                   end: 170,
                                   finished: async(d, b) =>
            {
                await Task.Delay(500);
                taskSource.TrySetResult(true);
            });

            await taskSource.Task;
        }
Ejemplo n.º 2
0
        protected override async Task OnAppearingAnimationEnd()
        {
            if (!IsAnimationEnabled)
            {
                return;
            }

            var translateLength = 800u;

            await Task.WhenAll(
                FnameEntry.TranslateTo(0, 0, easing: Easing.SpringOut, length: translateLength),
                FnameEntry.FadeTo(1),
                //LnameEntry.TranslateTo(0, 0, easing: Easing.SpringOut, length: translateLength),
                //LnameEntry.FadeTo(1),

                //UsernameEntry.TranslateTo(0, 0, easing: Easing.SpringOut, length: translateLength),
                //UsernameEntry.FadeTo(1),

                (new Func <Task>(async() =>
            {
                await Task.Delay(400);
                await Task.WhenAll(

                    LnameEntry.TranslateTo(0, 0, easing: Easing.SpringOut, length: translateLength),
                    LnameEntry.FadeTo(1),
                    Task.Delay(200),
                    UsernameEntry.TranslateTo(0, 0, easing: Easing.SpringOut, length: translateLength),
                    UsernameEntry.FadeTo(1),
                    Task.Delay(200),
                    PasswordEntry.TranslateTo(0, 0, easing: Easing.SpringOut, length: translateLength),
                    PasswordEntry.FadeTo(1));
            }))());

            await Task.WhenAll(
                CloseImage.FadeTo(1),
                CloseImage.ScaleTo(1, easing: Easing.SpringOut),
                CloseImage.RotateTo(0),
                LoginButton.ScaleTo(1),
                LoginButton.FadeTo(1));
        }