Esempio n. 1
0
		void ShowSimple ()
		{
			// The hud will dispable all input on the view (use the higest view possible in the view hierarchy)
			hud = new MTMBProgressHUD (navController.View);
			navController.View.AddSubview (hud);

			// Regiser for DidHide Event so we can remove it from the window at the right time
			hud.DidHide += HandleDidHide;
			
			// Show the HUD while the provided method executes in a new thread
			hud.Show (new Selector("MyTask"), this, null, true);
		}
Esempio n. 2
0
 private void DisplayProgress(string details)
 {
     hud = new MTMBProgressHUD(View)
     {
         LabelText                 = "Updating",
         DetailsLabelText          = details,
         RemoveFromSuperViewOnHide = true,
         DimBackground             = true
     };
     View.AddSubview(hud);
     hud.Show(true);
 }
        private void Foo()
        {
            var hud = new MTMBProgressHUD(View)
            {
                LabelText = "Waiting...",
                RemoveFromSuperViewOnHide = true
            };

            View.AddSubview(hud);

            hud.Show(animated: true);
            hud.Hide(animated: true, delay: 5);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Perform any additional setup after loading the view, typically from a nib.
            ConfigureView();

            txtDescription.EditingDidEnd += HandleEditingDidEnd;
            txtDescription.Delegate       = new CatchEnterDelegate();

            txtQuantity.EditingDidEnd += HandleEditingDidEnd;
            txtQuantity.Delegate       = new CatchEnterDelegate();

            txtName.EditingDidEnd += HandleEditingDidEnd;
            txtName.Delegate       = new CatchEnterDelegate();

            _hud = new MTMBProgressHUD(View)
            {
                LabelText = "Saving...",
                RemoveFromSuperViewOnHide = true
            };

            View.AddSubview(_hud);

            btnSave.TouchUpInside += (object sender, EventArgs e) => {
                //Assign user set values back to object, and persist back to cloud
                detailItem.Title       = txtName.Text;
                detailItem.Description = txtDescription.Text;
                detailItem.Quantity    = int.Parse(txtQuantity.Text);

                _hud.Show(animated: true);

                //Use Task Parallel Library (TPL) to show a status message while the data is saving
                Task.Factory.StartNew(() => {
                    if (!string.IsNullOrEmpty(detailItem.ObjectId))
                    {
                        GroceryService.UpdateGroceryItem(detailItem);
                    }
                    else
                    {
                        GroceryService.CreateGroceryItem(detailItem);
                    }

                    System.Threading.Thread.Sleep(new TimeSpan(0, 0, 5));
                }).ContinueWith((prevTask) => {
                    _hud.Hide(animated: true, delay: 5);
                    NavigationController.PopViewControllerAnimated(true);
                }, TaskScheduler.FromCurrentSynchronizationContext());
            };
        }
Esempio n. 5
0
        void ShowTextOnly()
        {
            // Show the hud on top most view
            hud = MTMBProgressHUD.ShowHUD(this.navController.View, true);

            // Configure for text only and offset down
            hud.Mode      = MBProgressHUDMode.Text;
            hud.LabelText = "Some message...";
            hud.Margin    = 10f;
            hud.YOffset   = 150f;
            hud.RemoveFromSuperViewOnHide = true;

            hud.Hide(true, 3);
        }
Esempio n. 6
0
		void ShowUrl ()
		{
			// Show the hud on top most view
			hud = MTMBProgressHUD.ShowHUD (this.navController.View, true);
			
			// Regiser for DidHide Event so we can remove it from the window at the right time
			hud.DidHide += HandleDidHide;

			NSUrl url = new NSUrl ("https://github.com/matej/MBProgressHUD/zipball/master");
			NSUrlRequest request = new NSUrlRequest (url);

			NSUrlConnection connection = new NSUrlConnection (request, new MyNSUrlConnectionDelegete (this, hud));
			connection.Start();
		}
Esempio n. 7
0
        public static void ShowHUD(this UIViewController vc, string message)
        {
            vc.HideHUD();

            var hud = new MTMBProgressHUD(vc.NavigationController.View)
            {
                LabelText = message,
                RemoveFromSuperViewOnHide = true
            };

            vc.NavigationController.View.AddSubview(hud);
            hud.Show(true);

            currentHud = hud;
        }
