use of org.mozilla.focus.firstrun.FirstrunUpgradePagerAdapter in project Rocket by mozilla-tw.
the class FirstrunFragment method findPagerAdapter.
private PagerAdapter findPagerAdapter(Context context, View.OnClickListener onClickListener) {
final PagerAdapter pagerAdapter;
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getContext());
boolean shown = sharedPreferences.getBoolean(PREF_KEY_BOOLEAN_FIRSTRUN_SHOWN, false);
int firstrunUpgradeVersion = sharedPreferences.getInt(PREF_KEY_INT_FIRSTRUN_UPGRADE_VERSION, 0);
if (!shown) {
pagerAdapter = new FirstrunPagerAdapter(context, onClickListener);
} else if (FIRSTRUN_UPGRADE_VERSION > firstrunUpgradeVersion) {
pagerAdapter = new FirstrunUpgradePagerAdapter(context, onClickListener);
} else {
pagerAdapter = null;
}
return pagerAdapter;
}
Aggregations