protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.NewsDetailsScreen); var id = Intent.GetIntExtra("NewsID", -1); if (id >= 0) { newsItem = BL.Managers.NewsManager.Get(id); if (newsItem != null) { FindViewById<TextView>(Resource.Id.TitleTextView).Visibility = global::Android.Views.ViewStates.Gone; FindViewById<WebView>(Resource.Id.ContentWebView).LoadDataWithBaseURL(null, "<html><body>" + newsItem.Content + "</body></html>", @"text/html", "utf-8", null); // ugh - LoadData() method has problems when html contains a % SO USE LoadDataWithBaseURL instead even though we don't have a BaseURL // http://code.google.com/p/android/issues/detail?id=1733 // http://code.google.com/p/android/issues/detail?id=4401 } else { // shouldn't happen... var text = FindViewById<TextView>(Resource.Id.TitleTextView); text.Text = "NewsItem not found: " + id; text.Visibility = global::Android.Views.ViewStates.Visible; } } }
public void Update (RSSEntry item) { ID = item.ID; Url = item.Url; Title = item.Title; Published = item.Published; Content = item.Content; }
public void Update (RSSEntry item) { if (item == null) throw new MvxException("News item missing!"); // this is not really an MvxException.... ID = item.ID; Url = item.Url; Title = item.Title; Published = item.Published; Content = item.Content; }
/// <summary> /// for iPad (SplitViewController) /// </summary> public NewsElement (RSSEntry showEntry, UIImage showImage, MWC.iOS.Screens.iPad.News.NewsSplitView newsSplitView) : base (showEntry.Title) { entry = showEntry; image = showImage; splitView = newsSplitView; // could be null, in current implementation }
public NewsElement (RSSEntry showEntry, UIImage showImage) : base (showEntry.Title) { entry = showEntry; image = showImage; }
public void Update (RSSEntry entry) { this.LoadHtmlString(FormatText()); }
public NewsDetailsScreen (RSSEntry entry) : base() { newsEntry = entry; View.BackgroundColor = UIColor.White; webView.BackgroundColor = UIColor.White; }
public NewsItemViewModel (RSSEntry item) : this () { Update (item); }