Esempio n. 8
0
        void ShowOnWindow()
        {
            // The hud will dispable all input on the window
            hud = new MTMBProgressHUD(window);
            this.window.AddSubview(hud);

            // Regiser for DidHide Event so we can remove it from the window at the right time
            hud.DidHide += HandleDidHide;

            // Add information to your HUD
            hud.LabelText = "Loading";

            // Show the HUD while the provided method executes in a new thread
            hud.Show(new Selector("MyTask"), this, null, true);
        }
Esempio n. 9
0
        void ShowWithLabel()
        {
            // The hud will dispable all input on the view (use the higest view possible in the view hierarchy)
            hud = new MTMBProgressHUD(navController.View);
            navController.View.AddSubview(hud);

            // Regiser for DidHide Event so we can remove it from the window at the right time
            hud.DidHide += HandleDidHide;

            // Add information to your HUD
            hud.LabelText = "Loading";

            // Show the HUD while the provided method executes in a new thread
            hud.Show(new MonoTouch.ObjCRuntime.Selector("MyTask"), this, null, true);
        }
Esempio n. 10
0
        void ShowWithColor()
        {
            // The hud will dispable all input on the view (use the higest view possible in the view hierarchy)
            hud = new MTMBProgressHUD(navController.View);
            navController.View.AddSubview(hud);

            // Set the hud to display with a color
            hud.Color = new UIColor(0.23f, 0.5f, 0.82f, 0.90f);

            // Regiser for DidHide Event so we can remove it from the window at the right time
            hud.DidHide += HandleDidHide;

            // Show the HUD while the provided method executes in a new thread
            hud.Show(new MonoTouch.ObjCRuntime.Selector("MyTask"), this, null, true);
        }
Esempio n. 11
0
        void ShowWithGradient()
        {
            // The hud will dispable all input on the view (use the higest view possible in the view hierarchy)
            hud = new MTMBProgressHUD(this.navController.View);
            navController.View.AddSubview(hud);

            // Set HUD to dim Background
            hud.DimBackground = true;

            // Regiser for DidHide Event so we can remove it from the window at the right time
            hud.DidHide += HandleDidHide;

            // Show the HUD while the provided method executes in a new thread
            hud.Show(new MonoTouch.ObjCRuntime.Selector("MyTask"), this, null, true);
        }
Esempio n. 12
0
        public void ShowLoading()
        {
            HideLoading();
            var view = ((AppDelegate)UIApplication.SharedApplication.Delegate).Window;

            progressDialog = new MTMBProgressHUD(view)
            {
                RemoveFromSuperViewOnHide = true,
                TintColor = Colors.White,
            };

            view.AddSubview(progressDialog);
            view.BringSubviewToFront(progressDialog);
            progressDialog.Show(true);
        }
Esempio n. 13
0
        public static void ShowSimpleHUD(this UIViewController vc, string message)
        {
            vc.HideHUD();

            var hud = new MTMBProgressHUD(vc.NavigationController.View)
            {
                LabelText = message,
                Mode      = MBProgressHUDMode.Text,
                RemoveFromSuperViewOnHide = true
            };

            vc.NavigationController.View.AddSubview(hud);
            hud.Show(true);
            hud.Hide(true, 1.5);
        }
Esempio n. 14
0
        private void ShowMessage(string message)
        {
            var hud = new MTMBProgressHUD(View)
            {
                DetailsLabelText          = message,
                RemoveFromSuperViewOnHide = true,
                DimBackground             = false,
                AnimationType             = MBProgressHUDAnimation.MBProgressHUDAnimationZoomIn,
                Mode = MBProgressHUDMode.Text
            };

            View.AddSubview(hud);

            hud.Show(animated: true);
            hud.Hide(animated: true, delay: 1.5);
        }
Esempio n. 15
0
        void ShowWithLabelMixed()
        {
            // The hud will dispable all input on the view (use the higest view possible in the view hierarchy)
            hud = new MTMBProgressHUD(navController.View);
            navController.View.AddSubview(hud);

            // Regiser for DidHide Event so we can remove it from the window at the right time
            hud.DidHide += HandleDidHide;

            // Add information to your HUD
            hud.LabelText = "Connecting";
            hud.MinSize   = new System.Drawing.SizeF(135f, 135f);

            // Show the HUD while the provided method executes in a new thread
            hud.Show(new Selector("MyMixedTask"), this, null, true);
        }
