use of com.android.settings.SettingsActivity in project packages_apps_Settings by PixelExperience.
the class AutomaticStorageManagerSettings method initializeSwitchBar.
private void initializeSwitchBar() {
final SettingsActivity activity = (SettingsActivity) getActivity();
mSwitchBar = activity.getSwitchBar();
mSwitchBar.setTitle(getContext().getString(R.string.automatic_storage_manager_primary_switch_title));
mSwitchBar.show();
mSwitchController = new AutomaticStorageManagerSwitchBarController(getContext(), mSwitchBar, mMetricsFeatureProvider, mDaysToRetain, getFragmentManager());
}
use of com.android.settings.SettingsActivity in project packages_apps_Settings by PixelExperience.
the class WifiTetherSettings method onActivityCreated.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
if (mUnavailable) {
return;
}
// Assume we are in a SettingsActivity. This is only safe because we currently use
// SettingsActivity as base for all preference fragments.
final SettingsActivity activity = (SettingsActivity) getActivity();
final SettingsMainSwitchBar switchBar = activity.getSwitchBar();
switchBar.setTitle(getContext().getString(R.string.use_wifi_hotsopt_main_switch_title));
mSwitchBarController = new WifiTetherSwitchBarController(activity, switchBar);
getSettingsLifecycle().addObserver(mSwitchBarController);
switchBar.show();
}
use of com.android.settings.SettingsActivity in project packages_apps_Settings by PixelExperience.
the class BluetoothDashboardFragment method onActivityCreated.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
SettingsActivity activity = (SettingsActivity) getActivity();
mSwitchBar = activity.getSwitchBar();
mSwitchBar.setTitle(getContext().getString(R.string.bluetooth_main_switch_title));
mController = new BluetoothSwitchPreferenceController(activity, new MainSwitchBarController(mSwitchBar), mFooterPreference);
Lifecycle lifecycle = getSettingsLifecycle();
if (lifecycle != null) {
lifecycle.addObserver(mController);
}
}
use of com.android.settings.SettingsActivity in project packages_apps_Settings by PixelExperience.
the class PowerUsageSummary method onAttach.
@Override
public void onAttach(Context context) {
super.onAttach(context);
final SettingsActivity activity = (SettingsActivity) getActivity();
mBatteryHeaderPreferenceController = use(BatteryHeaderPreferenceController.class);
mBatteryHeaderPreferenceController.setActivity(activity);
mBatteryHeaderPreferenceController.setFragment(this);
mBatteryHeaderPreferenceController.setLifecycle(getSettingsLifecycle());
mBatteryTipPreferenceController = use(BatteryTipPreferenceController.class);
mBatteryTipPreferenceController.setActivity(activity);
mBatteryTipPreferenceController.setFragment(this);
mBatteryTipPreferenceController.setBatteryTipListener(this::onBatteryTipHandled);
}
use of com.android.settings.SettingsActivity in project packages_apps_Settings by PixelExperience.
the class UserSettings method onActivityCreated.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
// Assume we are in a SettingsActivity. This is only safe because we currently use
// SettingsActivity as base for all preference fragments.
final SettingsActivity activity = (SettingsActivity) getActivity();
final SettingsMainSwitchBar switchBar = activity.getSwitchBar();
switchBar.setTitle(getContext().getString(R.string.multiple_users_main_switch_title));
switchBar.show();
mSwitchBarController = new MultiUserSwitchBarController(activity, new MainSwitchBarController(switchBar), this);
getSettingsLifecycle().addObserver(mSwitchBarController);
}
Aggregations