Ejemplo n.º 1
0
        private void SetupSubViews()
        {
            _avatar = new AvatarImageView();

            _displayName = new UILabel {
                Font = iOS.Appearance.Fonts.LatoBoldWithSize(14.5f), TextColor = iOS.Appearance.Colors.DefaultTextColor, Text = "Display Name"
            };
            _timeAgo = new UILabel {
                Font = iOS.Appearance.Fonts.LatoWithSize(11.86f), TextColor = iOS.Appearance.Colors.SubTextColor, Text = "30 minutes ago"
            };

            _text = new UILabel {
                Font = iOS.Appearance.Fonts.LatoWithSize(15), TextColor = iOS.Appearance.Colors.DefaultTextColor, Lines = 0
            };

            _extraText = new UILabel {
                BackgroundColor = UIColor.Clear, Lines = 3, LineBreakMode = UILineBreakMode.TailTruncation, Font = iOS.Appearance.Fonts.LatoWithSize(13), TextColor = iOS.Appearance.Colors.DefaultTextColor
            };

            _bottomRuler = new UIView {
                BackgroundColor = iOS.Appearance.Colors.RulerColor
            };

            _backgroundColor = new UIView {
                BackgroundColor = UIColor.Clear
            };

            ContentView.AddSubviews(_backgroundColor, _avatar, _displayName, _timeAgo, _text, _bottomRuler, _extraText);
        }
Ejemplo n.º 2
0
        private void SetupSubViews()
        {
            _avatar = new AvatarImageView();

            _displayName = new UILabel {
                Font = iOS.Appearance.Fonts.LatoBoldWithSize(14.5f), TextColor = iOS.Appearance.Colors.DefaultTextColor, Text = "Display Name"
            };
            _timeAgo = new UILabel {
                Font = iOS.Appearance.Fonts.LatoWithSize(11.86f), TextColor = iOS.Appearance.Colors.SubTextColor, Text = "30 minutes ago"
            };

            //_text = new UILabel { Font = iOS.Appearance.Fonts.LatoWithSize(15), TextColor = iOS.Appearance.Colors.DefaultTextColor, Text = "Comment text", Lines = 0 };
            Text = new HtmlTextView();

            _contextButton = new UIButton();
            _contextButton.TouchUpInside += ContextButtonOnTouchUpInside;
            var contextButtonImage = UIImage.FromBundle("Icons/icon_more.png");

            _contextButton.SetImage(contextButtonImage, UIControlState.Normal);

            _bottomRuler = new UIView {
                BackgroundColor = iOS.Appearance.Colors.BarShadowColor
            };

            ContentView.AddSubviews(_avatar, _displayName, _timeAgo, Text, _bottomRuler, _contextButton);
        }
Ejemplo n.º 3
0
        protected override void SetupLayoutConstraints()
        {
            base.SetupLayoutConstraints();

            this.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();

            this.AddConstraints(
                AvatarImageView.WithSameCenterX(this),
                AvatarImageView.AtTopOf(this, AppDimens.Inset4X));

            this.AddConstraints(
                AvatarLabel.WithSameCenterX(this),
                AvatarLabel.Below(AvatarImageView, AppDimens.Inset1X));

            this.AddConstraints(
                ChoiceAllButton.AtLeftOf(this),
                ChoiceAllButton.Below(AvatarLabel, AppDimens.Inset1X),
                ChoiceAllButton.AtRightOf(this),
                ChoiceAllButton.Height().EqualTo(AppDimens.ButtonSize));

            this.AddConstraints(
                ChoiceOpenButton.AtLeftOf(this),
                ChoiceOpenButton.Below(ChoiceAllButton),
                ChoiceOpenButton.AtRightOf(this),
                ChoiceOpenButton.Height().EqualTo(AppDimens.ButtonSize));

            this.AddConstraints(
                ChoiceClosedButton.AtLeftOf(this),
                ChoiceClosedButton.Below(ChoiceOpenButton),
                ChoiceClosedButton.AtRightOf(this),
                ChoiceClosedButton.Height().EqualTo(AppDimens.ButtonSize));
        }
        void ReleaseDesignerOutlets()
        {
            if (AvatarImageView != null)
            {
                AvatarImageView.Dispose();
                AvatarImageView = null;
            }

            if (BioTextView != null)
            {
                BioTextView.Dispose();
                BioTextView = null;
            }

            if (ProfileActivityTableView != null)
            {
                ProfileActivityTableView.Dispose();
                ProfileActivityTableView = null;
            }

            if (UsernameLabel != null)
            {
                UsernameLabel.Dispose();
                UsernameLabel = null;
            }
        }
