Exemplo n.º 1
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();
            MainStack.TranslationY = 640;
            if (Device.RuntimePlatform == Device.Android)
            {
                await Task.Delay(100);
            }

            //Button.FadeTo(1, 3000, Easing.CubicIn);
            //LblEntry.RotateTo(180, 250, Easing.CubicIn);
            //Button.ScaleTo(10);
            MainStack.TranslateTo(0, 0, 500, Easing.SpringOut);


            var parentAnimacion = new Animation();


            var fadetoAnimation   = new Animation(v => Button.Opacity = v, 0, 1, Easing.BounceOut);
            var rotateToAnimation = new Animation(v => LblEntry.FontSize = v, 14, 50, Easing.SpringIn);

            parentAnimacion.Add(0, 1, fadetoAnimation);
            parentAnimacion.Add(0.5, 1, rotateToAnimation);


            parentAnimacion.Commit(this, "myAnimation", 16, 3000, Easing.CubicIn);
        }
Exemplo n.º 2
0
        public void GridButton_Clicked(object sender, EventArgs e)
        {
            if (settings.YourTurn)
            {
                btn = (ImageButton)sender;

                settings.YourTurn = false;
                ToastManager.Show(btn.ClassId);
                settings.AllReadySelected.Add(btn.ClassId);
                bluetooth.SendMessage(btn.ClassId);
            }
            else
            {
                ToastManager.Show("Not Your Turn");
                Task.Run(async() =>
                {
                    uint timeout = 50;
                    await MainStack.TranslateTo(-15, 0, timeout);
                    await MainStack.TranslateTo(15, 0, timeout);
                    await MainStack.TranslateTo(-9, 0, timeout);
                    await MainStack.TranslateTo(9, 0, timeout);
                    await MainStack.TranslateTo(-5, 0, timeout);
                    await MainStack.TranslateTo(5, 0, timeout);
                    await MainStack.TranslateTo(-2, 0, timeout);
                    await MainStack.TranslateTo(2, 0, timeout);
                    MainStack.TranslationX = 0;
                });
            }
        }