use of com.alexvasilkov.gestures.sample.adapters.PhotoPagerAdapter in project GestureViews by alexvasilkov.
the class Ex6AdvancedDemoActivity method initPager.
private void initPager() {
// Setting up pager views
pagerAdapter = new PhotoPagerAdapter(views.pager);
pagerAdapter.setSetupListener(settingsMenu);
pagerListener = new ViewPager.SimpleOnPageChangeListener() {
@Override
public void onPageSelected(int position) {
onPhotoInPagerSelected(position);
}
};
views.pager.setAdapter(pagerAdapter);
views.pager.addOnPageChangeListener(pagerListener);
views.pager.setPageTransformer(true, new DepthPageTransformer());
views.pagerToolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp);
views.pagerToolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(@NonNull View view) {
onBackPressed();
}
});
onCreateOptionsMenuFullMode(views.pagerToolbar.getMenu());
views.pagerToolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
return onOptionsItemSelectedFullMode(item);
}
});
}
Aggregations