private async Task AnimateItem(View uiElement, uint duration ){ while (_animate) { await uiElement.ScaleTo(1.05, duration, Easing.SinInOut); await Task.WhenAll ( uiElement.FadeTo(1, duration, Easing.SinInOut), uiElement.LayoutTo (new Rectangle( new Point(0,0), new Size( uiElement.Width, uiElement.Height))), uiElement.FadeTo(.9, duration, Easing.SinInOut), uiElement.ScaleTo(1.15, duration, Easing.SinInOut) ); } }
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)); }
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)); }
async Task ShowContent(XFView oldView, XFView newView) { newView.Opacity = 0; newView.IsVisible = true; if (oldView != null) { oldView.IsVisible = false; } await newView.FadeTo(1); newView.Opacity = 1; }
public override Task Appearing(View content, PopupPage page) { if (HasBackgroundAnimation) { return page.FadeTo(1, DurationIn, EasingIn); } if (content != null) { return content.FadeTo(1, DurationIn, EasingIn); } return Task.FromResult(0); }
public override Task Disappearing(View content, PopupPage page) { _defaultOpacity = page.Opacity; if (HasBackgroundAnimation) { return page.FadeTo(0, DurationOut, EasingOut); } if (content != null) { return content.FadeTo(0, DurationOut, EasingOut); } return Task.FromResult(0); }
public async Task <bool> AnimationFade(Xamarin.Forms.View view, int opacity, uint milliseconds) { return(await view.FadeTo(opacity, milliseconds)); }
// Call Before OnDisappering public async Task Disappearing(Xamarin.Forms.View content, PopupPage page) { // Hide animation await content.FadeTo(0); }
private async Task AnimateItem( View uiElement, uint duration ){ if (uiElement == null) { return; } await Task.WhenAll (new Task[] { uiElement.ScaleTo(1.5, duration, Easing.CubicIn), uiElement.FadeTo(1, duration/2, Easing.CubicInOut).ContinueWith( _ => uiElement.ScaleTo(1, duration, Easing.CubicOut)) }); }
private async Task AnimateItem(View uiElement, uint duration ){ var originalOpacity = uiElement.Opacity; await uiElement.FadeTo(.5, duration/2, Easing.CubicIn); await uiElement.FadeTo(originalOpacity, duration/2, Easing.CubicIn); }
async void DroidLayout(View mainView) { if (this.Content is AbsoluteLayout) { await (this.Content as AbsoluteLayout).Children[0].FadeTo (0, (uint)Integers.AnimationSpeed, Easing.SinIn); (this.Content as AbsoluteLayout).Children.RemoveAt (0); AbsoluteLayout.SetLayoutFlags(mainView, AbsoluteLayoutFlags.All); AbsoluteLayout.SetLayoutBounds(mainView, new Rectangle(0f, 0f, 1f, 1f)); (this.Content as AbsoluteLayout).Children.Insert (0, mainView); mainView.Opacity = 0; await mainView.FadeTo (1, (uint)Integers.AnimationSpeed, Easing.SinIn); return; } fab = new FloatingActionButtonView { ImageName = League.IsFavorite ? "ic_favorite_white" : "ic_favorite_border_white", ColorNormal = Color.FromHex("009688"), ColorPressed = Color.FromHex("80CBC4"), ColorRipple = Color.FromHex("E0F2F1"), Clicked = (sender, args) => FabAction(), }; absoluteAndroid = new AbsoluteLayout { VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, }; // Position the pageLayout to fill the entire screen. // Manage positioning of child elements on the page by editing the pageLayout. AbsoluteLayout.SetLayoutFlags(mainView, AbsoluteLayoutFlags.All); AbsoluteLayout.SetLayoutBounds(mainView, new Rectangle(0f, 0f, 1f, 1f)); absoluteAndroid.Children.Add(mainView); // Overlay the FAB in the bottom-right corner AbsoluteLayout.SetLayoutFlags(fab, AbsoluteLayoutFlags.PositionProportional); AbsoluteLayout.SetLayoutBounds(fab, new Rectangle(1f, 1f, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize)); absoluteAndroid.Children.Add(fab); Content = absoluteAndroid; await mainView.FadeTo (1, (uint)Integers.AnimationSpeed, Easing.SinIn); }