예제 #1
0
        public void UpdateCell(Speaker speaker)
        {
            nameLabel.Text = speaker.Name;
            string subtitle = "";

            if (String.IsNullOrEmpty(speaker.Title))
            {
                subtitle = String.Format("{0}", speaker.Company);
            }
            else if (String.IsNullOrEmpty(speaker.Company))
            {
                subtitle = String.Format("{0}", speaker.Title);
            }
            else
            {
                subtitle = String.Format("{0}, {1}", speaker.Title, speaker.Company);
            }

            companyLabel.Text = subtitle;

            if (speaker.ImageUrl != "http://www.mobileworldcongress.com")
            {
                var u = new Uri(speaker.ImageUrl);
                image.Image = ImageLoader.DefaultRequestImage(u, this);
            }
        }
예제 #2
0
        public override UITableViewCell GetCell(UITableView tv)
        {
            var cell = tv.DequeueReusableCell(RepositoryTableViewCell.Key) as RepositoryTableViewCell;

            if (cell == null)
            {
                cell = RepositoryTableViewCell.Create();
            }

            if (!string.IsNullOrEmpty(_imageUrl))
            {
                Uri uri;
                cell.Image = Uri.TryCreate(_imageUrl, UriKind.Absolute, out uri) ?
                             ImageLoader.DefaultRequestImage(uri, this) : null;
            }
            else
            {
                cell.Image = _image;
            }

            cell.Owner       = _owner;
            cell.Description = _description;
            cell.Name        = _name;
            return(cell);
        }
예제 #3
0
        void Update()
        {
            nameLabel.Text    = speaker.Name;
            titleLabel.Text   = speaker.Title;
            companyLabel.Text = speaker.Company;

            if (!String.IsNullOrEmpty(speaker.Bio))
            {
                bioTextView.Text      = speaker.Bio;
                bioTextView.TextColor = UIColor.Black;
            }
            else
            {
                bioTextView.TextColor = UIColor.Gray;
                bioTextView.Text      = "No background information available.";
            }
            if (speaker.ImageUrl != "http://www.mobileworldcongress.com" && !string.IsNullOrEmpty(speaker.ImageUrl))
            {
                var u = new Uri(speaker.ImageUrl);
                image.Image = ImageLoader.DefaultRequestImage(u, this);
            }

            if (string.IsNullOrEmpty(speaker.ImageUrl))
            {
                image.Image = null;
            }
        }
예제 #4
0
        public void ShowTwitt(Twitt twitt)
        {
            _twitt = twitt;

            var image = ImageLoader.DefaultRequestImage(new Uri(_twitt.user.GetBigProfileImageUrl()), this);

            if (image != null)
            {
                _avatarCG = image.CGImage;
            }
            else
            {
                _avatarCG = UIImage.FromFile(ImagePathes.AvatarBig).CGImage;
            }


            CGImage imgWithMaskCG = _avatarCG.WithMask(_mask);

            _userMaskImageView.Image = new UIImage(imgWithMaskCG);


            _userNameLabel.Text = _twitt.user.name;
            _userNameLabel.SizeToFit();

            _viaLabel.Text = "via " + _twitt.source.Substring(_twitt.source.IndexOf('>') + 1, _twitt.source.LastIndexOf('<') - _twitt.source.IndexOf('>') - 1);
            _viaLabel.SizeToFit();

            //"<a href=\"http://www.retweet-xl.com/\" rel=\"nofollow\">أقوى رتويت</a>"

            _twittTextLabel.Text = _twitt.text;

            _twittDateLabel.Text = _twitt.GetDate();
            _twittDateLabel.SizeToFit();
        }
        void Update()
        {
            nameLabel.Text     = exhibitor.Name;
            addressLabel.Text  = exhibitor.City + ", " + exhibitor.Country;
            locationLabel.Text = exhibitor.Locations;

            if (!String.IsNullOrEmpty(exhibitor.Overview))
            {
                descriptionTextView.Text      = exhibitor.Overview;
                descriptionTextView.Font      = UIFont.FromName("Helvetica-Light", AppDelegate.Font10_5pt);
                descriptionTextView.TextColor = UIColor.Black;
            }
            else
            {
                descriptionTextView.Font      = UIFont.FromName("Helvetica-LightOblique", AppDelegate.Font10_5pt);
                descriptionTextView.TextColor = UIColor.Gray;
                descriptionTextView.Text      = "No background information available.";
            }
            if (exhibitor.ImageUrl != "http://www.mobileworldcongress.com")
            {
                // empty image shows this
                var u = new Uri(exhibitor.ImageUrl);
                image.Image = ImageLoader.DefaultRequestImage(u, this);
            }
        }
