示例#1
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();
            }
示例#2
0
            void IImageUpdated.UpdatedImage(long onId)
            {
                // Discard notifications that might have been queued for an old cell
                if (tweet == null || (tweet.UserId != onId && tweet.RetweeterId != onId))
                {
                    return;
                }

                // Discard the url string once the image is loaded, we wont be using it.
                if (onId == tweet.UserId)
                {
                    tweetImage   = ImageStore.GetLocalProfilePicture(onId);
                    tweet.PicUrl = null;
                }
                else
                {
                    retweetImage          = ImageStore.GetLocalProfilePicture(onId);
                    tweet.RetweeterPicUrl = null;
                }
                SetNeedsDisplay();
            }
示例#3
0
        public void Layout()
        {
            List <string> pending, request;
            int           loaders, reqcount;

            ImageStore.GetStatus(out pending, out request, out loaders, out reqcount);
            cpending.Text = String.Format("Pending={0} req={1} loaders={2} tick={3}", pending.Count, reqcount, loaders, updates++);
            var r = Bounds;

            r.Y += 20;
            var s = "";

            foreach (var p in pending)
            {
                s += p + "\n";
            }
            var ss = StringSize(s, f, new SizeF(r.Width, 120), UILineBreakMode.WordWrap);

            r.Height    = ss.Height;
            plist.Frame = r;
            plist.Text  = s;

            r.Y           += r.Height;
            r.Height       = 18;
            crequest.Frame = r;

            r.Y = r.Bottom;
            s   = "";
            foreach (var re in request)
            {
                s += re + " ";
            }
            ss             = StringSize(s, f, new SizeF(r.Width, 120), UILineBreakMode.WordWrap);
            r.Height       = ss.Height;
            prequest.Frame = r;
            prequest.Text  = s;
        }
 public void UpdatedImage(long id)
 {
     image = ImageStore.GetLocalProfilePicture(id);
     SetNeedsDisplay();
 }
示例#5
0
 public override void DidEnterBackground(UIApplication application)
 {
     // releases all of our chubby images in the cache.
     ImageStore.Purge();
 }
示例#6
0
 public override void DidReceiveMemoryWarning()
 {
     base.DidReceiveMemoryWarning();
     ImageStore.Purge();
 }
示例#7
0
 public void UpdatedImage(long id)
 {
     profilePic.Image = ImageStore.GetLocalProfilePicture(id);
 }