Esempio n. 16
0
        void ShowUsingHandlers()
        {
            // The hud will dispable all input on the view (use the higest view possible in the view hierarchy)
            hud = new MTMBProgressHUD(navController.View);
            navController.View.AddSubview(hud);

            // Add information to your HUD
            hud.LabelText = "With a handler";

            // We show the hud while executing MyTask, and then we clean up
            hud.Show(true, () => {
                MyTask();
            }, () => {
                hud.RemoveFromSuperview();
                hud = null;
            });
        }
Esempio n. 17
0
        public void ShowHud(String message)
        {
            if (Hud == null)
            {
                Hud = new MTMBProgressHUD(View);
            }

            MTMBProgressHUD.Appearance.TintColor = UIColor.Red;

            Hud.RemoveFromSuperViewOnHide = true;
            Hud.Color         = ColorUtils.GetColor(Slink.ColorUtils.ColorType.Theme);
            Hud.LabelText     = message;
            Hud.LabelColor    = UIColor.White;
            Hud.DimBackground = true;
            View.AddSubview(Hud);
            Hud.Show(true);
        }
Esempio n. 18
0
        /// <summary>
        /// refresh the publication list which displayed in scroll view
        /// invoked when user delete or sorting publication
        /// </summary>
        public void ReloadPublicationList()
        {
            var hud = new MTMBProgressHUD(View)
            {
                LabelText = "Loading",
                RemoveFromSuperViewOnHide = true
            };

            View.AddSubview(hud);
            hud.Show(animated: true);


            UpdatePublicationViewList();
            ShowPublicationViews();

            hud.Hide(animated: true, delay: 0.2);
        }
    public async Task LoginButton_click(UIButton sender)
    {
        hud = new MTMBProgressHUD(View)
        {
            LabelText = "Waiting...",
            RemoveFromSuperViewOnHide = true,
        };

        View.AddSubview(hud);
        hud.Show(animated: true);


        APIClient ApiClient   = new APIClient();
        TestAPI   cd          = new TestAPI(ApiClient);
        var       apiResponse = await cd.ExecuteAsync <YourType>();

        hud.Hide(animated: true);
    }
Esempio n. 20
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Perform any additional setup after loading the view, typically from a nib.
            bearerToken = "";
            var appDlg = (AppDelegate)UIApplication.SharedApplication.Delegate;

            searchManager = new SearchManager(appDlg.conn);

            hud = new MTMBProgressHUD(View)
            {
                LabelText = "Searching Twitter...",
                RemoveFromSuperViewOnHide = true
            };
            View.AddSubview(hud);
            hud.Show(animated: true);
            loadTweets();
        }
        public void Show(string text = null)
        {
            if (_hud == null)
            {
                _hud = new MTMBProgressHUD(_currentView)
                {
                    RemoveFromSuperViewOnHide = true,
                    DimBackground             = true
                };
            }

            if (string.IsNullOrEmpty(text) == false)
            {
                _hud.LabelText = text;
            }

            _currentView.AddSubview(_hud);
            _hud.Show(true);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var refreshControl = new UIRefreshControl();

            this.RefreshControl = refreshControl;
            this.RefreshControl.ValueChanged += this.OnRefreshControlValueChanged;
            this.progressHud = new MTMBProgressHUD(View)
            {
                LabelText = "Loading...",
                RemoveFromSuperViewOnHide = true
            };

            View.AddSubview(this.progressHud);
            this.progressHud.Show(animated: true);

            this.facilityService.LoginCompletedAction = this.RetrieveRequests;
            this.facilityService.LoginAsync(true, ConfigurationHub.ReadConfigurationValue("AadAuthority"), ConfigurationHub.ReadConfigurationValue("AppRedirectLocation"), ConfigurationHub.ReadConfigurationValue("AadRedirectResourceURI"), ConfigurationHub.ReadConfigurationValue("AadClientID"));
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            _MainSection = new Section()
            {
                new ActivityElement()
            };
            Root = new RootElement("Markers")
            {
                _MainSection
            };

            // Simple demo of a progress HUD. Doesn't actually do anything useful.
            // Added after question from audience.
            MTMBProgressHUD progress = new MTMBProgressHUD()
            {
                DimBackground = true,
                LabelText     = "Doing something.",
            };

            View.Add(progress);
            progress.Show(animated: true);
            Task.Factory.StartNew(() => {
                Thread.Sleep(2000);
                InvokeOnMainThread(() => {
                    progress.Hide(animated: true);
                });
            });

            mapController = new MapViewController();
            mapController.NewMarkerCreated += (object sender, MarkerAddedEventArgs e) => {
                InvokeOnMainThread(() => {
                    _Database.SaveMarker(e.MarkerInfo);
                    RefreshMarkers();
                });
            };
            RefreshMarkers();
        }
