Search in sources :

Example 1 with FragmentAdapter

use of com.lapism.searchview.sample.view.FragmentAdapter in project SearchView by lapism.

the class BaseActivity method setViewPager.

protected void setViewPager() {
    FragmentAdapter adapter = new FragmentAdapter(getSupportFragmentManager());
    adapter.addFragment(new SearchFragment(), getString(R.string.installed));
    adapter.addFragment(new SearchFragment(), getString(R.string.all));
    ViewPager viewPager = (ViewPager) findViewById(R.id.viewPager);
    viewPager.setAdapter(adapter);
    TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
    tabLayout.setupWithViewPager(viewPager);
}
Also used : TabLayout(android.support.design.widget.TabLayout) SearchFragment(com.lapism.searchview.sample.view.SearchFragment) ViewPager(android.support.v4.view.ViewPager) FragmentAdapter(com.lapism.searchview.sample.view.FragmentAdapter)

Aggregations

TabLayout (android.support.design.widget.TabLayout)1 ViewPager (android.support.v4.view.ViewPager)1 FragmentAdapter (com.lapism.searchview.sample.view.FragmentAdapter)1 SearchFragment (com.lapism.searchview.sample.view.SearchFragment)1