public static Fragment NewInstance(Channel item) { instance = new ChannelDetails { Arguments = new Bundle() }; instance.item = item; return(instance); }
public override void OnDestroyView() { if (!MainActivity.instance.Paused) { Activity.FindViewById(Resource.Id.playlistButtons).Visibility = ViewStates.Visible; Activity.FindViewById <RelativeLayout>(Resource.Id.playlistHeader).Visibility = ViewStates.Gone; MainActivity.instance.HideFilter(); MainActivity.instance.SupportActionBar.SetHomeButtonEnabled(false); MainActivity.instance.SupportActionBar.SetDisplayHomeAsUpEnabled(false); MainActivity.instance.SupportActionBar.SetDisplayShowTitleEnabled(false); if (MainActivity.instance.FindViewById(Resource.Id.toolbarLogo) != null) { MainActivity.instance.FindViewById(Resource.Id.toolbarLogo).Visibility = ViewStates.Visible; } MainActivity.instance.contentRefresh.Refresh -= OnRefresh; Activity.FindViewById <AppBarLayout>(Resource.Id.appbar).RemoveOnOffsetChangedListener(this); } instance = null; base.OnDestroyView(); }
public override void OnResume() { base.OnResume(); instance = this; }
private void ListView_ItemClick(object sender, int position) { switch (result[position].Kind) { case YtKind.Video: YoutubeManager.Play(result[position].song); break; case YtKind.Playlist: MainActivity.instance.menu.FindItem(Resource.Id.search).ActionView.Focusable = false; MainActivity.instance.menu.FindItem(Resource.Id.search).CollapseActionView(); MainActivity.instance.menu.FindItem(Resource.Id.search).ActionView.Focusable = true; MainActivity.instance.FindViewById <TabLayout>(Resource.Id.tabs).Visibility = ViewStates.Gone; MainActivity.instance.SupportFragmentManager.BeginTransaction().Replace(Resource.Id.contentView, PlaylistTracks.NewInstance(result[position].playlist)).AddToBackStack("Playlist Track").Commit(); break; case YtKind.Channel: MainActivity.instance.menu.FindItem(Resource.Id.search).ActionView.Focusable = false; MainActivity.instance.menu.FindItem(Resource.Id.search).CollapseActionView(); MainActivity.instance.menu.FindItem(Resource.Id.search).ActionView.Focusable = true; MainActivity.instance.FindViewById <TabLayout>(Resource.Id.tabs).Visibility = ViewStates.Gone; MainActivity.instance.SupportFragmentManager.BeginTransaction().Replace(Resource.Id.contentView, ChannelDetails.NewInstance(result[position].channel)).AddToBackStack("Channel Details").Commit(); break; default: break; } }