Ejemplo n.º 5
0
        private void SetupViews()
        {
            // Turn off selection!!!!!
            SelectionStyle = UITableViewCellSelectionStyle.None;

            _imageView = new AvatarImageView();

            _text = new UILabel {
                TextColor = iOS.Appearance.Colors.DefaultTextColor, Font = iOS.Appearance.Fonts.LatoBoldWithSize(14)
            };

            using (var arrow = UIImage.FromBundle("Icons/arrow_right_light.png").ImageWithColor(UIColor.FromRGB(197, 197, 197)))
            {
                _arrow = new UIImageView(arrow);
            }

            _topRuler = new UIView
            {
                BackgroundColor = iOS.Appearance.Colors.RulerColor
            };

            ContentView.BackgroundColor = iOS.Appearance.Colors.White;

            ContentView.AddSubviews(_imageView, _text, _arrow, _topRuler);
        }
 void ReleaseDesignerOutlets()
 {
     if (AvatarImageView != null)
     {
         AvatarImageView.Dispose();
         AvatarImageView = null;
     }
     if (CustomerIdTextField != null)
     {
         CustomerIdTextField.Dispose();
         CustomerIdTextField = null;
     }
     if (DetailTypeSegmentedControl != null)
     {
         DetailTypeSegmentedControl.Dispose();
         DetailTypeSegmentedControl = null;
     }
     if (FirstNameTextField != null)
     {
         FirstNameTextField.Dispose();
         FirstNameTextField = null;
     }
     if (LastNameTextField != null)
     {
         LastNameTextField.Dispose();
         LastNameTextField = null;
     }
     if (TableView != null)
     {
         TableView.Dispose();
         TableView = null;
     }
 }
Ejemplo n.º 7
0
        private void SetupSubViews()
        {
            _topBorder = new UIView {
                BackgroundColor = iOS.Appearance.Colors.RulerColor
            };
            _bottomBorder = new UIView {
                BackgroundColor = iOS.Appearance.Colors.RulerColor
            };

            _avatar = new AvatarImageView();

            _displayName = new UILabel {
                Font = iOS.Appearance.Fonts.LatoBoldWithSize(14), TextColor = iOS.Appearance.Colors.DefaultTextColor
            };
            _timeAgo = new UILabel {
                Font = iOS.Appearance.Fonts.LatoWithSize(11), TextColor = iOS.Appearance.Colors.SubTextColor, TextAlignment = UITextAlignment.Right
            };

            _unreadContainer = new UIView {
                BackgroundColor = iOS.Appearance.Colors.Green
            };
            _unreadContainer.Layer.CornerRadius = 10.0f;
            _numberUnread = new UILabel {
                Font = iOS.Appearance.Fonts.LatoBoldWithSize(11), TextColor = iOS.Appearance.Colors.White
            };

            _lastMessage = new UILabel {
                Font = iOS.Appearance.Fonts.LatoWithSize(14), TextColor = iOS.Appearance.Colors.DefaultTextColor.ColorWithAlpha(0.8f)
            };

            ContentView.AddSubviews(_topBorder, _bottomBorder, _avatar, _displayName, _timeAgo, _unreadContainer, _numberUnread, _lastMessage);
        }
Ejemplo n.º 8
0
        private void SetupControls()
        {
            BackgroundView = new UIView {
                BackgroundColor = iOS.Appearance.Colors.White
            };

            _imageView = new AvatarImageView();

            ContentView.AddSubview(_imageView);
        }
Ejemplo n.º 9
0
        private void SetupSubViews()
        {
            _topRuler = new UIView {
                BackgroundColor = iOS.Appearance.Colors.RulerColor
            };
            _avatar       = new AvatarImageView();
            _displayLabel = new UILabel {
                Font = iOS.Appearance.Fonts.LatoBoldWithSize(14), TextColor = iOS.Appearance.Colors.DefaultTextColor
            };

            ContentView.AddSubviews(_topRuler, _avatar, _displayLabel);
        }
Ejemplo n.º 10
0
        private void SetupSubViews()
        {
            _bottomRuler = new UIView {
                BackgroundColor = iOS.Appearance.Colors.RulerColor
            };

            _logo = new AvatarImageView();

            _name = new UILabel {
                TextColor = iOS.Appearance.Colors.DefaultTextColor, Font = iOS.Appearance.Fonts.LatoWithSize(17)
            };

            ContentView.AddSubviews(_bottomRuler, _name, _logo);

            SelectionStyle = UITableViewCellSelectionStyle.Gray;
        }
Ejemplo n.º 11
0
        private void SetupAppearance()
        {
            MessageTable.BackgroundColor = Colors.BackgroundColor;
            View.BackgroundColor         = UIColor.White;

            ChatInput.BackgroundColor   = Colors.BackgroundColor;
            ChatInput.Layer.BorderColor = Colors.BarShadowColor.CGColor;

            _avatar = new AvatarImageView {
                Frame = new CGRect(0, 0, 30, 30)
            };

            SDWebImageDownloader.SharedDownloader.DownloadImage(new NSUrl(Settings.BlobUrl + ViewModel.AvatarUrl), SDWebImageDownloaderOptions.ProgressiveDownload, null,
                                                                (image, data, error, finished) =>
            {
                if (image == null)
                {
                    return;
                }

                _avatar.Image = image;

                var avatarButton = new UIBarButtonItem(_avatar);

                NavigationItem.SetRightBarButtonItem(avatarButton, true);
            });

            // Add back button
            using (
                var backImage =
                    UIImage.FromBundle("Icons/back_arrow.png")
                    .ImageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal))
            {
                _backButton = new UIBarButtonItem(backImage, UIBarButtonItemStyle.Plain, null, null);
            }
            _backButton.Clicked += (sender, args) =>
            {
                NavigationController.PopViewController(true);
            };

            NavigationController.InteractivePopGestureRecognizer.Delegate = new SwipeGestureDelegate();
            NavigationItem.SetLeftBarButtonItem(_backButton, true);

            InputBoxTopRuler.BackgroundColor = Colors.BarShadowColor;
            InputBox.BackgroundColor         = Colors.White;
        }
        void ReleaseDesignerOutlets()
        {
            if (AvatarImageView != null)
            {
                AvatarImageView.Dispose();
                AvatarImageView = null;
            }

            if (RankLabel != null)
            {
                RankLabel.Dispose();
                RankLabel = null;
            }

            if (PlayerNameLabel != null)
            {
                PlayerNameLabel.Dispose();
                PlayerNameLabel = null;
            }
        }
Ejemplo n.º 13
0
        protected override void SetupLayoutConstraints()
        {
            base.SetupLayoutConstraints();

            this.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();

            this.AddConstraints(
                AvatarImageView.AtTopOf(this, 32),
                AvatarImageView.WithSameCenterX(this),
                AvatarImageView.Width().EqualTo(114),
                AvatarImageView.Height().EqualTo(114),
                NameLabel.Below(AvatarImageView, 18),
                NameLabel.AtLeadingOf(this, 16),
                NameLabel.AtTrailingOf(this, 16),
                MenuDeviderView.AtLeadingOf(this, 0),
                MenuDeviderView.AtTrailingOf(this, 0),
                MenuDeviderView.Height().EqualTo(Theme.Dimensions.DeviderWidth),
                MenuDeviderView.Below(NameLabel, 14),
                MenuTableView.Below(MenuDeviderView),
                MenuTableView.AtLeadingOf(this),
                MenuTableView.AtTrailingOf(this),
                MenuTableView.AtBottomOf(this));
        }
Ejemplo n.º 14
0
        private void SetupSubViews()
        {
            BackgroundColor = iOS.Appearance.Colors.BackgroundColor;

            _avatar = new AvatarImageView();

            DisplayName = new UILabel {
                Font = iOS.Appearance.Fonts.LatoBoldWithSize(14), TextColor = iOS.Appearance.Colors.DefaultTextColor
            };
            _timeAgo = new UILabel {
                Font = iOS.Appearance.Fonts.LatoWithSize(11), TextColor = iOS.Appearance.Colors.SubTextColor
            };

            Message = new UILabel {
                Font = iOS.Appearance.Fonts.LatoWithSize(15), TextColor = iOS.Appearance.Colors.ChatMessageColor, Lines = 0
            };

            ContentView.Add(_avatar);
            ContentView.Add(DisplayName);
            ContentView.Add(_timeAgo);
            ContentView.Add(Message);

            SelectionStyle = UITableViewCellSelectionStyle.None;
        }
Ejemplo n.º 15
0
        private void SetupSubViews()
        {
            BackgroundColor = iOS.Appearance.Colors.BackgroundColor;
            SelectionStyle  = UITableViewCellSelectionStyle.None;

            // Backpanel
            _backPanel = new UIView {
                BackgroundColor = iOS.Appearance.Colors.White, AccessibilityIdentifier = "BackPanel"
            };
            _topBorder = new UIView {
                BackgroundColor = iOS.Appearance.Colors.BackPanelBorderTop, AccessibilityIdentifier = "TopBorder"
            };
            _bottomBorder = new UIView {
                BackgroundColor = iOS.Appearance.Colors.BackPanelBorderBottom, AccessibilityIdentifier = "BottomBorder"
            };

            // Header
            _avatarImageView = new AvatarImageView {
                AccessibilityIdentifier = "AvatarImage"
            };
            _displayName = new UILabel {
                Font = iOS.Appearance.Fonts.LatoBoldWithSize(14.5f), TextColor = iOS.Appearance.Colors.DefaultTextColor, Text = "Display Name", AccessibilityIdentifier = "DisplayName"
            };
            _timeAgo = new UILabel {
                Font = iOS.Appearance.Fonts.LatoWithSize(11.86f), TextColor = iOS.Appearance.Colors.SubTextColor, Text = "30 minutes ago", AccessibilityIdentifier = "TimeAgo"
            };
            _contextButton = new UIButton();
            _contextButton.TouchUpInside += ContextButtonOnTouchUpInside;

            var contextButtonImage = UIImage.FromBundle("Icons/icon_more.png");

            _contextButton.SetImage(contextButtonImage, UIControlState.Normal);

            // Text
            _postText = new HtmlTextView(ShouldInteractWithUrl)
            {
                AccessibilityIdentifier = "PostText"
            };

            // Content
            _mainImage = new UIImageView {
                ContentMode = UIViewContentMode.ScaleAspectFill, ClipsToBounds = true, BackgroundColor = iOS.Appearance.Colors.BackgroundColor
            };

            // Text for events and other items
            _date = new UILabel {
                TextColor = iOS.Appearance.Colors.DefaultTextColor, Font = iOS.Appearance.Fonts.LatoWithSize(13), TextAlignment = UITextAlignment.Center
            };
            _dateBackPanel = new UIView {
                BackgroundColor = iOS.Appearance.Colors.White
            };
            _dateBackPanel.Layer.CornerRadius = 4.0f;

            _infoContainer            = new UIView();
            _infoContainerPlaceholder = new UIView();

            _title = new UILabel {
                TextColor = iOS.Appearance.Colors.White, Font = iOS.Appearance.Fonts.LatoBlackWithSize(24), Lines = 1, LineBreakMode = UILineBreakMode.TailTruncation
            };
            _time = new UILabel {
                TextColor = iOS.Appearance.Colors.White, Font = iOS.Appearance.Fonts.LatoWithSize(15)
            };
            _location = new UILabel {
                TextColor = iOS.Appearance.Colors.White, Font = iOS.Appearance.Fonts.LatoWithSize(15), Lines = 1, LineBreakMode = UILineBreakMode.TailTruncation
            };

            _leftSubImage = new UIImageView {
                ContentMode = UIViewContentMode.ScaleAspectFill, ClipsToBounds = true, BackgroundColor = iOS.Appearance.Colors.BackgroundColor
            };
            _rightSubImage = new UIImageView {
                ContentMode = UIViewContentMode.ScaleAspectFill, ClipsToBounds = true, BackgroundColor = iOS.Appearance.Colors.BackgroundColor
            };

            // Footer
            _ruler = new UIView {
                BackgroundColor = iOS.Appearance.Colors.RulerColor
            };
            _commentButton = new FeedButton {
                ImageTopSpacing = 3
            };
            _likeButton = new FeedButton {
                ImageBottomSpacing = 3
            };

            // Add views
            ContentView.AddSubviews(_backPanel, _topBorder, _bottomBorder, _avatarImageView, _displayName, _timeAgo, _postText, _mainImage, _infoContainer, _infoContainerPlaceholder, _title, _dateBackPanel, _date, _time, _location, _leftSubImage, _rightSubImage, _ruler, _commentButton, _likeButton, _contextButton);
        }
Ejemplo n.º 16
0
        private void SetupNotificationView()
        {
            // Setup subviews
            _notificationViewContainer = new UIView
            {
                BackgroundColor = Appearance.Colors.NatificationPanel,
                Frame           = new CGRect(0, -64, View.Frame.Width, 64)
            };

            _avatar      = new AvatarImageView();
            _displayName = new UILabel {
                TextColor = iOS.Appearance.Colors.White, Font = Appearance.Fonts.LatoBoldWithSize(14), Lines = 1
            };
            _text = new UILabel {
                TextColor = iOS.Appearance.Colors.White, Font = Appearance.Fonts.LatoWithSize(11.86f), Lines = 1, LineBreakMode = UILineBreakMode.TailTruncation
            };
            _bottomSwipHandle = new UIView {
                BackgroundColor = Appearance.Colors.White
            };
            _bottomSwipHandle.Layer.CornerRadius = 2.0f;

            // Gesture recognizers
            _tap = new UITapGestureRecognizer(gesture =>
            {
                if (AppDelegate.MainWindow.RootViewController.VisibleViewController().IsChatConversation())
                {
                    var chatConversation = (ChatConversationView)AppDelegate.MainWindow.RootViewController.VisibleViewController();

                    var viewModel = chatConversation.DataContext as ChatConversationViewModel;

                    if (viewModel != null && viewModel.Id != _conversationId)
                    {
                        chatConversation.DismissViewController(false, OpenChatView);
                    }

                    return;
                }

                if (AppDelegate.MainWindow.RootViewController.VisibleViewController() is ImageZoomView)
                {
                    var imageZoom = (ImageZoomView)AppDelegate.MainWindow.RootViewController.VisibleViewController();

                    imageZoom.DismissModalViewController(false);
                }

                if (AppDelegate.MainWindow.RootViewController.VisibleViewController() is UserView)
                {
                    var userView = (UserView)AppDelegate.MainWindow.RootViewController.VisibleViewController();

                    userView.DismissModalViewController(false);
                }

                OpenChatView();
            })
            {
                NumberOfTapsRequired = 1
            };

            _swipe = new UISwipeGestureRecognizer(() =>
            {
                HideNotification();
            })
            {
                Direction = UISwipeGestureRecognizerDirection.Up
            };

            // Add gestures to views
            _notificationViewContainer.AddGestureRecognizer(_tap);
            _notificationViewContainer.AddGestureRecognizer(_swipe);
            _avatar.AddGestureRecognizer(_tap);
            _avatar.AddGestureRecognizer(_swipe);
            _displayName.AddGestureRecognizer(_tap);
            _displayName.AddGestureRecognizer(_swipe);
            _text.AddGestureRecognizer(_tap);
            _text.AddGestureRecognizer(_swipe);
            _bottomSwipHandle.AddGestureRecognizer(_swipe);

            // Enable user interaction
            _notificationViewContainer.UserInteractionEnabled = true;
            _avatar.UserInteractionEnabled           = true;
            _displayName.UserInteractionEnabled      = true;
            _text.UserInteractionEnabled             = true;
            _bottomSwipHandle.UserInteractionEnabled = true;
            View.UserInteractionEnabled = true;



            // Add subviews to container
            _notificationViewContainer.AddSubviews(_avatar, _displayName, _text, _bottomSwipHandle);

            // Setup constraints
            _notificationViewContainer.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();

            _notificationViewContainer.AddConstraints(
                _avatar.AtLeftOf(_notificationViewContainer, 10),
                _avatar.WithSameCenterY(_notificationViewContainer),
                _avatar.Width().EqualTo(40),
                _avatar.Height().EqualTo(40),

                _displayName.ToRightOf(_avatar, 10),
                _displayName.AtRightOf(_notificationViewContainer, 10),
                _displayName.WithSameCenterY(_avatar).Minus(8),

                _text.WithSameCenterY(_avatar).Plus(8),
                _text.WithSameLeft(_displayName),
                _text.WithSameRight(_displayName),

                _bottomSwipHandle.AtBottomOf(_notificationViewContainer, 2),
                _bottomSwipHandle.WithSameCenterX(_notificationViewContainer),
                _bottomSwipHandle.Width().EqualTo(20),
                _bottomSwipHandle.Height().EqualTo(5)
                );

            // Add container to viewdontroller
            View.AddSubviews(_notificationViewContainer);

            // Setup timer for hiding
            _timer = new Timer(3000)
            {
                AutoReset = false
            };
            _timer.Elapsed += (sender, args) =>
            {
                UIApplication.SharedApplication.InvokeOnMainThread(HideNotification);
            };
        }