Search in sources :

Example 1 with IconPageIndicator

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();
        }
    });
}
Also used : ViewGroup(android.view.ViewGroup) SearchView(androidx.appcompat.widget.SearchView) View(android.view.View) IconPageIndicator(com.quran.labs.androidquran.view.IconPageIndicator) SlidingPagerAdapter(com.quran.labs.androidquran.ui.helpers.SlidingPagerAdapter)

Aggregations

View (android.view.View)1 ViewGroup (android.view.ViewGroup)1 SearchView (androidx.appcompat.widget.SearchView)1 SlidingPagerAdapter (com.quran.labs.androidquran.ui.helpers.SlidingPagerAdapter)1 IconPageIndicator (com.quran.labs.androidquran.view.IconPageIndicator)1