async void AnimatePostAction(CachedImage LikeIcon)
        {
            if (Animaions.Contains(LikeIcon) == false)
            {
                Animaions.Add(LikeIcon);
                await LikeIcon.ScaleTo(1.2, 100);

                await LikeIcon.ScaleTo(1, 100);

                Animaions.Remove(LikeIcon);
            }
        }
Пример #2
0
        private async void TapGestureRecognizer_OnTapped(object sender, EventArgs e)
        {
            StackLayout stackLayout   = ((StackLayout)sender);
            StackLayout x             = ((StackLayout)(stackLayout.Parent.Parent.Parent));;
            Label       likecount     = (Label)((StackLayout)x.Children[2]).Children[1];
            Label       likecountreal = (Label)((StackLayout)x.Children[2]).Children[2];

            Label       test        = ((Label)stackLayout.Children[0]);
            CachedImage cachedImage = ((CachedImage)stackLayout.Children[1]);
            Label       label       = ((Label)stackLayout.Children[2]);

            if (test.Text.Equals("false"))
            {
                label.TextColor    = Color.FromHex("3578e5");
                likecount.Text     = "You and " + likecountreal.Text + " others";
                cachedImage.Source = ImageSource.FromFile("bluelikeicon");
                await label.ScaleTo(1.5, 150, Easing.CubicOut);

                await cachedImage.ScaleTo(1.5, 150, Easing.CubicOut);

                test.Text = "true";
                label.ScaleTo(1, 150, Easing.CubicIn);
                cachedImage.ScaleTo(1, 150, Easing.CubicIn);
            }
            else
            {
                await label.ScaleTo(1.5, 50, Easing.CubicOut);

                await cachedImage.ScaleTo(1.5, 50, Easing.CubicOut);

                likecount.Text = likecountreal.Text;

                label.TextColor    = Color.Black;
                cachedImage.Source = ImageSource.FromFile("likeicon");
                test.Text          = "false";
                label.ScaleTo(1, 150, Easing.CubicIn);
                cachedImage.ScaleTo(1, 150, Easing.CubicIn);
            }
        }