Exemplo n.º 1
0
 private void Entry_Focused(object sender, FocusEventArgs e)
 {
     if (!entryFocused)
     {
         InputSL.TranslateTo(0, -Height / 3.5, easing: Easing.CubicInOut);
         TitleSL.FadeTo(0, easing: Easing.CubicInOut);
         entryFocused = true;
     }
 }
Exemplo n.º 2
0
 private void TapGestureRecognizer_Tapped(object sender, EventArgs e)
 {
     if (animationStarted && entryFocused)
     {
         InputSL.TranslateTo(0, 0, easing: Easing.CubicInOut);
         TitleSL.FadeTo(1, easing: Easing.CubicInOut);
         entryFocused = false;
     }
 }
Exemplo n.º 3
0
        private void PanGestureRecognizer_PanUpdated(object sender, PanUpdatedEventArgs e)
        {
            if (animationStarted)
            {
                return;
            }

            if (LogoImage.TranslationY > -50 && LogoImage.TranslationY <= 0)
            {
                LogoImage.TranslationY += e.TotalY;
                if (LogoImage.TranslationY > 0)
                {
                    LogoImage.TranslationY = 0;
                }
                return;
            }

            animationStarted = true;
            Animating?.Invoke();
            MaterialFrame.FadeTo(0.99, 160u * (uint)InputSL.Children.Count, Easing.CubicInOut); // Opacity 1.0 causes text above to become blurred?
            LogoImage.TranslateTo(0, Height * -0.35d, 400, Easing.CubicOut);
            TitleSL.FadeTo(1, 600, Easing.CubicInOut);
            TitleSL.TranslateTo(0, 0, 600, Easing.CubicInOut);
            ChevronSL.FadeTo(0, 100, Easing.CubicOut);
            EmailEntry.IsEnabled = PasswordEntry.IsEnabled = PasswordConfirmationEntry.IsEnabled = true;
            int t = 0;

            foreach (VisualElement v in InputSL.Children)
            {
                t += 160;
                v.TranslationX = -v.Width;
                Device.StartTimer(TimeSpan.FromMilliseconds(t), () =>
                {
                    if (!_signUp)
                    {
                        if (v == Button)
                        {
                            v.TranslateTo(0, -(PasswordConfirmationSL.Height + 4), 400, Easing.SinOut);
                            v.FadeTo(1, 400, Easing.SinOut);
                            return(false);
                        }
                        else if (v == PasswordConfirmationSL)
                        {
                            v.TranslateTo(0, 0, 400, Easing.SinOut);
                            return(false);
                        }
                    }
                    v.TranslateTo(0, 0, 400, Easing.SinOut);
                    v.FadeTo(1, 400, Easing.SinOut);
                    return(false);
                });
            }
            ThemeEngine.RefreshTheme(); // Set nav colours to what they should be on android
        }
Exemplo n.º 4
0
 private void Entry_Unfocused(object sender, FocusEventArgs e)
 {
     if (entryFocused)
     {
         Device.StartTimer(TimeSpan.FromMilliseconds(100), () =>
         {
             if (EmailEntry.IsFocused || PasswordEntry.IsFocused || PasswordConfirmationEntry.IsFocused || justSwitched)
             {
                 return(justSwitched = false);
             }
             InputSL.TranslateTo(0, 0, easing: Easing.CubicInOut);
             TitleSL.FadeTo(1, easing: Easing.CubicInOut);
             return(entryFocused = false);
         });
     }
 }
Exemplo n.º 5
0
        private void PanGestureRecognizer_PanUpdated(object sender, PanUpdatedEventArgs e)
        {
            if (animationStarted)
            {
                return;
            }

            if (LogoImage.TranslationY > -50 && LogoImage.TranslationY <= 0)
            {
                LogoImage.TranslationY += e.TotalY;
                if (LogoImage.TranslationY > 0)
                {
                    LogoImage.TranslationY = 0;
                }
                return;
            }

            animationStarted = true;
            Animating?.Invoke();
            MaterialFrame.FadeTo(0.99, 160u * (uint)ButtonSL.Children.Count, Easing.CubicInOut); // Opacity 1.0 causes text above to become blurred?
            LogoImage.TranslateTo(0, Height * -0.35d, 400, Easing.CubicOut);
            TitleSL.FadeTo(1, 600, Easing.CubicInOut);
            TitleSL.TranslateTo(0, 0, 600, Easing.CubicInOut);
            ChevronSL.FadeTo(0, 100, Easing.CubicOut);
            int t = 0;

            foreach (Frame f in ButtonSL.Children)
            {
                t += 160;
                f.TranslationX = -f.Width;
                Device.StartTimer(TimeSpan.FromMilliseconds(t), () =>
                {
                    f.TranslateTo(0, 0, 400, Easing.SinOut);
                    f.FadeTo(1, 400, Easing.SinOut);
                    return(false);
                });
            }
            ThemeEngine.RefreshTheme(); // Set nav colours to what they should be on android
        }