public override void ViewDidLoad()
        {
            _didShowNotificationObserver = NSNotificationCenter.DefaultCenter.AddObserver(UIKeyboard.DidShowNotification, KeyBoardDidShow, this);

            _willHideNotificationObserver = NSNotificationCenter.DefaultCenter.AddObserver(UIKeyboard.WillHideNotification, KeyBoardWillHide, this);

            ActivityIndicator.StopAnimating();

            this.LoginField.ShouldReturn       += (textField) => textField.ResignFirstResponder();
            this.PasswordField.ShouldReturn    += (textField) => textField.ResignFirstResponder();
            this.AdressField.ShouldReturn      += (textField) => textField.ResignFirstResponder();
            this.PhoneNumberField.ShouldReturn += (textField) => textField.ResignFirstResponder();

            this.View.AddGestureRecognizer(new UITapGestureRecognizer(() =>
            {
                LoginField.ResignFirstResponder();
                PasswordField.ResignFirstResponder();
                AdressField.ResignFirstResponder();
                PhoneNumberField.ResignFirstResponder();
            }));

            RegistrationButton.TouchUpInside += async(sender, e) =>
            {
                Customers registrationFieldsForAsync = new Customers()
                {
                    Name = LoginField.Text, Password = PasswordField.Text, Adress = AdressField.Text, PhoneNumber = PhoneNumberField.Text
                };
                ActivityIndicator.StartAnimating();
                try
                {
                    RegistrationButton.Enabled = false;
                    LoginAndPasswordCheck.LoginCheck(registrationFieldsForAsync.Name);
                    LoginAndPasswordCheck.PasswordCheck(registrationFieldsForAsync.Password);
                    LoginAndPasswordCheck.AdressCheck(registrationFieldsForAsync.Adress);
                    LoginAndPasswordCheck.PhoneCheck(registrationFieldsForAsync.PhoneNumber);
                    await UsersCheckClass.TryToRegister(registrationFieldsForAsync);

                    AppDelegate.UserName = registrationFieldsForAsync.Name;
                    PerformSegue("RegistrationSegue", null);
                }
                catch (FiledsCheckException e1)
                {
                    ActivityIndicator.StopAnimating();
                    RegistrationButton.Enabled = true;
                    PresentViewController(GetAlertsClass.GetAlert(e1.Message), true, null);
                }
                catch (UserCheckClassException e1)
                {
                    ActivityIndicator.StopAnimating();
                    RegistrationButton.Enabled = true;
                    PresentViewController(GetAlertsClass.GetAlert(e1.Message), true, null);
                }
                catch
                {
                    ActivityIndicator.StopAnimating();
                    RegistrationButton.Enabled = true;
                    PresentViewController(GetAlertsClass.GetAlert("Не удалось подключиться к серверу"), true, null);
                }
            };
        }
Example #2
0
        void Reload()
        {
            bool    updateEnabled = false;
            DBError error;

            if (File.Status.Cached)
            {
                if (!TextViewLoaded)
                {
                    TextViewLoaded = true;
                    string contents = File.ReadString(out error);
                    TextView.Text = contents;
                }
                ActivityIndicator.StopAnimating();
                TextView.Hidden = false;

                if (File.NewerStatus != null && File.NewerStatus.Cached)
                {
                    updateEnabled = true;
                }
            }
            else
            {
                ActivityIndicator.StartAnimating();
                TextView.Hidden = true;
            }
            NavigationItem.RightBarButtonItem.Enabled = updateEnabled;
        }
