use of com.android.settings.widget.MainSwitchBarController in project android_packages_apps_Settings by omnirom.
the class GraphicsDriverDashboard method onActivityCreated.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
final SettingsActivity activity = (SettingsActivity) getActivity();
final SettingsMainSwitchBar switchBar = activity.getSwitchBar();
final GraphicsDriverGlobalSwitchBarController switchBarController = new GraphicsDriverGlobalSwitchBarController(activity, new MainSwitchBarController(switchBar));
getSettingsLifecycle().addObserver(switchBarController);
switchBar.setTitle(getContext().getString(R.string.graphics_driver_main_switch_title));
switchBar.show();
}
use of com.android.settings.widget.MainSwitchBarController in project android_packages_apps_Settings by omnirom.
the class WirelessDebuggingFragment method onActivityCreated.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
final SettingsActivity activity = (SettingsActivity) getActivity();
final SettingsMainSwitchBar switchBar = activity.getSwitchBar();
switchBar.setTitle(getContext().getString(R.string.wireless_debugging_main_switch_title));
mWifiDebuggingEnabler = new WirelessDebuggingEnabler(activity, new MainSwitchBarController(switchBar), this, getSettingsLifecycle());
}
use of com.android.settings.widget.MainSwitchBarController in project android_packages_apps_Settings by omnirom.
the class AllInOneTetherSettings 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 BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
if (adapter != null) {
adapter.getProfileProxy(activity.getApplicationContext(), mProfileServiceListener, BluetoothProfile.PAN);
}
final SettingsMainSwitchBar mainSwitch = activity.getSwitchBar();
mTetherEnabler = new TetherEnabler(activity, new MainSwitchBarController(mainSwitch), mBluetoothPan);
getSettingsLifecycle().addObserver(mTetherEnabler);
use(UsbTetherPreferenceController.class).setTetherEnabler(mTetherEnabler);
use(BluetoothTetherPreferenceController.class).setTetherEnabler(mTetherEnabler);
use(EthernetTetherPreferenceController.class).setTetherEnabler(mTetherEnabler);
use(WifiTetherDisablePreferenceController.class).setTetherEnabler(mTetherEnabler);
mainSwitch.show();
}
use of com.android.settings.widget.MainSwitchBarController in project android_packages_apps_Settings by omnirom.
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);
}
use of com.android.settings.widget.MainSwitchBarController in project android_packages_apps_Settings by omnirom.
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);
}
}
Aggregations