Search in sources :

Example 6 with QuranPage

use of com.quran.labs.androidquran.ui.helpers.QuranPage in project quran_android by quran.

the class PagerActivity method selectAyah.

private void selectAyah(SuraAyah s) {
    final int page = quranInfo.getPageFromSuraAyah(s.sura, s.ayah);
    final int position = quranInfo.getPosFromPage(page, isDualPages);
    Fragment f = pagerAdapter.getFragmentIfExists(position);
    if (f instanceof QuranPage && f.isVisible()) {
        if (position != viewPager.getCurrentItem()) {
            viewPager.setCurrentItem(position);
        }
        updateAyahStartSelection(s, ((QuranPage) f).getAyahTracker());
    }
}
Also used : QuranPage(com.quran.labs.androidquran.ui.helpers.QuranPage) TabletFragment(com.quran.labs.androidquran.ui.fragment.TabletFragment) Fragment(android.support.v4.app.Fragment) AyahActionFragment(com.quran.labs.androidquran.ui.fragment.AyahActionFragment) TranslationFragment(com.quran.labs.androidquran.ui.fragment.TranslationFragment) JumpFragment(com.quran.labs.androidquran.ui.fragment.JumpFragment)

Example 7 with QuranPage

use of com.quran.labs.androidquran.ui.helpers.QuranPage in project quran_android by quran.

the class PagerActivity method unHighlightAyah.

private void unHighlightAyah(int sura, int ayah, HighlightType type) {
    int position = viewPager.getCurrentItem();
    Fragment f = pagerAdapter.getFragmentIfExists(position);
    if (f instanceof QuranPage && f.isVisible()) {
        ((QuranPage) f).getAyahTracker().unHighlightAyah(sura, ayah, type);
    }
}
Also used : QuranPage(com.quran.labs.androidquran.ui.helpers.QuranPage) TabletFragment(com.quran.labs.androidquran.ui.fragment.TabletFragment) Fragment(android.support.v4.app.Fragment) AyahActionFragment(com.quran.labs.androidquran.ui.fragment.AyahActionFragment) TranslationFragment(com.quran.labs.androidquran.ui.fragment.TranslationFragment) JumpFragment(com.quran.labs.androidquran.ui.fragment.JumpFragment)

Aggregations

QuranPage (com.quran.labs.androidquran.ui.helpers.QuranPage)7 Fragment (android.support.v4.app.Fragment)5 AyahActionFragment (com.quran.labs.androidquran.ui.fragment.AyahActionFragment)5 JumpFragment (com.quran.labs.androidquran.ui.fragment.JumpFragment)5 TabletFragment (com.quran.labs.androidquran.ui.fragment.TabletFragment)5 TranslationFragment (com.quran.labs.androidquran.ui.fragment.TranslationFragment)5 SuraAyah (com.quran.labs.androidquran.data.SuraAyah)1