Example #3
0
        public override async void ViewDidLoad()
        {
            try
            {
                await goods.GetNext();

                await OrderController.GetInstance();

                source = new GoodsSource(goods.List);
                source.RemoveKeyboard += Source_RemoveKeyboard;
                GoodsTableView.Source  = source;
                GoodsTableView.ReloadData();
                ActivityIndicator.StopAnimating();
                this.source.UploadNextItems += async(s, e) =>
                {
                    if (isAsyncUpdateAlowed)
                    {
                        isAsyncUpdateAlowed = false;
                        ActivityIndicator.StartAnimating();

                        if (await goods.GetNext())
                        {
                            GoodsTableView.ReloadData();
                        }

                        ActivityIndicator.StopAnimating();

                        isAsyncUpdateAlowed = true;
                    }
                };

                this.DrugSearchBar.SearchButtonClicked += async(object sender, EventArgs e) =>
                {
                    ActivityIndicator.StartAnimating();
                    this.DrugSearchBar.ResignFirstResponder();
                    List <Goods> search = await goods.Search((sender as UISearchBar).Text);

                    ActivityIndicator.StopAnimating();
                    GoodsSource sou = new GoodsSource(search);
                    sou.RemoveKeyboard   += Source_RemoveKeyboard;
                    GoodsTableView.Source = sou;
                    GoodsTableView.ReloadData();
                };

                this.DrugSearchBar.TextChanged += (object sender, UISearchBarTextChangedEventArgs e) =>
                {
                    if (String.IsNullOrWhiteSpace(e.SearchText))
                    {
                        this.DrugSearchBar.ResignFirstResponder();
                        GoodsTableView.Source = source;
                        GoodsTableView.ReloadData();
                    }
                };
            }
            catch
            {
                ActivityIndicator.StopAnimating();
                PresentViewController(GetAlertsClass.GetAlert("Не удалось подключиться к серверу"), true, null);
            }
        }
Example #4
0
 void UpdateTableData(FlightContent data)
 {
     InvokeOnMainThread(() =>
     {
         TableSource.FlightList.Add(data);
         tableView.ReloadData();
         View.SetNeedsDisplay();
         ActivityIndicator.StopAnimating();
         Console.WriteLine("Flight added");
     });
 }
Example #5
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            foreach (UIView view in View.Subviews)
            {
                view.Alpha = 0;
            }
            TitleImageView.Alpha      = 1;
            BackgroundImageView.Alpha = 1;
            ActivityIndicator.StopAnimating();
        }
 private async Task PerformSearch()
 {
     try
     {
         ActivityIndicator.StartAnimating();
         Grid.BecomeFirstResponder();
         await _dataCollection.SearchAsync(SearchField.Text);
     }
     finally
     {
         ActivityIndicator.StopAnimating();
     }
 }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            ActivityIndicator.Hidden = true;

            // Perform any additional setup after loading the view, typically from a nib.
            LoginButton.TouchUpInside += async(s, e) => {
                LoginButton.Hidden       = true;
                ActivityIndicator.Hidden = false;
                ActivityIndicator.StartAnimating();

                var authorization = new LocalBoxAuthorization(PleioUrl);

                var result = await authorization.Authorize(LoginField.Text, PasswordField.Text);

                if (result)
                {
                    var business = new BusinessLayer();

                    if (DataLayer.Instance.GetLocalBoxesSync().Count == 0)
                    {
                        await business.RegisterLocalBox(PleioUrl);

                        this._home.InitialiseMenuAfterRegistration();
                    }

                    this.View.RemoveFromSuperview();

                    // show (second) site-selection screen
                    if (_introduction)
                    {
                        var sites = new AddSitesViewController(_home, true);
                        sites.View.BackgroundColor = UIColor.FromRGB(14, 94, 167);
                        _home.View.Add(sites.View);
                        _home.AddChildViewController(sites);
                    }
                }
                else
                {
                    LoginButton.Hidden       = false;
                    ActivityIndicator.Hidden = true;
                    ActivityIndicator.StopAnimating();

                    var alert = UIAlertController.Create("Fout", "Gebruikersnaam of wachtwoord is onjuist.", UIAlertControllerStyle.Alert);
                    alert.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Cancel, null));
                    PresentViewController(alert, animated: true, completionHandler: null);
                }
            };
        }
 partial void StartStopAction(Foundation.NSObject sender)
 {
     // Take action based on the Activity Indicator state
     if (ActivityIndicator.IsAnimating)
     {
         StartStopButton.SetTitle("Start", UIControlState.Normal);
         ActivityIndicator.StopAnimating();
     }
     else
     {
         StartStopButton.SetTitle("Stop", UIControlState.Normal);
         ActivityIndicator.StartAnimating();
     }
 }
        public void SetPlotGroup(PlotAnimationGrouping value)
        {
            PlotGrouping = value;

            PrimaryYAxis.Axis       = value.YAxis;
            PrimaryXAxis.Axis       = value.XAxis;
            Grid.YAxis              = value.YAxis;
            Grid.XAxis              = value.XAxis;
            Plot.PlotGroup          = value;
            Slider.MaxValue         = (float)value.AnimationAxis.Max;
            Slider.MinValue         = (float)value.AnimationAxis.Min;
            AnimationAxisTitle.Text = value.AnimationAxis.Title;

            ActivityIndicator.StopAnimating();
        }
