protected override void OnCreate(Bundle bundle) { //SetTheme(Resource.Style.Theme_Sherlock_Light); SetTheme(Resource.Style.Theme_Example); base.OnCreate(bundle); RequestWindowFeature(WindowFeatures.IndeterminateProgress); SetSupportProgressBarIndeterminateVisibility(false); Sherlock.ActionBar.SetDisplayHomeAsUpEnabled(true); SetContentView(Resource.Layout.Main); // Show tabs ActionBar.NavigationMode = ActionBarNavigationMode.Tabs; // attach adapter to the viewpager _pageAdapter = new ArtistPagerAdapter(SupportFragmentManager); _viewPager = FindViewById<ViewPager>(Resource.Id.myViewPager); _viewPager.Adapter = _pageAdapter; _viewPager.SetOnPageChangeListener(this); // startindex _viewPager.SetCurrentItem(0, true); var jsonArtist = Intent.GetStringExtra("Artist"); _artist = JsonConvert.DeserializeObject<Artist>(jsonArtist); var jsonTopTracks = Intent.GetStringExtra("TopTracks"); _topTracks = JsonConvert.DeserializeObject<TopTracks>(jsonTopTracks); var jsonTopAlbums = Intent.GetStringExtra("TopAlbums"); _topAlbums = JsonConvert.DeserializeObject<TopAlbums>(jsonTopAlbums); _bitmapExtension = new BitmapExtension(); try { _imageBitmap = _bitmapExtension.GetImageBitmapFromUrl(_artist.GetImageUrlOfSize("large")); } catch (Exception ex) { Toast.MakeText(this, "Error: " + ex.Message, ToastLength.Short).Show(); } //TABS var tab1 = Sherlock.ActionBar.NewTab(); tab1.SetText("Artist"); tab1.SetTabListener(this); var tab2 = Sherlock.ActionBar.NewTab(); tab2.SetText("Similar Artists"); tab2.SetTabListener(this); var tab3 = Sherlock.ActionBar.NewTab(); tab3.SetText("Top 15 Tracks"); tab3.SetTabListener(this); var tab4 = Sherlock.ActionBar.NewTab(); tab4.SetText("Top 5 Albums"); tab4.SetTabListener(this); Sherlock.ActionBar.AddTab(tab1); Sherlock.ActionBar.AddTab(tab2); Sherlock.ActionBar.AddTab(tab3); Sherlock.ActionBar.AddTab(tab4); }
public override void OnActivityCreated(Bundle savedInstanceState) { base.OnActivityCreated(savedInstanceState); var artistActivity = (ArtistActivity)this.Activity; _artist = artistActivity.GetArtist(); _imageBitmap = artistActivity.GetArtistBitmap(); SetTextLabels(); _view.FindViewById<ImageView>(Resource.Id.imageArtist).SetImageBitmap(_imageBitmap); _view.FindViewById<TextView>(Resource.Id.textName).Text = _artist.Name; _view.FindViewById<TextView>(Resource.Id.textSummary).Text = _artist.Bio.Summary; _view.FindViewById<TextView>(Resource.Id.textYearFormed).Text = _artist.Bio.YearFormed.ToString(); _view.FindViewById<TextView>(Resource.Id.textUrl).Text = _artist.Url; _view.FindViewById<TextView>(Resource.Id.textPublished).Text = _artist.Bio.Published.ToShortDateString(); }