Search in sources :

Example 1 with VideoDetailPagerAdapter

use of com.zype.android.ui.video_details.VideoDetailPagerAdapter in project zype-android by zype.

the class VideoDetailActivity method showSections.

private void showSections(String videoId) {
    pagerSections = findViewById(R.id.pagerSections);
    tabs = findViewById(R.id.tabs);
    layoutSummary = findViewById(R.id.layoutSummary);
    if (hasOptions(videoId)) {
        pagerSections.setAdapter(new VideoDetailPagerAdapter(this, getSupportFragmentManager(), videoId));
        tabs.setupWithViewPager(pagerSections);
        pagerSections.setVisibility(View.VISIBLE);
        tabs.setVisibility(View.VISIBLE);
        layoutSummary.setVisibility(GONE);
    } else {
        pagerSections.setVisibility(GONE);
        tabs.setVisibility(GONE);
        layoutSummary.setVisibility(View.VISIBLE);
        FragmentManager fm = getSupportFragmentManager();
        Fragment fragment = SummaryFragment.newInstance();
        fm.beginTransaction().replace(R.id.layoutSummary, fragment, SummaryFragment.TAG).commit();
    }
}
Also used : FragmentManager(androidx.fragment.app.FragmentManager) VideoDetailPagerAdapter(com.zype.android.ui.video_details.VideoDetailPagerAdapter) Fragment(androidx.fragment.app.Fragment) ThumbnailFragment(com.zype.android.ui.player.ThumbnailFragment) SummaryFragment(com.zype.android.ui.video_details.fragments.summary.SummaryFragment) PlayerFragment(com.zype.android.ui.player.v2.PlayerFragment)

Aggregations

Fragment (androidx.fragment.app.Fragment)1 FragmentManager (androidx.fragment.app.FragmentManager)1 ThumbnailFragment (com.zype.android.ui.player.ThumbnailFragment)1 PlayerFragment (com.zype.android.ui.player.v2.PlayerFragment)1 VideoDetailPagerAdapter (com.zype.android.ui.video_details.VideoDetailPagerAdapter)1 SummaryFragment (com.zype.android.ui.video_details.fragments.summary.SummaryFragment)1