Example #10
0
        void DeleteTableDate(FlightContent data)
        {
            var index = TableSource.FlightList.FindIndex(x => x.Key == data.Key);

            InvokeOnMainThread(() =>
            {
                //TableSource.FlightList.RemoveAt(index);
                //tableView.BeginUpdates();
                tableView.ReloadData();
                View.SetNeedsDisplay();
                //tableView.EndUpdates();
                ActivityIndicator.StopAnimating();
                Console.WriteLine("Flight deleted");
            });
        }
        public override async void ViewDidAppear(bool didAppear)
        {
            ActivityIndicator.Hidden = false;
            ActivityIndicator.StartAnimating();

            // Perform any additional setup after loading the view, typically from a nib.
            if (DataLayer.Instance.GetLocalBoxesSync().Count > 0)
            {
                var remoteExplorer = new RemoteExplorer();

                try {
                    List <Site> sites = await remoteExplorer.GetSites();

                    foreach (LocalBox box in DataLayer.Instance.GetLocalBoxesSync())
                    {
                        for (int i = 0; i < sites.Count; i++)
                        {
                            if (box.BaseUrl == sites [i].Url)
                            {
                                sites.RemoveAt(i);
                                break;
                            }
                        }
                    }

                    ActivityIndicator.StopAnimating();
                    ActivityIndicator.Hidden = true;

                    _tableSource     = new TableSource(sites);
                    TableView.Source = _tableSource;
                    TableView.ReloadData();

                    if (sites.Count == 0)
                    {
                        GeenSites.Hidden = false;

                        if (_introduction)
                        {
                            ToevoegenButton.SetTitle("Verder", UIControlState.Normal);
                        }
                    }
                } catch (Exception ex) {
                    Insights.Report(ex);
                    DialogHelper.ShowErrorDialog("Fout", "Er is een fout opgetreden tijdens het ophalen van de sites.");
                }
            }
        }
Example #12
0
        private void ToggleNotificationVisibility(bool showing)
        {
            InvokeOnMainThread(() =>
            {
                notificationShowing = showing;

                if (showing)
                {
                    ActivityIndicator.StartAnimating();
                }
                else
                {
                    ActivityIndicator.StopAnimating();
                }

                StatusLabelGroup.Hidden = !showing;
            });
        }
Example #13
0
        async Task <bool> Authenticate(string accessToken)
        {
            if (String.IsNullOrEmpty(accessToken))
            {
                return(false);
            }
            ActivityIndicator?.StartAnimating();
            //ProgressDialog progress;
            //progress = ProgressDialog.Show(this, Resources.GetString(Resource.String.Authenticating),
            //							   Resources.GetString(Resource.String.PleaseWait), true);
            var cliente = GitHubClientFactory.CreateClient(accessToken);
            var authed  = await _storage.SetClient(cliente);

            System.Diagnostics.Debug.WriteLine("Authenticate");
            if (authed)
            {
                await _storage.SaveToken(accessToken);
            }

            ActivityIndicator?.StopAnimating();
            return(authed);
        }
        public async override void ViewDidLoad()
        {
            try
            {
                orders = await OrderController.GetInstance();

                OrdersSource source = new OrdersSource(orders.ListOfOrders);
                OrderTableView.Source = source;
                OrderTableView.ReloadData();
                ActivityIndicator.StopAnimating();
                this.RefreshControl = new UIRefreshControl();
                this.RefreshControl.ValueChanged += (sender, e) =>
                {
                    this.RefreshControl.BeginRefreshing();
                    OrderTableView.ReloadData();
                    this.RefreshControl.EndRefreshing();
                };
            }
            catch
            {
                ActivityIndicator.StopAnimating();
                PresentViewController(GetAlertsClass.GetAlert("Не удалось подключиться к серверу"), true, null);
            }
        }
