Java Code Examples for com.astuetz.PagerSlidingTabStrip#setVisibility()

The following examples show how to use com.astuetz.PagerSlidingTabStrip#setVisibility() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MovieLibraryOverviewFragment.java    From Mizuu with Apache License 2.0 6 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.viewpager_with_tabs, container, false);

    if (MizLib.hasLollipop())
        ((ActionBarActivity) getActivity()).getSupportActionBar().setElevation(0);

    mViewPager = (ViewPager) v.findViewById(R.id.awesomepager);
    mViewPager.setPageMargin(MizLib.convertDpToPixels(getActivity(), 16));

    mTabs = (PagerSlidingTabStrip) v.findViewById(R.id.tabs);

    mViewPager.setAdapter(new PagerAdapter(getChildFragmentManager()));
    mTabs.setViewPager(mViewPager);
    mTabs.setVisibility(View.VISIBLE);

    // Work-around a bug that sometimes happens with the tabs
    mViewPager.setCurrentItem(0);

    if (MizLib.hasLollipop())
        mTabs.setElevation(1f);

    return v;
}
 
Example 2
Source File: TvShowLibraryOverviewFragment.java    From Mizuu with Apache License 2.0 6 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.viewpager_with_tabs, container, false);

    if (MizLib.hasLollipop())
        ((ActionBarActivity) getActivity()).getSupportActionBar().setElevation(0);

    mViewPager = (ViewPager) v.findViewById(R.id.awesomepager);
    mViewPager.setPageMargin(MizLib.convertDpToPixels(getActivity(), 16));

    mTabs = (PagerSlidingTabStrip) v.findViewById(R.id.tabs);

    mViewPager.setAdapter(new PagerAdapter(getChildFragmentManager()));
    mTabs.setViewPager(mViewPager);
    mTabs.setVisibility(View.VISIBLE);

    // Work-around a bug that sometimes happens with the tabs
    mViewPager.setCurrentItem(0);

    if (MizLib.hasLollipop())
        mTabs.setElevation(1f);

    return v;
}
 
Example 3
Source File: MovieCoverFanartBrowser.java    From Mizuu with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);

	MizuuApplication.setupTheme(this);

       if (MizLib.hasLollipop())
           getSupportActionBar().setElevation(0);

       mTmdbId = getIntent().getExtras().getString("tmdbId");
       mCollectionId = getIntent().getExtras().getString("collectionId");
       mToolbarColor = getIntent().getExtras().getInt(IntentKeys.TOOLBAR_COLOR);
	mTmdbApiKey = MizLib.getTmdbApiKey(this);

       mProgressBar = (ProgressBar) findViewById(R.id.progressbar);
       mProgressBar.setVisibility(View.VISIBLE);

       mViewPager = (ViewPager) findViewById(R.id.awesomepager);
       mViewPager.setOffscreenPageLimit(2);
       mViewPager.setPageMargin(MizLib.convertDpToPixels(this, 16));

       mTabs = (PagerSlidingTabStrip) findViewById(R.id.tabs);
       mTabs.setVisibility(View.GONE);

	if (savedInstanceState != null) {
           mJson = savedInstanceState.getString("json", "");
           mBaseUrl = savedInstanceState.getString("baseUrl");
           mCollection = savedInstanceState.getString("collection");
		setupActionBarStuff();

           mViewPager.setCurrentItem(savedInstanceState.getInt("tab", 0));
	} else {
		new MovieLoader(getApplicationContext()).execute(mTmdbId, mCollectionId);
	}
}
 
Example 4
Source File: ShowCoverFanartBrowser.java    From Mizuu with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);

       MizuuApplication.setupTheme(this);

       if (MizLib.hasLollipop())
           getSupportActionBar().setElevation(0);
       getSupportActionBar().setDisplayHomeAsUpEnabled(true);

	tvdbId = getIntent().getExtras().getString("id");
       mToolbarColor = getIntent().getExtras().getInt(IntentKeys.TOOLBAR_COLOR);

       mProgressBar = (ProgressBar) findViewById(R.id.progressbar);
       mProgressBar.setVisibility(View.VISIBLE);

       mViewPager = (ViewPager) findViewById(R.id.awesomepager);
       mViewPager.setOffscreenPageLimit(2);
       mViewPager.setPageMargin(MizLib.convertDpToPixels(this, 16));

       mTabs = (PagerSlidingTabStrip) findViewById(R.id.tabs);
       mTabs.setVisibility(View.GONE);

       setupActionBarStuff();

	if (savedInstanceState != null) {
           mViewPager.setCurrentItem(savedInstanceState.getInt("tab", 0));
	}
}