void SetupImagePreview(DialogViewController parent, float y, string picUrl, string thumbUrl, string previewUrl)
        {
            var rect = new RectangleF(0, y, 78, 78);

            var imageButton = new UIButton(rect)
            {
                BackgroundColor = UIColor.Clear
            };

            imageButton.TouchUpInside += delegate {
                string html = "<html><body style='background-color:black'><div style='text-align:center; width: 320px; height: 480px;'><img src='{0}'/></div></body></html>";
                WebViewController.OpenHtmlString(parent, String.Format(html, previewUrl), new NSUrl(picUrl).BaseUrl);
            };
            AddSubview(imageButton);
            ImageStore.QueueRequestForPicture(serial++, thumbUrl, this);
        }
Example #2
0
            public void Update(Tweet tweet)
            {
                this.tweet = tweet;
                userText   = tweet.Retweeter == null ? tweet.Screename : tweet.Screename + "→" + tweet.Retweeter;

                //
                // For fake UserIDs (returned by the search), we try looking up by screename now
                //
                var img = ImageStore.GetLocalProfilePicture(tweet.UserId);

                if (img == null)
                {
                    img = ImageStore.GetLocalProfilePicture(tweet.Screename);
                }
                if (img == null)
                {
                    ImageStore.QueueRequestForPicture(tweet.UserId, tweet.PicUrl, this);
                }
                else
                {
                    tweet.PicUrl = null;
                }
                tweetImage = img == null ? ImageStore.DefaultImage : img;
                if (tweet.Retweeter == null)
                {
                    retweetImage = null;
                }
                else
                {
                    img = ImageStore.GetLocalProfilePicture(tweet.RetweeterId);
                    if (img == null)
                    {
                        ImageStore.QueueRequestForPicture(tweet.RetweeterId, tweet.RetweeterPicUrl, this);
                    }
                    else
                    {
                        tweet.RetweeterPicUrl = null;
                    }

                    retweetImage = img == null ? ImageStore.DefaultImage : img;
                }

                SetNeedsDisplay();
            }