예제 #1
0
        public override float GetHeightForRow(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
        {
            RSSItem rssItem = RSSItemList[indexPath.Row];

            float textHeight = HeightOfText(CodeProjectRssFeedViewModel.StripHTML(rssItem.Description), 267);

            float height = RoundValueToNearestMultiple(textHeight, 18.5f) + 50;

            return(height);
        }
예제 #2
0
        public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
        {
            var     cell    = tableView.DequeueReusableCell("RSSItemCell");
            RSSItem rssItem = RSSItemList[indexPath.Row];

            (cell.ViewWithTag(titleTag) as UILabel).Text       = rssItem.Title;
            (cell.ViewWithTag(authorTag) as UILabel).Text      = rssItem.Author;
            (cell.ViewWithTag(descriptionTag) as UILabel).Text = CodeProjectRssFeedViewModel.StripHTML(rssItem.Description);

            return(cell);
        }
        public override Android.Views.View GetView(int position, Android.Views.View convertView, Android.Views.ViewGroup parent)
        {
            var view = convertView ?? activity.LayoutInflater.Inflate(
                Resource.Layout.CodeProjectRssFeedItem, parent, false);
            var rssItemTitle       = view.FindViewById <TextView> (Resource.Id.textViewRssItemTitle);
            var rssItemAuthor      = view.FindViewById <TextView> (Resource.Id.textViewRssItemAuthor);
            var rssItemDescription = view.FindViewById <TextView> (Resource.Id.textViewRssItemDescription);

            rssItemTitle.Text       = rssItemList[position].Title;
            rssItemAuthor.Text      = rssItemList[position].Author;
            rssItemDescription.Text = CodeProjectRssFeedViewModel.StripHTML(rssItemList[position].Description);

            return(view);
        }
예제 #4
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            view = inflater.Inflate(Resource.Layout.CodeProjectRssFeedLayout, null);

            textView            = view.FindViewById <TextView>(Resource.Id.textViewFeedName);
            listView            = view.FindViewById <ListView> (Resource.Id.listViewFeed);
            listView.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) =>
            {
                var item = viewModel.ItemFeed[e.Position];

                Intent browserIntent = new Intent(Intent.ActionView, Android.Net.Uri.Parse(item.Link));
                StartActivity(browserIntent);
            };

            viewModel             = new CodeProjectRssFeedViewModel();
            viewModel.FeedLoaded += this.FeedLoaded;


            viewModel.ItemFeed = GetFeed();

            LoadFeed();

            return(view);
        }
예제 #5
0
 public CodeProjectRSSFeedViewController(IntPtr handle) : base(handle)
 {
     viewModel             = new CodeProjectRssFeedViewModel();
     viewModel.FeedLoaded += this.FeedLoaded;
 }