Esempio n. 1
0
        /// <summary>
        /// Shows the menu items.
        /// </summary>
        private async Task ShowMenuItems()
        {
            var speed = 25U;
            await Settings.FadeTo(1, speed);

            await Followings.FadeTo(1, speed);

            await UserMap.FadeTo(1, speed);
        }
Esempio n. 2
0
 /// <summary>
        /// Adds tap gesture recognizer to open button in the middle of round menu.
        /// </summary>
        private void ConnectOpenWithClick()
        {
            InnerButtonMenu.GestureRecognizers.Add(new TapGestureRecognizer
            {
                Command = new Command(async () =>
                {
                    if (!isAnimating)
                    {
                        isAnimating = true;

                        InnerButtonClose.IsVisible = true;
                        InnerButtonMenu.IsVisible = true;

                        InnerButtonMenu.RotateTo(360, animationDelay);
                        InnerButtonMenu.FadeTo(0, animationDelay);
                        InnerButtonClose.RotateTo(360, animationDelay);
                        InnerButtonClose.FadeTo(1, animationDelay);

                        await OuterCircle.ScaleTo(3.3, 1000, Easing.BounceIn);
                        await ShowMenuItems();
                        InnerButtonMenu.IsVisible = false;

                        isAnimating = false;

                    }
                }),
                NumberOfTapsRequired = 1
            });

        }

        /// <summary>
        /// Closes the menu.
        /// </summary>
        private async Task CloseMenu()
        {
            if (!isAnimating)
            {

                isAnimating = true;

                InnerButtonMenu.IsVisible = true;
                InnerButtonClose.IsVisible = true;
                await HideMenuItems();

                InnerButtonClose.RotateTo(0, animationDelay);
                InnerButtonClose.FadeTo(0, animationDelay);
                InnerButtonMenu.RotateTo(0, animationDelay);
                InnerButtonMenu.FadeTo(1, animationDelay);
                await OuterCircle.ScaleTo(1, 400, Easing.BounceOut);
                InnerButtonClose.IsVisible = false;

                isAnimating = false;
            }
        }

        /// <summary>
        /// Hides the menu items.
        /// </summary>
        private async Task HideMenuItems()
        {
            var speed = 25U;
            await Settings.FadeTo(0, speed);
            await Followings.FadeTo(0, speed);
            await UserMap.FadeTo(0, speed);
        }

        /// <summary>
        /// Shows the menu items.
        /// </summary>
        private async Task ShowMenuItems()
        {
            var speed = 25U;
            await Settings.FadeTo(1, speed);
            await Followings.FadeTo(1, speed);
            await UserMap.FadeTo(1, speed);
        }
    }
}