예제 #1
0
        public ConnectivityView()
        {
            BackgroundColor = UIColor.FromRGB(224, 224, 224);
            _width          = (float)UIScreen.MainScreen.Bounds.Width;

            var contactNameLable = new UILabel();

            contactNameLable.Frame                 = new RectangleF(20f, 10f, _width - 40f, 20f);
            contactNameLable.Text                  = Application.LocalizedString("InternetConnectionNotAvailable");
            contactNameLable.Font                  = UIFont.FromName("Helvetica", 15f);
            contactNameLable.TextColor             = UIColor.Red;
            contactNameLable.Layer.BackgroundColor = UIColor.Clear.CGColor;

            var deleteButton = new UIButton(UIButtonType.RoundedRect);

            deleteButton.Frame = new RectangleF(_width - 30f, 10f, 15f, 15f);;
            deleteButton.SetTitle("X", UIControlState.Normal);
            deleteButton.SetTitleColor(UIColor.FromRGB(255, 76, 57), UIControlState.Normal);
            deleteButton.Layer.BackgroundColor = UIColor.FromRGB(224, 224, 224).CGColor;

            deleteButton.TouchUpInside += (s, e) =>
            {
                AnimationView.StartAnimatinon(0.3);
                Frame = new RectangleF(0f, 24f, _width, 0f);
                AnimationView.StopAnimatinon();
            };

            AddSubview(contactNameLable);
            AddSubview(deleteButton);
        }
예제 #2
0
 public bool DataConnectivity()
 {
     // No internet
     if (!_connectionService.IsDeviceConnectedToInternet())
     {
         // We show the rubban displayed no internet
         Hidden = false;
         AnimationView.StartAnimatinon(0.3);
         Frame = new RectangleF(0f, 64f, _width, 40f);
         AnimationView.StopAnimatinon();
         return(true);
     }
     else
     {
         Frame = new RectangleF(0f, 24f, _width, 0f);
         return(false);
     }
 }
예제 #3
0
        /// <summary>
        /// Set the data and style to the view
        /// </summary>
        public override void SetDataAndStyleToView()
        {
            //Initialise all strings
            InitialiseAllStrings();

            // set up title and content
            if (!App.Locator.Alert.IsNew)
            {
                AlertTitleTextField.Text   = App.Locator.Alert.TitleAlert;
                AlertMessageTextField.Text = App.Locator.Alert.ContentAlert;
                MaxSizeMessageLabel.Text   = string.Format(Application.LocalizedString("MessageLength"), AlertMessageTextField.Text.Length);
            }
            else
            {
                var nav = (NavigationService)GalaSoft.MvvmLight.Ioc.SimpleIoc.Default.GetInstance <GalaSoft.MvvmLight.Views.INavigationService>();

                //if (nav.GetLastEntry() is ModeDontMoveSecondView)
                //{
                //    AlertTitleTextField.Text = string.Format(Application.LocalizedString("AlertSeekiosMovedTitle"), App.Locator.DetailSeekios.SeekiosSelected.SeekiosName);
                //    AlertMessageTextField.Text = string.Format(Application.LocalizedString("AlertSeekiosMovedContent"), App.Locator.DetailSeekios.SeekiosSelected.SeekiosName);
                //}
                //else if (nav.GetLastEntry() is ModeZoneSecondView)
                //{
                //    AlertTitleTextField.Text = string.Format(Application.LocalizedString("AlertSeekiosOutOfZoneTitle"), App.Locator.DetailSeekios.SeekiosSelected.SeekiosName);
                //    AlertMessageTextField.Text = string.Format(Application.LocalizedString("AlertSeekiosOutOfZoneContent"), App.Locator.DetailSeekios.SeekiosSelected.SeekiosName);
                //}
            }

            // set up list of recipient
            if (App.Locator.ModeZone.EditingAlerts)
            {
                foreach (var recipient in App.Locator.Alert.LsRecipients)
                {
                    CreateContactContainerUI(recipient);
                }
            }

            // round buttons for the contacts container
            var profileImageCircle = AddRecipientButton.Layer;

            profileImageCircle.CornerRadius  = AddRecipientButton.Frame.Size.Width / 2;
            AddRecipientButton.ClipsToBounds = true;

            var profileImageCircle1 = AddRecipientFromContactBookButton.Layer;

            profileImageCircle1.CornerRadius = AddRecipientFromContactBookButton.Frame.Size.Width / 2;
            AddRecipientFromContactBookButton.ClipsToBounds = true;

            // display empty list if the list is empty
            if (App.Locator.Alert.LsRecipients.Count == 0)
            {
                EmptyDataButton.Hidden = false;
            }
            else
            {
                EmptyDataButton.Hidden = true;
            }

            // set up the border of the contact container
            ViewBehindScrollView.Layer.BorderWidth  = 1f;
            ViewBehindScrollView.Layer.CornerRadius = 4;
            ViewBehindScrollView.Layer.BorderColor  = UIColor.FromRGB(229, 229, 229).CGColor;

            // set up the border of the alert title
            AlertTitleTextField.Layer.BorderWidth  = 1f;
            AlertTitleTextField.Layer.CornerRadius = 4;
            AlertTitleTextField.Layer.BorderColor  = UIColor.FromRGB(229, 229, 229).CGColor;
            AlertTitleTextField.ShouldReturn      += (textField) => { AlertTitleTextField.ResignFirstResponder(); return(true); };
            AlertTitleTextField.EditingChanged    += (o, s) =>
            {
                AlertTitleTextField.Layer.BorderColor = UIColor.FromRGB(229, 229, 229).CGColor;
            };

            // set up the border of the alert body
            AlertMessageTextField.Layer.BorderWidth   = 1f;
            AlertMessageTextField.Layer.CornerRadius  = 4;
            AlertMessageTextField.Layer.BorderColor   = UIColor.FromRGB(229, 229, 229).CGColor;
            AlertMessageTextField.ShouldBeginEditing += (UITextView) =>
            {
                // set up the scroll the view up or down
                AnimationView.StartAnimatinon(0.3);
                var frame = (RectangleF)View.Frame;
                frame.Y   -= 150;
                View.Frame = frame;
                AnimationView.StopAnimatinon();
                return(true);
            };

            AlertMessageTextField.ShouldChangeText += (UITextView textView, NSRange range, string text) =>
            {
                AlertMessageTextField.Layer.BorderColor = UIColor.FromRGB(229, 229, 229).CGColor;
                // set up the Maximum Character Length for Alert Message
                if (text.Length > 1000)
                {
                    AlertMessageTextField.Text = _priviousMessage;
                }
                else
                {
                    _priviousMessage         = textView.Text;
                    MaxSizeMessageLabel.Text = string.Format(Application.LocalizedString("MessageLength"), textView.Text.Length);
                    return(true);
                }
                return(false);
            };

            AlertMessageTextField.ShouldEndEditing += (UITextView) =>
            {
                // set up the scroll the view up or down
                AnimationView.StartAnimatinon(0.3);
                var frame = (RectangleF)View.Frame;
                frame.Y   += 150;
                View.Frame = frame;
                AnimationView.StopAnimatinon();
                return(true);
            };
        }