Esempio n. 24
0
        public async override void ViewDidAppear(bool animated)
        {
            base.ViewDidAppear(animated);

            var hud = new MTMBProgressHUD(View)
            {
                LabelText = "Loading",
                RemoveFromSuperViewOnHide = true
            };

            View.AddSubview(hud);
            hud.Show(animated: true);
            hud.Hide(animated: true, delay: 0.5);

            var onlinePublicationList = await  GetLatestPublicationList();

            if (onlinePublicationList != null)
            {
                publicationList = onlinePublicationList;
                UpdatePublicationViewList();
                ShowPublicationViews();
            }
        }
Esempio n. 25
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            NavigationController.NavigationBarHidden = true;

            _hud = new MTMBProgressHUD(View)
            {
                LabelText = "Executing..."
            };

            View.AddSubview(_hud);

            var set = this.CreateBindingSet <CalculatorView, CalculatorViewModel> ();

            set.Bind(ResultField).For(v => v.Text).To(vm => vm.DisplayField);
            set.Bind(Zero).To(vm => vm.ZeroPressed);
            set.Bind(One).To(vm => vm.OnePressed);
            set.Bind(Two).To(vm => vm.TwoPressed);
            set.Bind(Three).To(vm => vm.ThreePressed);
            set.Bind(Four).To(vm => vm.FourPressed);
            set.Bind(Five).To(vm => vm.FivePressed);
            set.Bind(Six).To(vm => vm.SixPressed);
            set.Bind(Seven).To(vm => vm.SevenPressed);
            set.Bind(Eight).To(vm => vm.EightPressed);
            set.Bind(Nine).To(vm => vm.NinePressed);
            set.Bind(Decimal).To(vm => vm.DecimalPressed);
            set.Bind(ToggleSign).To(vm => vm.ToggleSignPressed);
            set.Bind(Clear).To(vm => vm.ClearPressed);
            set.Bind(Divise).To(vm => vm.DividePressed);
            set.Bind(Multiply).To(vm => vm.TimesPressed);
            set.Bind(Plus).To(vm => vm.PlusPressed);
            set.Bind(Minus).To(vm => vm.MinusPressed);
            set.Bind(Equals).To(vm => vm.EqualsPressed);
            set.Bind(this).For(v => v.InProgress).To(vm => vm.IsLoading);
            set.Apply();
        }
Esempio n. 26
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            BleDevicesTable.Source = this._tableSource;

            // wire up the DiscoveredPeripheral event to update the table
            BluetoothLEManager.Current.DeviceDiscovered += (object sender, CBDiscoveredPeripheralEventArgs e) => {
                this._tableSource.Peripherals = BluetoothLEManager.Current.DiscoveredDevices;
                this.BleDevicesTable.ReloadData();
            };

            BluetoothLEManager.Current.ScanTimeoutElapsed += (sender, e) => {
                this._scanButton.SetState(ScanButton.ScanButtonState.Normal);
            };

            // add our 'connecting' overlay
            this._connectingDialog = new MTMBProgressHUD(View)
            {
                LabelText = "Connecting to device...",
                RemoveFromSuperViewOnHide = false
            };
            this.View.AddSubview(this._connectingDialog);
        }
Esempio n. 27
0
 void HandleDidHide(object sender, EventArgs e)
 {
     hud.RemoveFromSuperview();
     hud = null;
 }
Esempio n. 28
0
 public void HideLoading()
 {
     progressDialog?.Hide(true);
     progressDialog?.RemoveFromSuperview();
     progressDialog = null;
 }
Esempio n. 29
0
 private void HideProgress()
 {
     hud.Hide(true);
     hud = null;
 }
Esempio n. 30
0
 public MyNSUrlConnectionDelegete(AppDelegate del, MTMBProgressHUD hud)
 {
     this.del = del;
     this.hud = hud;
 }