use of com.quran.labs.androidquran.widgets.SlidingTabLayout in project quran_android by quran.
the class QuranActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
QuranApplication quranApp = (QuranApplication) getApplication();
quranApp.refreshLocale(this, false);
super.onCreate(savedInstanceState);
quranApp.getApplicationComponent().inject(this);
setContentView(R.layout.quran_index);
compositeDisposable = new CompositeDisposable();
settings = QuranSettings.getInstance(this);
isRtl = isRtl();
final Toolbar tb = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(tb);
final ActionBar ab = getSupportActionBar();
if (ab != null) {
ab.setTitle(R.string.app_name);
}
final ViewPager pager = (ViewPager) findViewById(R.id.index_pager);
pager.setOffscreenPageLimit(3);
PagerAdapter pagerAdapter = new PagerAdapter(getSupportFragmentManager());
pager.setAdapter(pagerAdapter);
final SlidingTabLayout indicator = (SlidingTabLayout) findViewById(R.id.indicator);
indicator.setViewPager(pager);
if (isRtl) {
pager.setCurrentItem(TITLES.length - 1);
}
if (savedInstanceState != null) {
showedTranslationUpgradeDialog = savedInstanceState.getBoolean(SI_SHOWED_UPGRADE_DIALOG, false);
}
recentPages = recentPageModel.getLatestPageObservable();
Intent intent = getIntent();
if (intent != null) {
Bundle extras = intent.getExtras();
if (extras != null) {
if (extras.getBoolean(EXTRA_SHOW_TRANSLATION_UPGRADE, false)) {
if (!showedTranslationUpgradeDialog) {
showTranslationsUpgradeDialog();
}
}
}
if (ShortcutsActivity.ACTION_JUMP_TO_LATEST.equals(intent.getAction())) {
jumpToLastPage();
}
}
updateTranslationsListAsNeeded();
}
Aggregations