Created
January 20, 2022 13:42
-
-
Save TBertuzzi/b5682dc4e5c1f558c058184eb77f8ed7 to your computer and use it in GitHub Desktop.
AiForms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using AiForms.Dialogs.Abstractions; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Xamarin.Forms; | |
using Xamarin.Forms.Xaml; | |
namespace XamarinFormsAiFormsDialogs | |
{ | |
[XamlCompilation(XamlCompilationOptions.Compile)] | |
public partial class MinhaToastView : ToastView | |
{ | |
public MinhaToastView() | |
{ | |
InitializeComponent(); | |
container.BackgroundColor = Color.FromRgba(0.85, 0.85, 0.85, 0.9); | |
Duration = 2000; | |
Opacity = 1; | |
CornerRadius = 20; | |
image.Source = ImageSource.FromResource("XamarinFormsAiFormsDialogs.bertuzzi.png"); | |
label.TranslationY = 50; | |
} | |
public override void RunPresentationAnimation() | |
{ | |
Task.WhenAll( | |
image.RotateTo(360, 250), | |
image.ScaleTo(1.0, 250), | |
image.TranslateTo(0, 0, 250), | |
label.TranslateTo(0, 0, 250) | |
); | |
} | |
public override void RunDismissalAnimation() | |
{ | |
Task.WhenAll( | |
image.ScaleTo(3.0, 250), | |
label.ScaleTo(3.0, 250), | |
container.FadeTo(0, 250) | |
); | |
} | |
public override void Destroy() | |
{ | |
base.Destroy(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment