Exemplo n.º 1
0
        protected AlbumTableViewCell(IntPtr handle) : base(handle)
        {
            _lastImage               = new UIImageView();
            _lastImage.ContentMode   = UIViewContentMode.ScaleAspectFill;
            _lastImage.ClipsToBounds = true;
            ContentView.AddSubview(_lastImage);
            _lastImage.AutoSetDimensionsToSize(new CGSize(80, 80));
            _lastImage.AutoPinEdgeToSuperviewEdge(ALEdge.Left, 10);
            _lastImage.AutoAlignAxisToSuperviewAxis(ALAxis.Horizontal);

            var container = new UIStackView();

            container.Axis = UILayoutConstraintAxis.Vertical;
            ContentView.AddSubview(container);
            container.AutoAlignAxis(ALAxis.Horizontal, _lastImage);
            container.AutoPinEdge(ALEdge.Left, ALEdge.Right, _lastImage, 10);
            container.AutoPinEdgeToSuperviewEdge(ALEdge.Right);

            _name      = new UILabel();
            _name.Font = Constants.Regular16;
            container.AddArrangedSubview(_name);

            _count      = new UILabel();
            _count.Font = Constants.Regular14;
            container.AddArrangedSubview(_count);

            var tapGesture = new UITapGestureRecognizer(() =>
            {
                CellAction?.Invoke(ActionType.Tap, _currentAlbum);
            });

            ContentView.AddGestureRecognizer(tapGesture);
            ContentView.UserInteractionEnabled = true;
        }
Exemplo n.º 2
0
        protected override void ConnectHandler(ContentView nativeView)
        {
            var uiTapGestureRecognizer = new UITapGestureRecognizer(a => nativeView?.EndEditing(true));

            uiTapGestureRecognizer.ShouldRecognizeSimultaneously = (recognizer, gestureRecognizer) => true;
            uiTapGestureRecognizer.ShouldReceiveTouch            = OnShouldReceiveTouch;
            uiTapGestureRecognizer.DelaysTouchesBegan            =
                uiTapGestureRecognizer.DelaysTouchesEnded        = uiTapGestureRecognizer.CancelsTouchesInView = false;
            nativeView.AddGestureRecognizer(uiTapGestureRecognizer);

            base.ConnectHandler(nativeView);
        }
        public override void AwakeFromNib()
        {
            base.AwakeFromNib();

            ImageView.Image = UIImage.LoadFromData(NSData.FromUrl(new NSUrl("https://unsplash.it/300?random")));
            ContentView.AddGestureRecognizer(new UITapGestureRecognizer(() =>
            {
                if (ImageView != null && ImageView.Image != null)
                {
                    EXImageViewer.ShowImageFrom(this.ImageView);
                }
            }));
        }
Exemplo n.º 4
0
        public override void AwakeFromNib()
        {
            base.AwakeFromNib();

            TextLabel.Font                 = Fonts.Regular(14);
            TextLabel.TextColor            = Colors.Grey600;
            ShowMoreButton.TitleLabel.Font = Fonts.Bold(14);
            ShowMoreButton.TouchUpInside  += (_1, _2) => ToggleState();
            ShowMoreButton.TintColor       = Colors.Turquoise;

            var tapGestureRecognizer = new UITapGestureRecognizer(ToggleState);

            ContentView.AddGestureRecognizer(tapGestureRecognizer);
        }
Exemplo n.º 5
0
        public override void LayoutSubviews()
        {
            if (!_isInitialized)
            {
                SelectionStyle = UITableViewCellSelectionStyle.None;
                var tap = new UITapGestureRecognizer(() =>
                {
                    CellAction?.Invoke(ActionType.Tap, tagLabel.Text);
                });
                ContentView.AddGestureRecognizer(tap);
                tagLabel.Font  = Helpers.Constants.Semibold14;
                hashLabel.Font = Helpers.Constants.Semibold14;

                _isInitialized = true;
            }

            base.LayoutSubviews();
        }
Exemplo n.º 6
0
        public override void LayoutSubviews()
        {
            if (!_isInitialized)
            {
                var tap = new UITapGestureRecognizer(() =>
                {
                    CellAction?.Invoke(ActionType.Tap, _currentAccount);
                });
                var deleteTap = new UITapGestureRecognizer(() =>
                {
                    CellAction?.Invoke(ActionType.Delete, _currentAccount);
                });

                closeButton.AddGestureRecognizer(deleteTap);
                ContentView.AddGestureRecognizer(tap);

                networkName.Font = Helpers.Constants.Semibold14;

                _isInitialized = true;
            }
        }
        public NotificationsTableCell(List <NotificationModel> _notes, int _index, nfloat _cellHt, NotificationsViewController _nVC)
        {
            notes  = _notes;
            index  = _index;
            cellHt = _cellHt;
            nVC    = _nVC;

            date = new UILabel()
            {
                BackgroundColor = UIColor.Clear,
                Font            = UIFont.FromName(Util.FontMain, 16),
                TextColor       = Util.Grey,
                TextAlignment   = UITextAlignment.Left
            };

            message = new UILabel()
            {
                TextColor       = UIColor.Black,
                Font            = UIFont.FromName(Util.FontMain, 16),
                Lines           = 2,
                TextAlignment   = UITextAlignment.Left,
                BackgroundColor = UIColor.Clear
            };

            icon = new UIImageView()
            {
                Image       = UIImage.FromFile("Images/whitecheck.png").ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate),
                TintColor   = Util.Grey,
                ContentMode = UIViewContentMode.ScaleAspectFill
            };

            ContentView.BackgroundColor = UIColor.FromRGB(223, 223, 223);
            ContentView.AddGestureRecognizer(Tap(index));
            ContentView.Add(date);
            ContentView.Add(message);
            ContentView.Add(icon);
        }
Exemplo n.º 8
0
 void createUIGestures()
 {
     this.panGestureRecognizer = new UIPanGestureRecognizer(panGestureRecognizerEventHandler);
     this.panGestureRecognizer.WeakDelegate = this;
     ContentView.AddGestureRecognizer(this.panGestureRecognizer);
 }