예제 #6
0
        public void SetTwitt(Twitt twitt)
        {
            _twitt         = twitt;
            TextLabel.Text = _twitt.user.name;

            DetailTextLabel.Text = _twitt.text;

            CGImage imageCG;
            var     image = ImageLoader.DefaultRequestImage(new Uri(_twitt.user.profile_image_url), this);

            if (image != null)
            {
                imageCG = image.CGImage;
            }
            else
            {
                imageCG = UIImage.FromFile(ImagePathes.Avatar).CGImage;
            }

            CGImage imgWithMaskCG = imageCG.WithMask(_mask);

            ImageView.Image = new UIImage(imgWithMaskCG);
            //ImageView.SizeToFit ();



            _timeLabel.Text = _twitt.GetAge();
            _timeLabel.SizeToFit();
        }
예제 #7
0
        void TrySetAvatar(bool force)
        {
            if (string.IsNullOrEmpty(photoUrl))
            {
                return;
            }

            UIImage img = ImageLoader.DefaultRequestImage(new Uri(photoUrl), this);

            if (img == null)
            {
                return;
            }

            if (force)
            {
                AvatarImg.Image = Theme.Current.ApplyEffects(img);
            }
            else
            {
                UIView.Transition(AvatarImg, 0.7, UIViewAnimationOptions.TransitionCrossDissolve, () => {
                    AvatarImg.Image = Theme.Current.ApplyEffects(img);
                }, null);
            }
        }
        public override UITableViewCell GetCell(UITableView tv)
        {
            var key  = GetKey((int)style);
            var cell = tv.DequeueReusableCell(key);

            if (cell == null)
            {
                cell = CreateTableViewCell(style, key);
                OnCellCreated(cell);
                cell.SelectionStyle = UITableViewCellSelectionStyle.Blue;
            }
            PrepareCell(cell);

            ClearBackground(cell);

            if (extraInfo != null)
            {
                if (extraInfo.BackgroundColor != null)
                {
                    cell.BackgroundColor           = extraInfo.BackgroundColor;
                    cell.TextLabel.BackgroundColor = UIColor.Clear;
                }
                else if (extraInfo.BackgroundUri != null)
                {
                    var img = ImageLoader.DefaultRequestImage(extraInfo.BackgroundUri, this);
                    cell.BackgroundColor           = img == null ? UIColor.White : UIColor.FromPatternImage(img);
                    cell.TextLabel.BackgroundColor = UIColor.Clear;
                }
            }

            return(cell);
        }
예제 #9
0
        void Update()
        {
            if (showSpeaker == null)
            {
                nameLabel.Text = "not found"; return;
            }

            nameLabel.Text    = showSpeaker.Name;
            titleLabel.Text   = showSpeaker.Title;
            companyLabel.Text = showSpeaker.Company;

            if (!String.IsNullOrEmpty(showSpeaker.Bio))
            {
                bioTextView.Text      = showSpeaker.Bio;
                bioTextView.Font      = UIFont.FromName("Helvetica-Light", AppDelegate.Font10_5pt);
                bioTextView.TextColor = UIColor.Black;
            }
            else
            {
                bioTextView.Font      = UIFont.FromName("Helvetica-LightOblique", AppDelegate.Font10_5pt);
                bioTextView.TextColor = UIColor.Gray;
                bioTextView.Text      = "No background information available.";
            }
            if (showSpeaker.ImageUrl != "http://www.mobileworldcongress.com")
            {
                var u = new Uri(showSpeaker.ImageUrl);
                image.Image = ImageLoader.DefaultRequestImage(u, this);
            }
        }
