Esempio n. 1
0
 private void OnToastBeginClose(ToastProcess toast)
 {
     if (mCurrentToast == toast)
     {
         mCurrentToast = null;
     }
 }
Esempio n. 2
0
 public static void Cache(ToastProcess toast)
 {
     if (toast == null)
     {
         return;
     }
     cached_instances.Enqueue(toast);
 }
Esempio n. 3
0
            public static ToastProcess Get(string content, float duration)
            {
                ToastProcess toast = null;

                if (cached_instances.Count > 0)
                {
                    toast = cached_instances.Dequeue();
                }
                if (toast == null)
                {
                    toast = new ToastProcess();
                }
                toast.mContent  = content;
                toast.mDuration = duration;
                return(toast);
            }
Esempio n. 4
0
 public void ShowToast(string content, float duration)
 {
     if (mCurrentToast != null)
     {
         mCurrentToast.Close();
         mCurrentToast = null;
     }
     if (mOnToastBeginClose == null)
     {
         mOnToastBeginClose = OnToastBeginClose;
     }
     if (mOnToastClosed == null)
     {
         mOnToastClosed = OnToastClosed;
     }
     mCurrentToast = ToastProcess.Get(content, duration);
     mCurrentToast.Start(mOnToastBeginClose, mOnToastClosed);
 }
Esempio n. 5
0
 private void OnToastClosed(ToastProcess toast)
 {
     toast.Clear();
     ToastProcess.Cache(toast);
 }