Search in sources :

Example 1 with SettingsFragment

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();
}
Also used : SettingsFragment(com.moro.mtweaks.fragments.other.SettingsFragment) RecyclerViewFragment(com.moro.mtweaks.fragments.RecyclerViewFragment) LMKFragment(com.moro.mtweaks.fragments.kernel.LMKFragment) BackupFragment(com.moro.mtweaks.fragments.tools.BackupFragment) BuildpropFragment(com.moro.mtweaks.fragments.tools.BuildpropFragment) RecyclerViewFragment(com.moro.mtweaks.fragments.RecyclerViewFragment) Fragment(android.support.v4.app.Fragment) ThermalFragment(com.moro.mtweaks.fragments.kernel.ThermalFragment) EntropyFragment(com.moro.mtweaks.fragments.kernel.EntropyFragment) OverallFragment(com.moro.mtweaks.fragments.statistics.OverallFragment) CPUVoltageCl0Fragment(com.moro.mtweaks.fragments.kernel.CPUVoltageCl0Fragment) ScreenFragment(com.moro.mtweaks.fragments.kernel.ScreenFragment) LEDFragment(com.moro.mtweaks.fragments.kernel.LEDFragment) CPUFragment(com.moro.mtweaks.fragments.kernel.CPUFragment) DeviceFragment(com.moro.mtweaks.fragments.statistics.DeviceFragment) MemoryFragment(com.moro.mtweaks.fragments.statistics.MemoryFragment) AboutFragment(com.moro.mtweaks.fragments.other.AboutFragment) InitdFragment(com.moro.mtweaks.fragments.tools.InitdFragment) RecoveryFragment(com.moro.mtweaks.fragments.tools.RecoveryFragment) WakelockFragment(com.moro.mtweaks.fragments.kernel.WakelockFragment) CPUVoltageCl1Fragment(com.moro.mtweaks.fragments.kernel.CPUVoltageCl1Fragment) SoundFragment(com.moro.mtweaks.fragments.kernel.SoundFragment) IOFragment(com.moro.mtweaks.fragments.kernel.IOFragment) DvfsFragment(com.moro.mtweaks.fragments.kernel.DvfsFragment) SpectrumFragment(com.moro.mtweaks.fragments.kernel.SpectrumFragment) MiscFragment(com.moro.mtweaks.fragments.kernel.MiscFragment) SettingsFragment(com.moro.mtweaks.fragments.other.SettingsFragment) CustomControlsFragment(com.moro.mtweaks.fragments.tools.customcontrols.CustomControlsFragment) BoefflaWakelockFragment(com.moro.mtweaks.fragments.kernel.BoefflaWakelockFragment) ContributorsFragment(com.moro.mtweaks.fragments.other.ContributorsFragment) ProfileFragment(com.moro.mtweaks.fragments.tools.ProfileFragment) GPUFragment(com.moro.mtweaks.fragments.kernel.GPUFragment) VMFragment(com.moro.mtweaks.fragments.kernel.VMFragment) DownloadsFragment(com.moro.mtweaks.fragments.tools.downloads.DownloadsFragment) DonationFragment(com.moro.mtweaks.fragments.other.DonationFragment) BaseFragment(com.moro.mtweaks.fragments.BaseFragment) KSMFragment(com.moro.mtweaks.fragments.kernel.KSMFragment) BatteryFragment(com.moro.mtweaks.fragments.kernel.BatteryFragment) InputsFragment(com.moro.mtweaks.fragments.statistics.InputsFragment) HmpFragment(com.moro.mtweaks.fragments.kernel.HmpFragment) OnBootFragment(com.moro.mtweaks.fragments.tools.OnBootFragment) CPUHotplugFragment(com.moro.mtweaks.fragments.kernel.CPUHotplugFragment)

Aggregations

Fragment (android.support.v4.app.Fragment)1 BaseFragment (com.moro.mtweaks.fragments.BaseFragment)1 RecyclerViewFragment (com.moro.mtweaks.fragments.RecyclerViewFragment)1 BatteryFragment (com.moro.mtweaks.fragments.kernel.BatteryFragment)1 BoefflaWakelockFragment (com.moro.mtweaks.fragments.kernel.BoefflaWakelockFragment)1 CPUFragment (com.moro.mtweaks.fragments.kernel.CPUFragment)1 CPUHotplugFragment (com.moro.mtweaks.fragments.kernel.CPUHotplugFragment)1 CPUVoltageCl0Fragment (com.moro.mtweaks.fragments.kernel.CPUVoltageCl0Fragment)1 CPUVoltageCl1Fragment (com.moro.mtweaks.fragments.kernel.CPUVoltageCl1Fragment)1 DvfsFragment (com.moro.mtweaks.fragments.kernel.DvfsFragment)1 EntropyFragment (com.moro.mtweaks.fragments.kernel.EntropyFragment)1 GPUFragment (com.moro.mtweaks.fragments.kernel.GPUFragment)1 HmpFragment (com.moro.mtweaks.fragments.kernel.HmpFragment)1 IOFragment (com.moro.mtweaks.fragments.kernel.IOFragment)1 KSMFragment (com.moro.mtweaks.fragments.kernel.KSMFragment)1 LEDFragment (com.moro.mtweaks.fragments.kernel.LEDFragment)1 LMKFragment (com.moro.mtweaks.fragments.kernel.LMKFragment)1 MiscFragment (com.moro.mtweaks.fragments.kernel.MiscFragment)1 ScreenFragment (com.moro.mtweaks.fragments.kernel.ScreenFragment)1 SoundFragment (com.moro.mtweaks.fragments.kernel.SoundFragment)1