Ejemplo n.º 1
0
        public void ApplyUserLabelTheme(string User)
        {
            var UserLabelAnimation = "DefaultButtn";

            if (Content.AnimationIsRunning(UserLabelAnimation))
            {
                Content.AbortAnimation(UserLabelAnimation);
            }
            var Theme = AlphaTheme.Get();

            if (!String.IsNullOrWhiteSpace(User))
            {
                AlphaTheme.Apply(UserLabel, Theme);
            }
            else
            {
                Content.Animate
                (
                    UserLabelAnimation,
                    d =>
                {
                    var Rate                  = Math.Abs(Math.Sin(d));
                    UserLabel.TextColor       = ColorEx.MergeWithRate(Theme.AccentColor, Theme.BackgroundColor, Rate);
                    UserLabel.BackgroundColor = ColorEx.MergeWithRate(Theme.BackgroundColor, Theme.AccentColor, Rate);
                },
                    0.0,
                    1000.0,
                    16,
                    (uint)2000000,
                    Easing.Linear
                );
            }
        }
Ejemplo n.º 2
0
 private void Handle_OnError(object sender, EventArgs e)
 {
     Content.AbortAnimation("shake");
     Content.Animate("shake",
                     (arg) =>
     {
         var shift            = Math.Sin(2 * 2 * Math.PI * arg);
         Content.TranslationX = 6 * shift;
     },
                     16 * 4,
                     250,
                     Easing.Linear,
                     (arg1, arg2) =>
     {
         Content.TranslationX = 0;
     });
 }