Example #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="text"></param>
 /// <param name="toastTime"></param>
 /// <param name="snackbar"></param>
 /// <param name="command"></param>
 public void DisplayToast(string text, ToastTime toastTime = ToastTime.SHORT, bool snackbar = false, ICommand command = null)
 {
     Device.BeginInvokeOnMainThread(async() =>
     {
         await Xamarin.Forms.Application.Current.MainPage.DisplayAlert("", text, "Ok");
     });
 }
Example #2
0
        public void Show(string InMsg, ToastTime InToastTime = ToastTime.Middle)
        {
            toastQueue.Enqueue(new ToastInfo(InMsg, InToastTime));

            if (!isToastPlaying)
            {
                StartCoroutine(Play());
            }
        }
Example #3
0
        public void DisplayToast(string message, ToastTime toastTime)
        {
            var config = new ToastConfig(message)
            {
                Duration = TimeSpan.FromSeconds((double)toastTime)
            };

            UserDialogs.Instance.Toast(config);
        }
Example #4
0
        public void Toast(string content, ToastTime showFor)
        {
            var context = Mvx.Resolve <IMvxAndroidCurrentTopActivity>();
            var toast   = Android.Widget.Toast.MakeText(
                context.Activity,
                content,
                showFor == ToastTime.Short ? ToastLength.Short : ToastLength.Long);

            toast.Show();
        }
Example #5
0
        public static void Toast(string message, ToastTime toastTime)
        {
            switch (toastTime)
            {
            case ToastTime.ShortTime:
                DependencyService.Get <IToastMessage>().ShortTime(message);
                break;

            case ToastTime.LongTime:
                DependencyService.Get <IToastMessage>().LongTime(message);
                break;
            }
        }
Example #6
0
        public IDisposable DisplayToast(string message, ToastTime toastTime, string actionText, Action action)
        {
            var config = new ToastConfig(message)
            {
                Duration = TimeSpan.FromSeconds((double)toastTime),
                Action   = new ToastAction
                {
                    Text      = actionText,
                    TextColor = System.Drawing.Color.DodgerBlue,
                    Action    = action
                }
            };

            return(UserDialogs.Instance.Toast(config));
        }
Example #7
0
 public void DisplayToast(string text, ToastTime toastTime = ToastTime.SHORT, bool snackbar = false, ICommand command = null)
 {
     Toast.MakeText(Application.Context, text, toastTime == ToastTime.SHORT ? ToastLength.Short : ToastLength.Long).Show();
 }
Example #8
0
 public ToastInfo(string InMsg, ToastTime InShowTime)
 {
     Msg      = InMsg;
     ShowTime = InShowTime;
 }
 public void Toast(string content, ToastTime showFor)
 {
     this.Dialog(AppResources.ApplicationTitle, content);
 }