use of me.dkzwm.widget.srl.sample.ui.fragment.NestedPageWithSrlFragment in project SmoothRefreshLayout by dkzwm.
the class TestNestedViewPagerActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_with_nested_viewpager);
final Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
toolbar.setNavigationIcon(R.drawable.arrow_back_white_72x72);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
ViewPager viewPager = findViewById(R.id.viewPager_with_nested_pager);
List<NestedPageWithSrlFragment> fragments = new ArrayList<>();
for (int color : sColors) {
fragments.add(NestedPageWithSrlFragment.newInstance(color));
}
ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager(), fragments);
viewPager.setAdapter(adapter);
}
Aggregations