예제 #10
0
        public ProfileView(Uri uri)
            : base()
        {
            var size = new SizeF(32, 32);

            if (UIDevice.CurrentDevice.Orientation == UIDeviceOrientation.LandscapeLeft ||
                UIDevice.CurrentDevice.Orientation == UIDeviceOrientation.LandscapeRight)
            {
                size = new SizeF(24, 24);
            }

            this.Frame = new RectangleF(new PointF(4, 4), size);

            _imageView       = new UIImageView(new RectangleF(new PointF(0, 0), size));
            _imageView.Image = ImageLoader.DefaultRequestImage(uri, this);
            _imageView.Layer.MasksToBounds = true;
            _imageView.Layer.CornerRadius  = 4.0f;

            this.Layer.ShadowColor   = UIColor.Black.CGColor;
            this.Layer.ShadowOpacity = 0.4f;
            this.Layer.ShadowOffset  = new SizeF(0, 1);
            this.Layer.ShadowRadius  = 4.0f;

            this.AddSubview(_imageView);
        }
예제 #11
0
 public void UpdatedImage(System.Uri uri)
 {
     _header.Image = ImageLoader.DefaultRequestImage(uri, this);
     if (_header.Image != null)
     {
         _header.SetNeedsDisplay();
     }
 }
        protected void PrepareCell(UITableViewCell cell)
        {
            cell.Accessory = Accessory;
            var tl = cell.TextLabel;

            tl.Text          = Caption;
            tl.TextAlignment = Alignment;
            tl.TextColor     = TextColor ?? UIColor.Black;
            tl.Font          = Font ?? UIFont.BoldSystemFontOfSize(17);
            tl.LineBreakMode = LineBreakMode;
            tl.Lines         = Lines;

            // The check is needed because the cell might have been recycled.
            if (cell.DetailTextLabel != null)
            {
                cell.DetailTextLabel.Text = Value == null ? "" : Value;
            }

            if (extraInfo == null)
            {
                ClearBackground(cell);
            }
            else
            {
                var     imgView = cell.ImageView;
                UIImage img;

                if (imgView != null)
                {
                    if (extraInfo.Uri != null)
                    {
                        img = ImageLoader.DefaultRequestImage(extraInfo.Uri, this);
                    }
                    else if (extraInfo.Image != null)
                    {
                        img = extraInfo.Image;
                    }
                    else
                    {
                        img = null;
                    }
                    imgView.Image = img;
                }

                if (cell.DetailTextLabel != null)
                {
                    cell.DetailTextLabel.TextColor = extraInfo.DetailColor ?? UIColor.Gray;
                }
            }

            if (cell.DetailTextLabel != null)
            {
                cell.DetailTextLabel.Lines         = Lines;
                cell.DetailTextLabel.LineBreakMode = LineBreakMode;
                cell.DetailTextLabel.Font          = SubtitleFont ?? UIFont.SystemFontOfSize(14);
                cell.DetailTextLabel.TextColor     = (extraInfo == null || extraInfo.DetailColor == null) ? UIColor.Gray : extraInfo.DetailColor;
            }
        }
예제 #13
0
        public void UpdatedImage(Uri uri)
        {
            var cell = this.GetActiveCell() as ProfileTableViewCell;

            if (cell != null)
            {
                cell.ImageView.Image = ImageLoader.DefaultRequestImage(uri, this);
            }
        }
        public void UpdatedImage(Uri uri)
        {
            ConsoleD.WriteLine("UPDATED:" + uri.AbsoluteUri);
            var img = ImageLoader.DefaultRequestImage(uri, this);

            if (img != null)
            {
                image.Image = MWC.iOS.UI.CustomElements.TweetCell.RemoveSharpEdges(img);
            }
        }
