Пример #1
1
        public async override Task Appearing(View content, PopupPage page)
        {
            var taskList = new List<Task>();

            taskList.Add(base.Appearing(content, page));

            if (content != null)
            {
                var topOffset = GetTopOffset(content, page);
                var leftOffset = GetLeftOffset(content, page);

                if (PositionIn == MoveAnimationOptions.Top)
                {
                    content.TranslationY = -topOffset;
                }
                else if (PositionIn == MoveAnimationOptions.Bottom)
                {
                    content.TranslationY = topOffset;
                }
                else if (PositionIn == MoveAnimationOptions.Left)
                {
                    content.TranslationX = -leftOffset;
                }
                else if (PositionIn == MoveAnimationOptions.Right)
                {
                    content.TranslationX = leftOffset;
                }

                taskList.Add(content.TranslateTo(_defaultTranslationX, _defaultTranslationY, DurationIn, EasingIn));
            }

            page.IsVisible = true;

            await Task.WhenAll(taskList);
        }
Пример #2
0
        public async Task <bool> AnimationPositionWord(SwipeDirection direction, Xamarin.Forms.View view)
        {
            switch (direction)
            {
            case SwipeDirection.Down:
            {
                await Task.WhenAll(
                    view.TranslateTo(0, 100, 250, Easing.SinIn),
                    view.FadeTo(0, 250)
                    );

                break;
            }

            case SwipeDirection.Up:
            {
                await Task.WhenAll(
                    view.TranslateTo(0, -100, 250, Easing.SinIn),
                    view.FadeTo(0, 250)
                    );

                break;
            }

            case SwipeDirection.Left:
            {
                await Task.WhenAll(
                    view.TranslateTo(-100, 0, 250, Easing.SinIn),
                    view.FadeTo(0, 250)
                    );

                break;
            }

            case SwipeDirection.Right:
            {
                await Task.WhenAll(
                    view.FadeTo(0, 250),
                    view.TranslateTo(100, 0, 250, Easing.SinIn)
                    );

                break;
            }
            }
            return(await Task.FromResult(true));
        }
Пример #3
0
        public async Task <bool> AnimationPositionWordRevert(Xamarin.Forms.View view)
        {
            await Task.WhenAll(
                view.TranslateTo(0, 0, 10),
                view.FadeTo(1, 150)
                );

            return(await Task.FromResult(true));
        }
Пример #4
0
        // Call After OnAppering
        public async Task Appearing(Xamarin.Forms.View content, PopupPage page)
        {
            var topOffset = GetTopOffset(content, page);

            content.TranslationY = topOffset;
            content.Opacity      = 1;

            await content.TranslateTo(0, 0, easing : Easing.CubicOut);
        }
Пример #5
0
        public async override Task Disappearing(View content, PopupPage page)
        {
            var taskList = new List<Task>();

            taskList.Add(base.Disappearing(content, page));

            if (content != null)
            {
                _defaultTranslationY = content.TranslationX;

                var topOffset = GetTopOffset(content, page);

                taskList.Add(content.TranslateTo(content.TranslationX, topOffset, DurationOut, EasingOut));
            };

            await Task.WhenAll(taskList);
        }
Пример #6
0
        public async override Task Disappearing(Xamarin.Forms.View content, PopupPage page)
        {
            var taskList = new List <Task>();

            taskList.Add(base.Disappearing(content, page));

            if (content != null)
            {
                _defaultTranslationY = content.TranslationX;

                var topOffset = GetTopOffset(content, page);

                taskList.Add(content.TranslateTo(content.TranslationX, topOffset, DurationOut, EasingOut));
            }
            ;

            await Task.WhenAll(taskList);
        }
Пример #7
0
        public async override Task Appearing(View content, PopupPage page)
        {
            var taskList = new List<Task>();

            taskList.Add(base.Appearing(content, page));

            if (content != null)
            {
                var topOffset = GetTopOffset(content, page);
                content.TranslationY = topOffset;

                taskList.Add(content.TranslateTo(content.TranslationX, _defaultTranslationY, DurationIn, EasingIn));
            };

            page.IsVisible = true;

            await Task.WhenAll(taskList);
        }
Пример #8
0
        public async override Task Appearing(Xamarin.Forms.View content, PopupPage page)
        {
            var taskList = new List <Task>();

            taskList.Add(base.Appearing(content, page));

            if (content != null)
            {
                var topOffset = GetTopOffset(content, page);
                content.TranslationY = topOffset;

                taskList.Add(content.TranslateTo(content.TranslationX, _defaultTranslationY, DurationIn, EasingIn));
            }
            ;

            page.IsVisible = true;

            await Task.WhenAll(taskList);
        }
Пример #9
0
        public async override Task Disappearing(View content, PopupPage page)
        {
            var taskList = new List<Task>();

            taskList.Add(base.Disappearing(content, page));

            if (content != null)
            {
                UpdateDefaultTranslations(content);

                var topOffset = GetTopOffset(content, page);
                var leftOffset = GetLeftOffset(content, page);

                if (PositionOut == MoveAnimationOptions.Top)
                {
                    taskList.Add(content.TranslateTo(_defaultTranslationX, -topOffset, DurationOut, EasingOut));
                }
                else if (PositionOut == MoveAnimationOptions.Bottom)
                {
                    taskList.Add(content.TranslateTo(_defaultTranslationX, topOffset, DurationOut, EasingOut));
                }
                else if (PositionOut == MoveAnimationOptions.Left)
                {
                    taskList.Add(content.TranslateTo(-leftOffset, _defaultTranslationY, DurationOut, EasingOut));
                }
                else if (PositionOut == MoveAnimationOptions.Right)
                {
                    taskList.Add(content.TranslateTo(leftOffset, _defaultTranslationY, DurationOut, EasingOut));
                }
            }

            await Task.WhenAll(taskList);
        }