Esempio n. 1
0
        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;
                }
            }
        }
Esempio n. 2
0
 public void Update (RSSEntry item)
 {
     ID = item.ID;
     Url = item.Url;
     Title = item.Title;
     Published = item.Published;
     Content = item.Content;
 }
Esempio n. 3
0
 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;
 }
Esempio n. 4
0
		/// <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
		}
Esempio n. 5
0
		public NewsElement (RSSEntry showEntry, UIImage showImage) : base (showEntry.Title)
		{
			entry = showEntry;
			image = showImage;
		}
Esempio n. 6
0
		public void Update (RSSEntry entry)
		{
			this.LoadHtmlString(FormatText());
		}
Esempio n. 7
0
		public NewsDetailsScreen (RSSEntry entry) : base()
		{
			newsEntry = entry;
			View.BackgroundColor = UIColor.White;
			webView.BackgroundColor = UIColor.White;
		}
Esempio n. 8
0
 public NewsItemViewModel (RSSEntry item)
     : this ()
 {
     Update (item);
 }