use of com.quran.labs.androidquran.view.IconPageIndicator in project quran_android by quran.
the class PagerActivity method initAyahActionPanel.
private void initAyahActionPanel() {
slidingPanel = findViewById(R.id.sliding_panel);
final ViewGroup slidingLayout = slidingPanel.findViewById(R.id.sliding_layout);
slidingPager = slidingPanel.findViewById(R.id.sliding_layout_pager);
final IconPageIndicator slidingPageIndicator = 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(), quranSettings.isArabicNames() || QuranUtils.isRtl(), additionalAyahPanels);
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