use of com.moro.mtweaks.fragments.other.SettingsFragment in project MTweaks-KernelAdiutorMOD by morogoku.
the class NavigationActivity method onItemSelected.
private void onItemSelected(final int res, boolean delay, boolean saveOpened) {
mDrawer.closeDrawer(GravityCompat.START);
getSupportActionBar().setTitle(getString(res));
mNavigationView.setCheckedItem(res);
mSelection = res;
Fragment fragment = getFragment(res);
if (fragment instanceof RecyclerViewFragment) {
((RecyclerViewFragment) fragment).mDelay = delay;
} else if (fragment instanceof SettingsFragment) {
((SettingsFragment) fragment).mDelay = delay;
}
if (mAllowCommit) {
getSupportFragmentManager().beginTransaction().replace(R.id.content_frame, fragment, res + "_key").commit();
}
if (saveOpened) {
String openedName = fragment.getClass().getSimpleName() + "_opened";
Prefs.saveInt(openedName, Prefs.getInt(openedName, 0, this) + 1, this);
}
setShortcuts();
}
Aggregations