예제 #15
0
        public void UpdatedImage(Uri uri)
        {
            if (uri.OriginalString == _twitt.user.profile_image_url)
            {
                var imageCG = ImageLoader.DefaultRequestImage(new Uri(_twitt.user.profile_image_url), this).CGImage;

                CGImage imgWithMaskCG = imageCG.WithMask(_mask);
                ImageView.Image = new UIImage(imgWithMaskCG);
            }
        }
예제 #16
0
        public void UpdatedImage(Uri uri)
        {
            var img        = ImageLoader.DefaultRequestImage(uri, this);
            var activeCell = GetActiveCell() as RepositoryCellView;

            if (activeCell != null && img != null)
            {
                activeCell.RepositoryImage = img;
            }
        }
예제 #17
0
        public void UpdatedImage(Uri uri)
        {
            ConsoleD.WriteLine("UPDATED:" + uri.AbsoluteUri);
            var img = ImageLoader.DefaultRequestImage(uri, this);

            if (img != null)
            {
                image.Image = RemoveSharpEdges(img);
            }
        }
예제 #18
0
        public void UpdateCell(BL.UserGroup showExhibitor)
        {
            usergroup      = showExhibitor;
            nameLabel.Text = usergroup.Name;


            var u = new Uri(usergroup.ImageUrl);

            logoImageView.Image = ImageLoader.DefaultRequestImage(u, this);
        }
예제 #19
0
 public void UpdatedImage(Uri uri)
 {
     if (uri.OriginalString == _twitt.user.GetBigProfileImageUrl())
     {
         var image = ImageLoader.DefaultRequestImage(new Uri(_twitt.user.GetBigProfileImageUrl()), this);
         _avatarCG = image.CGImage;
         CGImage imgWithMaskCG = _avatarCG.WithMask(_mask);
         _userMaskImageView.Image = new UIImage(imgWithMaskCG);
         //_userMaskImageView.SizeToFit ();
     }
 }
예제 #20
0
 public void UpdatedImage(Uri uri)
 {
     if (uri == this.uri)
     {
         imageView.Image = ImageLoader.DefaultRequestImage(uri, null);
     }
     else
     {
         Console.WriteLine("throw away " + uri);
     }
 }
예제 #21
0
        public override UITableViewCell GetCell(UITableView tv)
        {
            var cell = tv.DequeueReusableCell(RepositoryCellView.Key) as RepositoryCellView ?? RepositoryCellView.Create();

            if (_image == null && _imageUri != null)
            {
                _image = ImageLoader.DefaultRequestImage(_imageUri, this);
            }
            cell.Bind(_name, _followers.ToString(), _forks.ToString(), _description, ShowOwner ? _owner : null, _image);
            return(cell);
        }
예제 #22
0
        public ProfileViewController(string username)
        {
            Title     = username;
            ViewModel = new ProfileViewModel(username);

            ViewModel.Bind(x => x.User, () => {
                _header.Subtitle = string.IsNullOrEmpty(ViewModel.User.Name) ? ViewModel.User.Login : ViewModel.User.Name;
                _header.Image    = ImageLoader.DefaultRequestImage(new System.Uri(ViewModel.User.AvatarUrl), this);
                _header.SetNeedsDisplay();
            });
        }
예제 #23
0
        public void UpdateCell(BL.Exhibitor showExhibitor)
        {
            exhibitor               = showExhibitor;
            nameLabel.Text          = exhibitor.Name;
            cityCountryLabel.Text   = exhibitor.City + ", " + exhibitor.Country;
            boothLocationLabel.Text = exhibitor.Locations;

            var u = new Uri(exhibitor.ImageUrl);

            logoImageView.Image = ImageLoader.DefaultRequestImage(u, this);
        }
