public ToastView SetGravity(ToastGravity gravity, int OffSetLeft, int OffSetTop) { theSettings.Gravity = gravity; offsetLeft = OffSetLeft; offsetTop = OffSetTop; return(this); }
public ToastView SetGravity (ToastGravity gravity, int OffSetLeft, int OffSetTop) { theSettings.Gravity = gravity; offsetLeft = OffSetLeft; offsetTop = OffSetTop; return this; }
public ToastFluent SetGravity(ToastGravity gravity, nint left, nint top) { this.theSettings().gravity = gravity; this.theSettings().offsetLeft = left; this.theSettings().offsetTop = top; return(this); }
public void ToastLong(string msg, ToastGravity gravity = ToastGravity.Default, float sizeText = 18) { if (Application.platform == RuntimePlatform.Android) { string strgravity = "default"; if (gravity == ToastGravity.Default) { strgravity = "default"; } if (gravity == ToastGravity.TopCenter) { strgravity = "topcenter"; } if (gravity == ToastGravity.TopCorner) { strgravity = "topcorner"; } if (gravity == ToastGravity.Center) { strgravity = "center"; } _toastJavaObject.Call("ToastLong", msg, strgravity, sizeText); } }
private Toast(string text) { Text = text; Duration = (int)ToastDuration.Normal; BackgroundColor = Color.Black; Type = ToastType.Default; Gravity = ToastGravity.Bottom; }
public CustomToastWidget( ToastGravity gravity, Widget child, Key key = null ) : base(key: key) { this.gravity = gravity; this.child = child; }
/// <summary> /// /// </summary> /// <param name="message"></param> /// <param name="location"></param> /// <returns></returns> public Task NotifyAsync(string message, ToastGravity location = ToastGravity.Center) { AtomToast toast = new AtomToast { Text = message, DurationSeconds = TimeSpan.FromSeconds(5), Gravity = location }; toast.Show(); return(Task.CompletedTask); }
/// <summary> /// Toasts the alert. /// </summary> /// <param name="message">The message.</param> /// <param name="gravity">The gravity.</param> /// <param name="duration">The duration.</param> public void ToastAlert(string message, ToastGravity gravity = ToastGravity.Top, int duration = 3000) { Application.SynchronizationContext.Post(ignored => { GravityFlags flag = gravity == ToastGravity.Top ? GravityFlags.Top : GravityFlags.Bottom; var toast = Toast.MakeText(Application.Context, message, ToastLength.Short); toast.SetGravity(flag | GravityFlags.Center, 0, 100); toast.Show(); }, null); }
/// <summary> /// /// </summary> /// <param name="message"></param> /// <param name="location"></param> public Task NotifyAsync(string message, ToastGravity location = ToastGravity.Center) { var toast = Toast.MakeText(CrossCurrentActivity.Current.Activity, message, ToastLength.Long); if (location != ToastGravity.Center) { toast.SetGravity(GravityFlags.Center, 0, 0); } toast.Show(); return(Task.CompletedTask); }
/// <summary> /// /// </summary> /// <param name="message"></param> /// <param name="location"></param> public Task NotifyAsync(string message, ToastGravity location = ToastGravity.Center) { var toast = Toast.MakeText(Xamarin.Forms.Forms.Context, message, ToastLength.Short); if (location != ToastGravity.Center) { toast.SetGravity(GravityFlags.Center, 0, 0); } toast.Show(); return(Task.CompletedTask); }
public ToastView(string text, int durationMilliseconds, ToastGravity gravity, int padding, UITextAlignment textAlignment) { Text = text; DurationMilliseconds = durationMilliseconds; TextAlignment = textAlignment; Padding = padding; Gravity = gravity; button = UIButton.FromType (UIButtonType.Custom); view = button; window = UIApplication.SharedApplication.Windows[0]; OffsetLeft = 0; OffsetTop = 0; Font = UIFont.SystemFontOfSize (16); TextColor = UIColor.White; BackgroundColor = UIColor.FromRGBA (0, 0, 0, 0.7f); ShadowColor = UIColor.DarkGray; ShadowOffset = 1; }
public CustomToastItem( BuildContext context, string message, TimeSpan?duration = null, ToastGravity gravity = ToastGravity.bottom, Color backgroundColor = null, Color textColor = null, float radius = 4 ) { D.assert(context != null); D.assert(message != null); this.context = context; this.message = message; this.duration = duration ?? new TimeSpan(0, 0, 1); this.gravity = gravity; this.backgroundColor = backgroundColor ?? new Color(0xAA000000); this.textColor = textColor ?? CColors.White; this.radius = radius; }
public static void Show(string text, int durationMilliseconds, ToastGravity gravity, int padding, UITextAlignment textAlignment) { new ToastView (text, durationMilliseconds, gravity, padding, textAlignment).Show(); }
public Toast SetGravity(ToastGravity gravity) { this.Gravity = gravity; return(this); }
/// <summary> /// Toasts the error alert. /// </summary> /// <param name="ex">The ex.</param> /// <param name="gravity">The gravity.</param> /// <param name="duration">The duration.</param> public void ToastErrorAlert(Exception ex, ToastGravity gravity = ToastGravity.Top, int duration = 5000) { ToastErrorAlert(ex.InnerException?.Message ?? ex.Message, gravity, duration); }
public static void Show(string text, int durationMilliseconds, ToastGravity gravity, int padding) { new ToastView(text, durationMilliseconds, gravity, padding).Show(); }
public ToastFluent SetGravity(ToastGravity gravity) { this.theSettings().gravity = gravity; return(this); }
public ToastView(string text, int durationMilliseconds, ToastGravity gravity, int padding) : this(text, durationMilliseconds, gravity, padding, defaultTextAlignment) { }
public ToastView(string text, int durationMilliseconds, ToastGravity gravity) : this(text, durationMilliseconds, gravity, defaultPadding) { }