use of com.quran.labs.androidquran.widgets.IconPageIndicator in project quran_android by quran.
the class PagerActivity method initAyahActionPanel.
private void initAyahActionPanel() {
slidingPanel = (SlidingUpPanelLayout) findViewById(R.id.sliding_panel);
final ViewGroup slidingLayout = (ViewGroup) slidingPanel.findViewById(R.id.sliding_layout);
slidingPager = (ViewPager) slidingPanel.findViewById(R.id.sliding_layout_pager);
final IconPageIndicator slidingPageIndicator = (IconPageIndicator) slidingPanel.findViewById(R.id.sliding_pager_indicator);
// Find close button and set listener
final View closeButton = slidingPanel.findViewById(R.id.sliding_menu_close);
closeButton.setOnClickListener(v -> endAyahMode());
// Create and set fragment pager adapter
slidingPagerAdapter = new SlidingPagerAdapter(getSupportFragmentManager(), Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && (quranSettings.isArabicNames() || QuranUtils.isRtl()));
slidingPager.setAdapter(slidingPagerAdapter);
// Attach the view pager to the action bar
slidingPageIndicator.setViewPager(slidingPager);
// Set sliding layout parameters
int displayHeight = getResources().getDisplayMetrics().heightPixels;
slidingLayout.getLayoutParams().height = (int) (displayHeight * PANEL_MAX_HEIGHT);
slidingPanel.setEnableDragViewTouchEvents(true);
slidingPanel.setPanelSlideListener(new SlidingPanelListener());
slidingLayout.setVisibility(View.GONE);
// When clicking any menu items, expand the panel
slidingPageIndicator.setOnClickListener(v -> {
if (!slidingPanel.isExpanded()) {
slidingPanel.expandPane();
}
});
}
Aggregations