예제 #24
0
        void Update()
        {
            this.nameLabel.Text    = this.patient.Name.ToString();
            this.titleLabel.Text   = "PATIENT TITLE";
            this.companyLabel.Text = "PATIENT COMPANY?";

            this.bioTextView.TextColor = UIColor.Gray;
            this.bioTextView.Text      = "No background information available.";

            this.image.Image = ImageLoader.DefaultRequestImage(new Uri("https://en.gravatar.com/avatar/196d33ea9cdaf7817b98b981afe62c16?s=100"), this);
        }
        private void ConfigureBackgroundImage()
        {
            if (BackgroundColor == null)
            {
                if (BackgroundImage == null)
                {
                    if (Root != null)
                    {
                        if (Root.Theme.BackgroundUri != null)
                        {
                            var imageUri = Root.Theme.BackgroundUri;
                            BackgroundImage = ImageLoader.DefaultRequestImage(imageUri, null);
                        }

                        if (Root.Theme.BackgroundColor != null)
                        {
                            BackgroundColor = Root.Theme.BackgroundColor;
                        }

                        if (Root.Theme.BackgroundImage != null)
                        {
                            BackgroundImage = Root.Theme.BackgroundImage;
                        }
                    }
                }

                if (BackgroundImage != null)
                {
                    BackgroundColor = UIColor.FromPatternImage(BackgroundImage);
                }
            }

            if (BackgroundColor != null)
            {
                if (TableView.RespondsToSelector(new Selector("backgroundView")))
                {
                    //if (TableView.BackgroundView == null)
                    TableView.BackgroundView = new UIView();

                    TableView.BackgroundView.Opaque = false;
                    TableView.BackgroundColor       = UIColor.Clear;
                }

                if (ParentViewController != null && !IsModal)
                {
                    TableView.BackgroundColor = UIColor.Clear;
                    ParentViewController.View.BackgroundColor = BackgroundColor;
                }
                else
                {
                    TableView.BackgroundColor = BackgroundColor;
                }
            }
        }
        public OrganizationViewController(string name)
        {
            Title     = name;
            Name      = name;
            ViewModel = new OrganizationViewModel(name);

            ViewModel.Bind(x => x.Organization, model => {
                _header.Subtitle = string.IsNullOrEmpty(model.Name) ? model.Login : model.Name;
                _header.Image    = ImageLoader.DefaultRequestImage(new System.Uri(model.AvatarUrl), this);
                _header.SetNeedsDisplay();
            });
        }
예제 #27
0
        public void UpdatedImage(Uri uri)
        {
            var img = ImageLoader.DefaultRequestImage(uri, this);

            if (img == null)
            {
                return;
            }

            _imageView.Image = img;
            _imageView.SetNeedsDisplay();
        }
예제 #28
0
        public override UITableViewCell GetCell(UITableView tv)
        {
            if (ImageUri != null)
            {
                var img = ImageLoader.DefaultRequestImage(ImageUri, this);
                if (img != null)
                {
                    Image = img;
                }
            }

            return(base.GetCell(tv));
        }
예제 #29
0
        public void UpdateUI()
        {
            if (!string.IsNullOrEmpty(imageUrl))
            {
                var image = ImageLoader.DefaultRequestImage(Constants.GetImageUrl(imageUrl), this);
                _imageView.Image = image;
            }

            _titleLabel.Text = title;
            if (!string.IsNullOrEmpty(description))
            {
                _detailsLabel.Text = description;
            }
        }
예제 #30
0
        public void UpdatedImage(Uri uri)
        {
            var img = ImageLoader.DefaultRequestImage(uri, this);

            if (img != null)
            {
                var cell = GetActiveCell() as ShowcaseTableViewCell;
                if (cell != null)
                {
                    cell.Image = img;
                    cell.SetNeedsDisplay();
                }
            }
        }