Example #15
0
        void InitUI()
        {
            // Adjust constraints as needed
            PhotoImageViewHeightConstraint.Constant = ViewModel.ShowImage ? _photoImageViewDefaultHeightConstraint : 0;

            // Map values to UI elements
            BodyTextView.Text = null;
            BodyTextView.Text = ViewModel.Text;
            BodyTextViewHeightConstraint.Constant = BodyTextView.SizeThatFits(new CGSize(BodyTextView.Frame.Width, nfloat.MaxValue)).Height;
            TimeLabel.Text = ViewModel.ShowDateTime ? ViewModel.DisplayDateTime : string.Empty;
            NameLabel.SetHighlightText(ViewModel.UserName, ViewModel.UserName.IndexOf("@"), UIColor.LightGray);

            LikeButton.SetTitle(ViewModel.LikeButtonText, UIControlState.Normal);
            LikeButton.SetTitleColor(ViewModel.LikeButtonTextColor.ToUIColor(), UIControlState.Normal);

            CommentButton.SetTitle(ViewModel.CommentButtonText, UIControlState.Normal);
            CommentButton.SetTitleColor(ViewModel.CommentButtonTextColor.ToUIColor(), UIControlState.Normal);

            ShareButton.SetTitle(ViewModel.ShareButtonText, UIControlState.Normal);
            ShareButton.SetTitleColor(ViewModel.ShareButtonTextColor.ToUIColor(), UIControlState.Normal);

            if (ViewModel.ShowImage)
            {
                ActivityIndicator.StartAnimating();
            }
            else
            {
                ActivityIndicator.StopAnimating();
            }

            SocialTypeImageView.Image  = UIImage.FromBundle(ViewModel.SocialMediaImage);
            SocialTypeImageView.Hidden = !ViewModel.ShowSocialMediaImage;
            UserImageView.SetImage(
                url: new NSUrl(ViewModel.UserImageUrl),
                placeholder: UIImage.FromBundle(ViewModel.UserImagePlaceholder)
                );

            if (ViewModel.ShowImage)
            {
                PhotoImageView.SetImage(
                    url: new NSUrl(ViewModel.ImageUrl),
                    completionHandler: ((UIImage image, NSError error, SDImageCacheType cacheType, NSUrl imageUrl) => {
                    ActivityIndicator.StopAnimating();
                })
                    );
            }
            else
            {
                PhotoImageView.Image = null;
            }

            if (ViewModel.ShowTimeline)
            {
                ContainerViewLeadingConstraint.Constant = _containerViewTimelineLeadingConstraint;
                TimelineView.Hidden = false;
            }
            else
            {
                ContainerViewLeadingConstraint.Constant = _containerViewDefaultLeadingConstraint;
                TimelineView.Hidden = true;
            }

            CommentButton.Hidden = !ViewModel.ShowCommentButton;
            ShareButton.Hidden   = !ViewModel.ShowShareButton;

            // TODO: Remove this when we're ready to support sharing
            ShareButton.Hidden = true;
        }
Example #16
0
 public override void UpdateText(string text)
 {
     ActivityIndicator.StopAnimating();
     textView.Text = text;
 }
Example #17
0
 // Replaces the activity indicator with the 'Add' or 'Save' button.
 void HideActivityIndicator()
 {
     ActivityIndicator.StopAnimating();
     NavigationItem.RightBarButtonItem = AddButton;
 }
Example #18
0
 public void HideLoader()
 {
     ActivityIndicator.StopAnimating();
 }
Example #19
0
 void ViewModel_DidEndUpadateWeather()
 {
     ActivityIndicator.StopAnimating();
     ActivityIndicator.Hidden = true;
 }