void InitDetailInfo() { SetContentView (Resource.Layout.DetailInfo); ImageView imageView = FindViewById<ImageView> (Resource.Id.ivPoster); if (_cart.Poster != null) { Bitmap bm = BitmapFactory.DecodeByteArray (_cart.Poster.Data, 0, _cart.Poster.Data.Length); imageView.SetImageBitmap (bm); } else { imageView.Visibility = ViewStates.Gone; } List<DetailInfoEntry> entries = new List<DetailInfoEntry>(); if (!String.IsNullOrEmpty(_cart.AuthorName)) entries.Add (new DetailInfoEntry(GetString (Resource.String.detail_author_name),_cart.AuthorName)); if (!String.IsNullOrEmpty(_cart.AuthorCompany)) entries.Add (new DetailInfoEntry(GetString (Resource.String.detail_author_company),_cart.AuthorCompany)); if (_cart.CreateDate != null) entries.Add (new DetailInfoEntry(GetString (Resource.String.detail_created),_cart.CreateDate.ToString ())); if (!String.IsNullOrEmpty(_cart.Version)) entries.Add (new DetailInfoEntry(GetString (Resource.String.detail_version),_cart.Version)); if (_cart.UniqueDownloads != 0) entries.Add (new DetailInfoEntry(GetString (Resource.String.detail_unique_downloads),_cart.Version)); if (!String.IsNullOrEmpty(_cart.ShortDescription)) entries.Add (new DetailInfoEntry(GetString (Resource.String.detail_short_description),_cart.ShortDescription)); // Start point and description string text = GetString (Resource.String.detail_starting_location); string description; if (_cart.StartingLocationLatitude == 360.0 && _cart.StartingLocationLongitude == 360.0) description = GetString (Resource.String.detail_starting_play_anywhare); else description = Location.Converters.CoordinatToString(_cart.StartingLocationLatitude, _cart.StartingLocationLongitude, WF.Player.Location.GPSFormat.DecimalMinutes, true); description += System.Environment.NewLine; description += _cart.StartingDescription; entries.Add (new DetailInfoEntry(text, description)); ListView listView = FindViewById<ListView> (Resource.Id.listView); DetailInfoAdapter adapter = new DetailInfoAdapter(this, entries); if (entries.Count == 0 && _cart.Poster == null) { LinearLayout ll = FindViewById<LinearLayout> (Resource.Id.layoutDetailInfo); ll.RemoveAllViews(); TextView tv = new TextView(this); tv.Text = Catalog.GetString("No info availible"); ll.AddView(tv); } else listView.Adapter = adapter; }
void InitDetailInfo() { SetContentView(Resource.Layout.DetailInfo); ImageView imageView = FindViewById <ImageView> (Resource.Id.ivPoster); if (_cart.Poster != null) { Bitmap bm = BitmapFactory.DecodeByteArray(_cart.Poster.Data, 0, _cart.Poster.Data.Length); imageView.SetImageBitmap(bm); } else { imageView.Visibility = ViewStates.Gone; } List <DetailInfoEntry> entries = new List <DetailInfoEntry>(); if (!String.IsNullOrEmpty(_cart.AuthorName)) { entries.Add(new DetailInfoEntry(GetString(Resource.String.detail_author_name), _cart.AuthorName)); } if (!String.IsNullOrEmpty(_cart.AuthorCompany)) { entries.Add(new DetailInfoEntry(GetString(Resource.String.detail_author_company), _cart.AuthorCompany)); } if (_cart.CreateDate != null) { entries.Add(new DetailInfoEntry(GetString(Resource.String.detail_created), _cart.CreateDate.ToString())); } if (!String.IsNullOrEmpty(_cart.Version)) { entries.Add(new DetailInfoEntry(GetString(Resource.String.detail_version), _cart.Version)); } if (_cart.UniqueDownloads != 0) { entries.Add(new DetailInfoEntry(GetString(Resource.String.detail_unique_downloads), _cart.Version)); } if (!String.IsNullOrEmpty(_cart.ShortDescription)) { entries.Add(new DetailInfoEntry(GetString(Resource.String.detail_short_description), _cart.ShortDescription)); } // Start point and description string text = GetString(Resource.String.detail_starting_location); string description; if (_cart.StartingLocationLatitude == 360.0 && _cart.StartingLocationLongitude == 360.0) { description = GetString(Resource.String.detail_starting_play_anywhare); } else { description = Location.Converters.CoordinatToString(_cart.StartingLocationLatitude, _cart.StartingLocationLongitude, WF.Player.Location.GPSFormat.DecimalMinutes, true); } description += System.Environment.NewLine; description += _cart.StartingDescription; entries.Add(new DetailInfoEntry(text, description)); ListView listView = FindViewById <ListView> (Resource.Id.listView); DetailInfoAdapter adapter = new DetailInfoAdapter(this, entries); if (entries.Count == 0 && _cart.Poster == null) { LinearLayout ll = FindViewById <LinearLayout> (Resource.Id.layoutDetailInfo); ll.RemoveAllViews(); TextView tv = new TextView(this); tv.Text = Catalog.GetString("No info availible"); ll.AddView(tv); } else { listView.Adapter = adapter; } }