Search in sources :

Example 1 with QuranPageModule

use of com.quran.labs.androidquran.di.module.fragment.QuranPageModule in project quran_android by quran.

the class TabletFragment method onAttach.

@Override
public void onAttach(@NonNull Context context) {
    super.onAttach(context);
    pageNumber = getArguments().getInt(FIRST_PAGE_EXTRA);
    mode = getArguments().getInt(MODE_EXTRA, Mode.ARABIC);
    isSplitScreen = getArguments().getBoolean(IS_SPLIT_SCREEN, false);
    final int[] pages = (isSplitScreen && mode == Mode.TRANSLATION) ? new int[] { pageNumber } : new int[] { pageNumber - 1, pageNumber };
    ((PagerActivity) getActivity()).getPagerActivityComponent().quranPageComponentBuilder().withQuranPageModule(new QuranPageModule(pages)).build().inject(this);
}
Also used : QuranPageModule(com.quran.labs.androidquran.di.module.fragment.QuranPageModule) PagerActivity(com.quran.labs.androidquran.ui.PagerActivity)

Example 2 with QuranPageModule

use of com.quran.labs.androidquran.di.module.fragment.QuranPageModule in project quran_android by quran.

the class QuranPageFragment method onAttach.

@Override
public void onAttach(@NonNull Context context) {
    super.onAttach(context);
    pageNumber = getArguments().getInt(PAGE_NUMBER_EXTRA);
    ((PagerActivity) getActivity()).getPagerActivityComponent().quranPageComponentBuilder().withQuranPageModule(new QuranPageModule(pageNumber)).build().inject(this);
}
Also used : QuranPageModule(com.quran.labs.androidquran.di.module.fragment.QuranPageModule) PagerActivity(com.quran.labs.androidquran.ui.PagerActivity)

Example 3 with QuranPageModule

use of com.quran.labs.androidquran.di.module.fragment.QuranPageModule in project quran_android by quran.

the class TranslationFragment method onAttach.

@Override
public void onAttach(@NonNull Context context) {
    super.onAttach(context);
    pageNumber = getArguments() != null ? getArguments().getInt(PAGE_NUMBER_EXTRA) : -1;
    ((PagerActivity) getActivity()).getPagerActivityComponent().quranPageComponentBuilder().withQuranPageModule(new QuranPageModule(pageNumber)).build().inject(this);
}
Also used : QuranPageModule(com.quran.labs.androidquran.di.module.fragment.QuranPageModule) PagerActivity(com.quran.labs.androidquran.ui.PagerActivity)

Aggregations

QuranPageModule (com.quran.labs.androidquran.di.module.fragment.QuranPageModule)3 PagerActivity (com.quran.labs.androidquran.ui.PagerActivity)3