コード例 #1
0
        protected override void OnAppearing()
        {
            base.OnAppearing();

            if (String.IsNullOrEmpty(LogoFileImageSource))
            {
                throw new Exception("You must set the LogoFileImageSource property to specify the logo");
            }

            logo.Source = LogoFileImageSource;

            List <Task> animationTaskList;

            if (!isInitialized)
            {
                Device.BeginInvokeOnMainThread(async() =>
                {
                    await Task.Delay(500);
                    await logo?.TranslateTo(0, -layout.Height * 0.3 - 10, 250);
                    await logo?.TranslateTo(0, -layout.Height * 0.3 + 5, 100);
                    await logo?.TranslateTo(0, -layout.Height * 0.3, 50);

                    await logo?.TranslateTo(0, -200 + 5, 100);
                    await logo?.TranslateTo(0, -200, 50);

                    var logoSloginAnimationTask           = logoSlogan?.FadeTo(1, 5);
                    var newUserSignUpButtonAnimationTask  = newUserSignUpButton?.FadeTo(1, 250);
                    var forgotPasswordButtonAnimationTask = forgotPasswordButton?.FadeTo(1, 250);
                    var loginEntryAnimationTask           = loginEntry?.FadeTo(1, 250);
                    var passwordEntryAnimationTask        = passwordEntry?.FadeTo(1, 250);
                    var saveUsernameAnimationTask         = saveUsername?.FadeTo(1, 250);
                    var rememberMeAnimationTask           = rememberMe?.FadeTo(1, 250);
                    var loginButtonAnimationTask          = loginButton?.FadeTo(1, 249);

                    animationTaskList = new List <Task>
                    {
                        logoSloginAnimationTask,
                        newUserSignUpButtonAnimationTask,
                        forgotPasswordButtonAnimationTask,
                        loginEntryAnimationTask,
                        passwordEntryAnimationTask,
                        saveUsernameAnimationTask,
                        rememberMeAnimationTask,
                        loginButtonAnimationTask
                    };

                    await Task.WhenAll(animationTaskList);

                    isInitialized = true;
                    RunAfterAnimation();
                });
            }
        }
コード例 #2
0
        private async Task AnimateLoginStart()
        {
            await Task.Run(() =>
            {
                LoginEntry.FadeTo(0, 500, Easing.Linear);
                PasswordEntry.FadeTo(0, 500, Easing.Linear);
                LoginButton.FadeTo(0, 500, Easing.Linear);
            });


            await LogoImage.TranslateTo(0, 50, 1000, Easing.Linear);

            while ((BindingContext as LoginPageViewModel).Busy)
            {
                await LogoImage.FadeTo(1, 600);

                await LogoImage.FadeTo(0, 600);
            }
        }
コード例 #3
0
        protected async override void OnAppearing()
        {
            base.OnAppearing();

            logo.Source = LogoFileImageSource;

            if (!isInitialized)
            {
                await Task.Delay(500);

                await logo.TranslateTo(0, -(layout.Height - logo.Y), 250);

                loginLabel.FadeTo(1, fadeTime);
                newUserSignUpButton.FadeTo(1, fadeTime);
                loginEntry.FadeTo(1, fadeTime);
                passwordEntry.FadeTo(1, fadeTime);
                await loginButton.FadeTo(1, fadeTime);

                isInitialized = true;
                RunAfterAnimation();
            }
        }
コード例 #4
0
        protected async override void OnAppearing()
        {
            base.OnAppearing();

            if (String.IsNullOrEmpty(LogoFileImageSource))
            {
                throw new Exception("You must set the LogoFileImageSource property to specify the logo");
            }

            logo.Source = LogoFileImageSource;

            if (!isInitialized)
            {
                await Task.Delay(500);

                await logo.TranslateTo(0, -layout.Height * 0.3 - 10, 250);

                await logo.TranslateTo(0, -layout.Height * 0.3 + 5, 100);

                await logo.TranslateTo(0, -layout.Height * 0.3, 50);

                await logo.TranslateTo(0, -200 + 5, 100);

                await logo.TranslateTo(0, -200, 50);

                newUserSignUpButton.FadeTo(1, 250);
                forgotPasswordButton.FadeTo(1, 250);
                loginEntry.FadeTo(1, 250);
                passwordEntry.FadeTo(1, 250);
                saveUsername.FadeTo(1, 250);
                rememberMe.FadeTo(1, 250);
                await loginButton.FadeTo(1, 249);

                isInitialized = true;
                RunAfterAnimation();
            }
        }