use of android.app.FragmentManager in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ZenModeScheduleRuleSettings method onCreateInternal.
@Override
protected void onCreateInternal() {
addPreferencesFromResource(R.xml.zen_mode_schedule_rule_settings);
final PreferenceScreen root = getPreferenceScreen();
mDays = root.findPreference(KEY_DAYS);
mDays.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
showDaysDialog();
return true;
}
});
final FragmentManager mgr = getFragmentManager();
mStart = new TimePickerPreference(getPrefContext(), mgr);
mStart.setKey(KEY_START_TIME);
mStart.setTitle(R.string.zen_mode_start_time);
mStart.setCallback(new TimePickerPreference.Callback() {
@Override
public boolean onSetTime(final int hour, final int minute) {
if (mDisableListeners)
return true;
if (!ZenModeConfig.isValidHour(hour))
return false;
if (!ZenModeConfig.isValidMinute(minute))
return false;
if (hour == mSchedule.startHour && minute == mSchedule.startMinute) {
return true;
}
if (DEBUG)
Log.d(TAG, "onPrefChange start h=" + hour + " m=" + minute);
mSchedule.startHour = hour;
mSchedule.startMinute = minute;
updateRule(ZenModeConfig.toScheduleConditionId(mSchedule));
return true;
}
});
root.addPreference(mStart);
mStart.setDependency(mDays.getKey());
mEnd = new TimePickerPreference(getPrefContext(), mgr);
mEnd.setKey(KEY_END_TIME);
mEnd.setTitle(R.string.zen_mode_end_time);
mEnd.setCallback(new TimePickerPreference.Callback() {
@Override
public boolean onSetTime(final int hour, final int minute) {
if (mDisableListeners)
return true;
if (!ZenModeConfig.isValidHour(hour))
return false;
if (!ZenModeConfig.isValidMinute(minute))
return false;
if (hour == mSchedule.endHour && minute == mSchedule.endMinute) {
return true;
}
if (DEBUG)
Log.d(TAG, "onPrefChange end h=" + hour + " m=" + minute);
mSchedule.endHour = hour;
mSchedule.endMinute = minute;
updateRule(ZenModeConfig.toScheduleConditionId(mSchedule));
return true;
}
});
root.addPreference(mEnd);
mEnd.setDependency(mDays.getKey());
mExitAtAlarm = (SwitchPreference) root.findPreference(KEY_EXIT_AT_ALARM);
mExitAtAlarm.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object o) {
mSchedule.exitAtAlarm = (Boolean) o;
updateRule(ZenModeConfig.toScheduleConditionId(mSchedule));
return true;
}
});
}
use of android.app.FragmentManager in project SunDay by iQuick.
the class MainActivity method replaceFragment.
protected void replaceFragment(int viewId, BaseFragment fragment) {
FragmentManager fragmentManager = getFragmentManager();
fragmentManager.beginTransaction().replace(viewId, fragment).commit();
}
use of android.app.FragmentManager in project Android-IMSI-Catcher-Detector by CellularPrivacy.
the class MapPrefActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
MapPrefFragment settingsFragment = new MapPrefFragment();
FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.replace(android.R.id.content, settingsFragment);
fragmentTransaction.commit();
}
use of android.app.FragmentManager in project Android-IMSI-Catcher-Detector by CellularPrivacy.
the class PrefActivity method loadFragment.
private void loadFragment() {
PrefFragment settingsFragment = new PrefFragment();
FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.replace(android.R.id.content, settingsFragment);
fragmentTransaction.commit();
}
use of android.app.FragmentManager in project Android-IMSI-Catcher-Detector by CellularPrivacy.
the class SettingsActivity method loadFragment.
private void loadFragment() {
SettingsFragment settingsFragment = new SettingsFragment();
FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.replace(android.R.id.content, settingsFragment);
fragmentTransaction.commit();
}
Aggregations