use of com.quran.labs.androidquran.ui.QuranActivity in project quran_android by quran.
the class JuzListFragment method onResume.
@Override
public void onResume() {
final Activity activity = getActivity();
if (activity instanceof QuranActivity) {
disposable = ((QuranActivity) activity).getLatestPageObservable().first(Constants.NO_PAGE).observeOn(AndroidSchedulers.mainThread()).subscribeWith(new DisposableSingleObserver<Integer>() {
@Override
public void onSuccess(Integer recentPage) {
if (recentPage != Constants.NO_PAGE) {
int juz = quranInfo.getJuzFromPage(recentPage);
int position = (juz - 1) * 9;
mRecyclerView.scrollToPosition(position);
}
}
@Override
public void onError(Throwable e) {
}
});
}
QuranSettings settings = QuranSettings.getInstance(activity);
if (settings.isArabicNames()) {
updateScrollBarPositionHoneycomb();
}
super.onResume();
}
use of com.quran.labs.androidquran.ui.QuranActivity in project quran_android by quran.
the class SuraListFragment method onResume.
@Override
public void onResume() {
final Activity activity = getActivity();
if (activity instanceof QuranActivity) {
QuranSettings settings = QuranSettings.getInstance(activity);
disposable = ((QuranActivity) activity).getLatestPageObservable().first(Constants.NO_PAGE).observeOn(AndroidSchedulers.mainThread()).subscribeWith(new DisposableSingleObserver<Integer>() {
@Override
public void onSuccess(Integer recentPage) {
if (recentPage != Constants.NO_PAGE) {
int sura = quranInfo.safelyGetSuraOnPage(recentPage);
int juz = quranInfo.getJuzFromPage(recentPage);
int position = sura + juz - 1;
mRecyclerView.scrollToPosition(position);
}
}
@Override
public void onError(Throwable e) {
}
});
if (settings.isArabicNames()) {
updateScrollBarPositionHoneycomb();
}
}
super.onResume();
}
Aggregations