Ejemplo n.º 1
0
        public static void showGlobalProgressHUDWithTitle(string title)
        {
            UIWindow      window = UIApplication.SharedApplication.KeyWindow;
            MBProgressHUD hud    = MBProgressHUD.ShowHUDAddedTo(window, true);

            hud.LabelText = title;
            CATransaction.Commit();
        }
Ejemplo n.º 2
0
        public override void ShowHUDInView(UIKit.UIView view, string message, Interactor interactor)
        {
            if (Instance == null)
            {
                Instance = MBProgressHUD.ShowHUDAddedTo(view, true);
            }

            ConfigureAndShowHUD(Instance,
                                NSBundle.FromPath(NSBundle.MainBundle.PathForResource(LanguageHelper.Language, "lproj")).LocalizedString("Loading...", null),
                                ProgressCloseMode.ManualClose,
                                ProgressSpinnerMode.IndeterminateSpinner);
        }
Ejemplo n.º 3
0
        public void ShowProgressDialog(string message = "")
        {
            UIViewController rootVC = ((AppDelegate)UIApplication.SharedApplication.Delegate).Presenter.MasterNavigationController;

            UIApplication.SharedApplication.InvokeOnMainThread(() =>
            {
                MBProgressHUD hud = MBProgressHUD.HUDForView(rootVC.View);
                if (hud == null)
                {
                    hud = MBProgressHUD.ShowHUDAddedTo(rootVC.View, true);
                }
                hud.UserInteractionEnabled = true;
                hud.DetailsLabel.Text      = message;
            });
        }
Ejemplo n.º 4
0
        public void ShowToast(string message, int timeoutMs = 1500)
        {
            UIWindow window = ((AppDelegate)UIApplication.SharedApplication.Delegate).Window;

            UIApplication.SharedApplication.InvokeOnMainThread(() =>
            {
                MBProgressHUD hud = MBProgressHUD.ShowHUDAddedTo(window, true);

                hud.Mode = MBProgressHUDMode.Text;
                hud.DetailsLabel.Text         = message;
                hud.RemoveFromSuperViewOnHide = true;
                hud.Margin = 10f;

                hud.BezelView.BackgroundColor = UIColor.Black;
                hud.DetailsLabel.TextColor    = UIColor.White;

                hud.HideAnimated(true, timeoutMs * 1.0 / 1000);
            });
        }
Ejemplo n.º 5
0
        public override void HideHUDFromView(UIKit.UIView view, string message, Interactor interactor, Foundation.NSError error)
        {
            if (message != null)
            {
                if (Instance == null)
                {
                    Instance = MBProgressHUD.ShowHUDAddedTo(view, true);
                }

                ConfigureAndShowHUD(Instance,
                                    NSBundle.MainBundle.LocalizedString("Loading...", null),
                                    (error == null ? ProgressCloseMode.Autoclose_TouchClosable : ProgressCloseMode.ManualClose_TouchClosable),
                                    ProgressSpinnerMode.IndeterminateSpinner);
            }
            else
            {
                HideHud();
            }
        }
 public static MBProgressHUD ShowHUDAddedTo(UIView view, bool animated)
 {
     return(MBProgressHUD.ShowHUDAddedTo(view, animated));
 }