private void SetUpViewPager(ViewPager viewPager) { try { PlayListFragment = new ChPlayListFragment(); VideosFragment = new ChVideosFragment(); ChAboutFragment aboutFragment = new ChAboutFragment(); ActivitiesFragment = new ChActivitiesFragment(); Bundle bundle = new Bundle(); bundle.PutString("ChannelId", UserDetails.UserId); PlayListFragment.Arguments = bundle; VideosFragment.Arguments = bundle; ActivitiesFragment.Arguments = bundle; aboutFragment.Arguments = bundle; MainTabAdapter adapter = new MainTabAdapter(Activity.SupportFragmentManager); adapter.AddFragment(VideosFragment, GetText(Resource.String.Lbl_Videos)); adapter.AddFragment(PlayListFragment, GetText(Resource.String.Lbl_PlayLists)); adapter.AddFragment(ActivitiesFragment, GetText(Resource.String.Lbl_Activities)); adapter.AddFragment(aboutFragment, GetText(Resource.String.Lbl_AboutChannal)); viewPager.PageSelected += ViewPagerOnPageSelected; viewPager.Adapter = adapter; } catch (Exception exception) { Console.WriteLine(exception); } }
private void SetUpViewPager(ViewPager viewPager) { try { PlayListFragment = new ChPlayListFragment(); VideosFragment = new ChVideosFragment(); ChAboutFragment aboutFragment = new ChAboutFragment(); ActivitiesFragment = new ChActivitiesFragment(); UserSettingsFragment settingsFragment = new UserSettingsFragment(AdminVideoEnum.UserSettings); latestResponse = new UserSettingsFragment(AdminVideoEnum.LatestResponse); Bundle bundle = new Bundle(); bundle.PutString("ChannelId", UserDetails.UserId); PlayListFragment.Arguments = bundle; VideosFragment.Arguments = bundle; ActivitiesFragment.Arguments = bundle; aboutFragment.Arguments = bundle; MainTabAdapter adapter = new MainTabAdapter(Activity.SupportFragmentManager); adapter.AddFragment(VideosFragment, GetText(Resource.String.Lbl_Videos)); adapter.AddFragment(PlayListFragment, GetText(Resource.String.Lbl_PlayLists)); adapter.AddFragment(ActivitiesFragment, GetText(Resource.String.Lbl_Activities)); adapter.AddFragment(aboutFragment, GetText(Resource.String.Lbl_AboutChannal)); adapter.AddFragment(settingsFragment, "User Settings"); if (UnSeenReponse > 0) { adapter.AddFragment(latestResponse, "Latest Response " + "(" + UnSeenReponse + ")"); } else { adapter.AddFragment(latestResponse, "Latest Response"); } viewPager.PageSelected += ViewPagerOnPageSelected; viewPager.Adapter = adapter; } catch (Exception exception) { Console.WriteLine(exception); } }