Esempio n. 1
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            var view = (convertView ?? myActivity.LayoutInflater.Inflate(
                Resource.Layout.tweet_display, parent, false))
                as LinearLayout;
            var ivProfile = view.FindViewById (Resource.Id.ivProfile) as ImageView;
            var tvName = view.FindViewById (Resource.Id.tvName) as TextView;
            var tvScreenName = view.FindViewById (Resource.Id.tvScreenName) as TextView;
            var tvTweet = view.FindViewById (Resource.Id.tvTweet) as TextView;
            var tvDate = view.FindViewById (Resource.Id.tvDate) as TextView;

            var tweet = Items [position];
            var tDate = new Date (tweet.StatusDate);

            myActivity.RunOnUiThread (() => ivProfile.SetImageBitmap (tweet.ProfileImage));
            myActivity.RunOnUiThread (() => tvScreenName.Text = "@"+tweet.ScreenName);
            myActivity.RunOnUiThread (() => tvName.Text = tweet.UserName);
            myActivity.RunOnUiThread (() => tvTweet.Text = tweet.StatusText);
            myActivity.RunOnUiThread (() => tvDate.Text = tDate.ToLocaleString ());

            return view;
        }