示例#1
0
        public static Toast Show(string viewName, IUIViewGroup viewGroup, string text, float duration, UILayout layout, Action callback)
        {
            if (string.IsNullOrEmpty(viewName))
            {
                viewName = ViewName;
            }

            IUIViewLocator locator = GetUIViewLocator();
            ToastView      view    = locator.LoadView <ToastView>(viewName);

            if (view == null)
            {
                throw new NotFoundException("Not found the \"ToastView\".");
            }

            if (viewGroup == null)
            {
                viewGroup = GetCurrentViewGroup();
            }

            Toast toast = new Toast(view, viewGroup, text, duration, layout, callback);

            toast.Show();
            return(toast);
        }
示例#2
0
 protected Toast(ToastView view, IUIViewGroup viewGroup, string text, float duration, UILayout layout, Action callback)
 {
     this.view      = view;
     this.viewGroup = viewGroup;
     this.text      = text;
     this.duration  = duration;
     this.layout    = layout;
     this.callback  = callback;
 }
示例#3
0
        public static Toast Show(string viewName, IUIViewGroup viewGroup, string text, float duration, UILayout layout, Action callback)
        {
            if (string.IsNullOrEmpty(viewName))
            {
                viewName = ViewName;
            }

            ApplicationContext context = Context.GetApplicationContext();
            IUIViewLocator     locator = context.GetService <IUIViewLocator>();
            ToastView          view    = locator.LoadView <ToastView>(viewName);
            Toast toast = new Toast(viewGroup, text, duration, layout);

            toast.View = view;
            toast.Show();
            return(toast);
        }
示例#4
0
        public static Toast Show(string viewName, IUIViewGroup viewGroup, string text, float duration, UILayout layout, Action callback)
        {
            if (string.IsNullOrEmpty(viewName))
            {
                viewName = ViewName;
            }

            ApplicationContext context = Context.GetApplicationContext();
            IUIViewLocator     locator = context.GetService <IUIViewLocator>();
            ToastView          view    = locator.LoadView <ToastView>(viewName);

            if (view == null)
            {
                throw new NotFoundException("Not found the \"ToastView\".");
            }

            Toast toast = new Toast(view, viewGroup, text, duration, layout);

            toast.Show();
            return(toast);
        }
示例#5
0
 protected Toast(ToastView view, IUIViewGroup viewGroup, string text, float duration, UILayout layout) : this(view, viewGroup, text, duration, layout, null)
 {
 }
示例#6
0
 protected Toast(ToastView view, IUIViewGroup viewGroup, string text, float duration) : this(view, viewGroup, text, duration, null, null)
 {
 }